Noob with zfs send/recv-question to backup my primary proxmox SSD-disk

virtManager

Active Member
Jun 11, 2020
30
4
28
45
Hi,

I've been trying to google this, but there's so much so please forgive if I didn't find the answer. I found this excellent guide of how to use zfs send/recv on my system GUIDE TO ZFS SEND/RECV LINK - however, I just need a bit extra clarification before I try it. My situation is that I'm running pfSense virtualized on my Proxmox-system which takes care of all my networking, internet etc and this is the output of "zfs list":

Code:
# zfs list
NAME                           USED  AVAIL  REFER  MOUNTPOINT
backup_pool                    148K   922G    24K  /backup_pool
backup_pool/backupDataSet       24K   922G    24K  /backup_pool/backupDataSet
rpool                          244G   678G   104K  /rpool
rpool/ROOT                    10.4G   678G    96K  /rpool/ROOT
rpool/ROOT/pve-1              10.4G   678G  9.65G  /
rpool/data                     134G   678G    96K  /rpool/data
rpool/data/base-9000-disk-0   1.01G   678G  1.01G  -
rpool/data/subvol-101-disk-0  6.79M  1.99G  6.79M  /rpool/data/subvol-101-disk-0
rpool/data/subvol-102-disk-0  1.31G  7.14G   884M  /rpool/data/subvol-102-disk-0
rpool/data/vm-100-disk-0       328K   678G   172K  -
rpool/data/vm-100-disk-1      34.8G   678G  13.3G  -
rpool/data/vm-123-cloudinit    216K   678G    72K  -
rpool/data/vm-123-disk-0      88.5G   678G  84.3G  -
rpool/data/vm-200-disk-0        76K   678G    76K  -
rpool/data/vm-200-disk-1      8.13G   678G  8.13G  -
rpool/data/vm-9000-cloudinit    88K   678G    72K  -
rpool/turnkeyFileServerLXC     100G   678G   100G  /rpool/turnkeyFileServerLXC

Here's where I need clarification in relation to GUIDE TO ZFS SEND/RECV LINK:
  1. Step 1: I don't think I should enable any kind of "maintenance mode" because then I suspect I would lose my internet and LAN connectivity and thereby lose my SSH-connection.
  2. Step 2: No questions, I've created backup_pool/backupDataSet as shown above...
  3. Step 3: Create a snapshot. This is what's confusing me:
    1. The instructions says to use "zfs snapshot -R YourPool/YourDatastoreDataset@move" but I couldn't see what option "-R" does and why it's needed? Is this a mistake?
    2. I think I need to reboot from a USB-disk and attach a keyboard + display and create the snapshot before fully booting up Proxmox, pfSense and everything else. I think I could then do: "zfs snapshot -r rpool@move" to recursively generate a backup of the whole rpool. Is this what I should do, because that's 244 GB?
  4. Step 4: Then I would do "zfs send -R rpool@move | zfs recv backup_pool/backupDataSet" and all 244 GB would be transferred. Is this correct?
Steps 5-9 are perhaps not too important for me to ask questions about... Just hope to hear if I'm doing anything wrong or if I'm missing anything so far...
 
Assuming you're trying to send rpool/data to backup_pool, you do need to take a snapshot which 'freezes' the state of the disk while its copying the blocks. Note that you do not HAVE to stop the VM to do this, but your VM would ideally be aware to flush the cache before that happens (there is a command you can send to make sure that happens look for fs-freeze).

zfs snapshot does not have an -R but -r option which is recursive, so all dependent datasets will get a snapshot with the same tags.

Then yes, zfs send & receive will make sure that you get all your data up to the point of the snapshot in the other pool.

There are some utilities people have written over time to do all kinds of funky stuff with zfs send, so there are quite a bit of options (send it to S3 buckets, send it to other servers etc).

Note that Proxmox Backup Server is also an option and will handle all this for you.
 
I was thinking that the safest would be to snapshot everything in a state where neither Proxmox nor any VMs are running. So I could boot up from USB and create a snapshot while nothing runs and then reboot and run the zfs send/recv of the snapshot. But maybe nobody does that and maybe I shouldn't worry and just make the snapshot of my "live/running system"?

As for "zfs snapshot -R" - thanks! So a mistake was made in the original post I used for inspiration.

As for "fs-freeze" and utilities such as Proxmox Backup Server: Yes, I also want to go down that path, but first I prefer to get more "hands-on" experience by doing things manually so I get to learn things properly. After that I also want to use ready-made utilities and PBS to make things easier.

I'll play with this, probably tomorrow - thanks a lot!