I installed Ubuntu using the encrypted ZFS option it gave me. I am new to ZFS and am trying to figure out a backup plan, and test it. In my case I want to back up the snapshot to my NAS. Another answer here gets me parts of the way there. Below is what I have so far.
Creating backups:
zfs snapshot -r rpool@snapshotname
-- this snapshots everything in rpool, including root and user datazfs send --replicate --raw rpool@snapshotname > /mnt/nas-mount/ubuntu-snapshots/snapshotname.zstream
-- save the raw, encrypted snapshot and all children datasets to my NAS, which is mounted on my file system
Now when my system gets broken, to restore from the snapshot on my NAS, I will boot from an Ubuntu Live usb and do the following (this is what I'm unsure about):
- Mount the NFS directory
zfs receive newrpool < /mnt/nas-mount/ubuntu-snapshots/snapshotname.zstream
-- receives the raw, encrypted snapshot as a newnewrpool
snapshot (I think usingrpool
isn't allowed since that's the file system Ubuntu is already using?)zfs list -r -t snapshot -o name
-- get the list of snapshotszfs rollback -rR NAME
-- run this for every snapshot listed above (or just the ones I want to overwrite, such as the ROOT or USERDATA snapshots)
My questions:
- Are the above steps sufficient?
- The encryption keys are in the root dataset, so after running the above, when I reboot I will automatically be asked to enter my password to decrypt the rpool and it should work, correct?
- No online examples mention choosing which partition zfs should look at to find the pools, nor which disk to restore the snapshots to. Does it automatically scan all available disks to find a pool by name?
- Should I backup bpool? If my whole hard drive fails, I'm assuming I can reinstall stock Ubuntu to recreate bpool, and then restore rpool. Right?