From 249b040e48a9d08ae8c9419eaed1717e241d655d Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Sun, 12 Jul 2020 01:03:31 +0200 Subject: Documentation added --- README.md | 33 +++++++++++++++++++++++++++++++ systemd-zfs-partition-backup/AUR/PKGBUILD | 6 +++++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..a1f7950 --- /dev/null +++ b/README.md @@ -0,0 +1,33 @@ +# systemd-zfs-partition-backup.sh + +## How to: + +1. rsync is required and used internally with `--delete` to get rid of already deleted files (with zfs we have snapshots) +2. systemd-automount should be working for the device to back up (=fstab) +3. A zfs dataset will be searched with the name of the partition. If it is there it will be used for the backup. +4. if the partion is encrypted an entry in the `crypttab` will automatically be found by automount. +5. have fun. + + +### crypttab + +``` +# /etc/crypttab example + +SomeDisk_SDSSDH0000G_123456789-part2 /dev/disk/by-id/SomeDisk_SDSSDH0000G_123456789-part2 /etc/.crypt/SomeDisk_SDSSDH0000G_123456789-part2.key noauto,x-systemd.device-timeout=5s +``` + +### fstab + +``` +# /etc/fstab example + +# Note that the connector name has been removed from the mountpoint. +# The automount unit will be named after that and so must the zfs dataset +/dev/disk/by-id/ata-SomeDisk_SDSSDH0000G_123456789-part1 /media/SomeDisk_SDSSDH0000G_123456789-part1 auto defaults,noauto,ro,x-systemd.automount,x-mount.mkdir,x-systemd.idle-timeout=1min,x-systemd.device-timeout=5s 0 0 + +# The following name takes the name we gave our disk in the crypttab (first column). +# Such devices are then available via /dev/mapper/: +/dev/mapper/SomeDisk_SDSSDH0000G_123456789-part2 /media/SomeDisk_SDSSDH0000G_123456789-part2 auto defaults,noauto,ro,x-systemd.automount,x-mount.mkdir,x-systemd.idle-timeout=1min,x-systemd.device-timeout=5s 0 0 +``` + diff --git a/systemd-zfs-partition-backup/AUR/PKGBUILD b/systemd-zfs-partition-backup/AUR/PKGBUILD index b0fd026..21acfb4 100644 --- a/systemd-zfs-partition-backup/AUR/PKGBUILD +++ b/systemd-zfs-partition-backup/AUR/PKGBUILD @@ -11,9 +11,10 @@ depends=( 'systemd' 'kbd' 'mkinitcpio' + 'rsync' ) source=("http://git.entwicklerseite.de/zfs-bash-tools/snapshot/zfs-bash-tools-master.tar.gz") -sha256sums=('ef17307fcf662f867b98e6b5d883f2eb9fcd1f38205d516d9f85f53787ed58f1') +sha256sums=('efb8f8f11401ffb8afc4ad228f9c6d6daffcd2451940d922a31b85076623a932') package() { install -D zfs-bash-tools-master/${pkgname}.sh \ @@ -24,6 +25,9 @@ package() { install -D -m 644 zfs-bash-tools-master/${pkgname}/udev/rules.d/90-${pkgname}.rules \ ../pkg/${pkgname}/etc/udev/rules.d/90-${pkgname}.rules + + systemctl daemon-reload + udevadm control --reaload } # vim: ft=bash -- cgit v1.2.3