Is restoring a backed-up root dataset as easy as just doing a zfs send/receive?

I'm planning to attempt something on a server that will cause its disks to be wiped, so in the event that I need to undo what I've done, I will need to be able to restore the server's root pool.

The server is FreeBSD 14.1 with a single zfs pool (or at least only one that I care about for this) named primary which has been recursively snapshotted with zfs snapshot -r primary@testsnapshot, and the snapshot offloaded to a backup disk with zfs send -R primary@testsnapshot|zfs receive backup/test. primary consists of two mirrored geli devices (which are located on a pair of nvme disks).

Am I correct in thinking that if I need to do a total restoration, all I will need to do is install 14.1 from the installation media and do another send/receive to restore my backed-up snapshot to the new installation using -F option to overwrite the destination?

Or would it be simpler to just take a dd image of the two disks? Would simply rewriting those images onto their respective disks put everything back in the state they were in when the image was taken with no additional work required?
 
Today I just restored my system a couple of times with zfs send/receive. I have hard drives that i use for backup purposes and i took recursive snapshot of my root pool and saved it as a file on backup drive. I boot FreeBSD live medium, create root pool manually then receive the snapshot to the created root pool, set bootfs etc. I use geli too.
 
I'm planning to attempt something on a server that will cause its disks to be wiped, so in the event that I need to undo what I've done, I will need to be able to restore the server's root pool.
If possible I would replace the disks with new ones and keep the original disks as backup. This introduces almost no risk at all. If this is not possible I would take three path in parallel, just to be sure
  1. Backup all configuration an user data
  2. dd the disks
  3. Use zfs snapshots
In best case you can run a test first to verify that the restore is successful.
 
Back
Top