From 13baccada8abfec39a73226a96d0436ecf456b5a Mon Sep 17 00:00:00 2001 From: Pratham Patel Date: Tue, 23 Aug 2022 16:45:00 +0530 Subject: [PATCH] added post for enabling ZFS send and recv --- content/posts/zfs-send-recv.md | 71 ++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 content/posts/zfs-send-recv.md diff --git a/content/posts/zfs-send-recv.md b/content/posts/zfs-send-recv.md new file mode 100644 index 0000000..5f7e6fe --- /dev/null +++ b/content/posts/zfs-send-recv.md @@ -0,0 +1,71 @@ +--- + +title: "ZFS send and recv" +date: 2022-07-23T07:00:00+05:30 +draft: false +toc: true + +--- + +## Step 0000: Configure SSH Access + +**On the sender's system:** + +```bash +cd ~/.ssh/ +ssh-keygen -t ed25519 -f zfs_send +``` + +```bash +echo " +Host hostname.localdomain + Hostname + User root + IdentityFile ~/.ssh/zfs_send + Port +" | tee -a ~/.ssh/config +``` + +--- + +**On the receiving system:** + +`sudoedit /etc/ssh/sshd_config` + +``` +[...] +PermitRootLogin yes +[...] +``` + +```bash +user $ sudo -i + +root # echo "zfs_send.pub" | tee -a ~/.ssh/authorized_keys +``` + +`sudo systemctl restart sshd` + +**This guide was possible because of the _[amazing documentation of Klara Systems](https://klarasystems.com/articles/introduction-to-zfs-replication/)_.** + + +## Step 0001: Delegate ZFS administration permissions to unprivileged users + +**On the sender's system:** + +```bash +sudo zfs allow -u USER send,snapshot,hold POOL +``` + +**On the receiving end:** + +```bash +sudo zfs allow -u USER compression,mountpoint,create,mount,receive POOL +``` + +## Step 0010: Send + +```zfs +sudo zfs snapshot @sendtest +zfs sent -v @sendtest | ssh hostname.localdomain zfs receive /backups/ +```