I want to completely replace my existing zroot which was configured by the FreeBSD installer as a ZFS mirror on ada0p3 and ada1p3.
The new zroot is to be installed as a mirror on ada2p3 and ada3p3.
Adding ada2p3 and ada3p3 as additional mirrors to the zroot pool, and removing ada0p3 and ada1p3, is not an option as the new root partition is significantly smaller than the old one.
I have manually initialised both the new disks identically with gpart(8), establishing the protective MBR (with /boot/pmbr), freebsd-boot (with /boot/gptboot), freebsd-swap (gmirror), and freebsd-zfs partitions in exactly the same way as the FreeBSD installer would. This is identical to the existing root disks, except that p3 is smaller:
My plan is to zfs-send a snapshot of the zroot to the new root pool:
The zroot bootfs is currently set as:
The old zroot disks will remain in-situ, and I plan to relocate the swap (and fix the new fstab) after the new zroot2 is up and running.
Is this sufficient to boot using zroot2:
But, what is the appropriate mechanism to disable the old zroot hierarchy so it, and its mount points, are no longer visible, and do I need to boot single user to do it? zpool export? zpool offline? swapoff and pull the cables? ...
Thanks.
The new zroot is to be installed as a mirror on ada2p3 and ada3p3.
Adding ada2p3 and ada3p3 as additional mirrors to the zroot pool, and removing ada0p3 and ada1p3, is not an option as the new root partition is significantly smaller than the old one.
I have manually initialised both the new disks identically with gpart(8), establishing the protective MBR (with /boot/pmbr), freebsd-boot (with /boot/gptboot), freebsd-swap (gmirror), and freebsd-zfs partitions in exactly the same way as the FreeBSD installer would. This is identical to the existing root disks, except that p3 is smaller:
Code:
# gpart show /dev/ada2
=> 40 488397088 ada2 GPT (233G)
40 1024 1 freebsd-boot (512K)
1064 984 - free - (492K)
2048 33554432 2 freebsd-swap (16G)
33556480 180355072 3 freebsd-zfs (86G)
213911552 25165824 4 NOT RELEVANT
239077376 134217728 5 NOT RELEVANT
373295104 115101696 6 NOT RELEVANT
488396800 328 - free - (164K)
Code:
zpool create zroot2 mirror /dev/ada2p3 /dev/ada3p3
zfs set compression=lz4 zroot2
zfs snapshot -r zroot@replica1
zfs umount zroot2
zfs send -R zroot@replica1 | zfs receive -Fdu zroot2
Code:
# zpool get all | grep boot
tank bootfs - default
zroot bootfs zroot/ROOT/13 local
# zfs get canmount zroot/ROOT/13
NAME PROPERTY VALUE SOURCE
zroot/ROOT/13 canmount noauto local
The old zroot disks will remain in-situ, and I plan to relocate the swap (and fix the new fstab) after the new zroot2 is up and running.
Is this sufficient to boot using zroot2:
Code:
zpool set bootfs=zroot2/ROOT/13 zroot2
shutdown -r now
# reset BIOS boot device to ada2, and boot
Thanks.