diff options
author | Max Christian Pohle | 2020-07-12 01:03:31 +0200 |
---|---|---|
committer | Max Christian Pohle | 2020-07-12 01:03:31 +0200 |
commit | 249b040e48a9d08ae8c9419eaed1717e241d655d (patch) | |
tree | 76cefa303ed9b55b515acac569e10d0b121aa0bf | |
parent | 390e12c0ba21858f2d4c967b769768d6d1b9bace (diff) | |
download | zfs-bash-tools-249b040e48a9d08ae8c9419eaed1717e241d655d.tar.bz2 zfs-bash-tools-249b040e48a9d08ae8c9419eaed1717e241d655d.zip |
Documentation added
-rw-r--r-- | README.md | 33 | ||||
-rw-r--r-- | systemd-zfs-partition-backup/AUR/PKGBUILD | 6 |
2 files changed, 38 insertions, 1 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..a1f7950 --- /dev/null +++ b/README.md | |||
@@ -0,0 +1,33 @@ | |||
1 | # systemd-zfs-partition-backup.sh | ||
2 | |||
3 | ## How to: | ||
4 | |||
5 | 1. rsync is required and used internally with `--delete` to get rid of already deleted files (with zfs we have snapshots) | ||
6 | 2. systemd-automount should be working for the device to back up (=fstab) | ||
7 | 3. A zfs dataset will be searched with the name of the partition. If it is there it will be used for the backup. | ||
8 | 4. if the partion is encrypted an entry in the `crypttab` will automatically be found by automount. | ||
9 | 5. have fun. | ||
10 | |||
11 | |||
12 | ### crypttab | ||
13 | |||
14 | ``` | ||
15 | # /etc/crypttab example | ||
16 | |||
17 | 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 | ||
18 | ``` | ||
19 | |||
20 | ### fstab | ||
21 | |||
22 | ``` | ||
23 | # /etc/fstab example | ||
24 | |||
25 | # Note that the connector name has been removed from the mountpoint. | ||
26 | # The automount unit will be named after that and so must the zfs dataset | ||
27 | /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 | ||
28 | |||
29 | # The following name takes the name we gave our disk in the crypttab (first column). | ||
30 | # Such devices are then available via /dev/mapper/: | ||
31 | /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 | ||
32 | ``` | ||
33 | |||
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=( | |||
11 | 'systemd' | 11 | 'systemd' |
12 | 'kbd' | 12 | 'kbd' |
13 | 'mkinitcpio' | 13 | 'mkinitcpio' |
14 | 'rsync' | ||
14 | ) | 15 | ) |
15 | source=("http://git.entwicklerseite.de/zfs-bash-tools/snapshot/zfs-bash-tools-master.tar.gz") | 16 | source=("http://git.entwicklerseite.de/zfs-bash-tools/snapshot/zfs-bash-tools-master.tar.gz") |
16 | sha256sums=('ef17307fcf662f867b98e6b5d883f2eb9fcd1f38205d516d9f85f53787ed58f1') | 17 | sha256sums=('efb8f8f11401ffb8afc4ad228f9c6d6daffcd2451940d922a31b85076623a932') |
17 | 18 | ||
18 | package() { | 19 | package() { |
19 | install -D zfs-bash-tools-master/${pkgname}.sh \ | 20 | install -D zfs-bash-tools-master/${pkgname}.sh \ |
@@ -24,6 +25,9 @@ package() { | |||
24 | 25 | ||
25 | install -D -m 644 zfs-bash-tools-master/${pkgname}/udev/rules.d/90-${pkgname}.rules \ | 26 | install -D -m 644 zfs-bash-tools-master/${pkgname}/udev/rules.d/90-${pkgname}.rules \ |
26 | ../pkg/${pkgname}/etc/udev/rules.d/90-${pkgname}.rules | 27 | ../pkg/${pkgname}/etc/udev/rules.d/90-${pkgname}.rules |
28 | |||
29 | systemctl daemon-reload | ||
30 | udevadm control --reaload | ||
27 | } | 31 | } |
28 | 32 | ||
29 | # vim: ft=bash | 33 | # vim: ft=bash |