This weekend I decided to set up a single-drive FreeBSD+ZFS system, and prove that you CAN remove (and replace) the only drive in a root ZFS pool without service interruption.
Recap of the video
- Prequisite: A standard FreeBSD 12.0 install with root on ZFS, where the root pool is smaller than the amount of system memory. (in my case: 8GB system memory, 4GB root pool)
- Replace existing drive with a memory-backed block device
- Physically remove the existing drive
- Verify the system still works
- Physically attach new drive to system
- Replace memory-backed block device with new drive
- Bonus: Reboot system, verify it boots from new drive.
Scripts used in the demonstration are provided as a GitHub Gist.
oh!! replacing the zfs drive with an md.. so obvious in retrospect, but never occurred to me :D
FreeBSD also has reroot (reboot -r), but it’s harder to do. I actually used the reroot functionality in Linux to “depenguinate” remote servers/VPSes without secondary drives https://community.scaleway.com/t/freebsd-on-arm64/6678/8
LikeLike