I have these boot drives, I want to copy them to another. They both happen to be zroot and bootable.
I booted from mfsBSD and imported both new and old zroot, using the pool ID shown by zpool import -N.
root@mfsbsd:~ # zpool import -N pool: data01 id: 2668514456528412656 state: ONLINE action: The pool can be imported using its name or numeric identifier. config: data01 ONLINE mirror-0 ONLINE gpt/S59VNS0N809087J_S00 ONLINE gpt/S59VNJ0N631973D_S01 ONLINE mirror-1 ONLINE gpt/S5B3NDFN807383E_S02 ONLINE gpt/S5B3NDFN807386P_S03 ONLINE pool: zroot id: 18320603570228782289 state: ONLINE action: The pool can be imported using its name or numeric identifier. config: zroot ONLINE mirror-0 ONLINE da0p3 ONLINE da1p3 ONLINE pool: zroot id: 3940978777956737756 state: ONLINE action: The pool can be imported using its name or numeric identifier. config: zroot ONLINE mirror-0 ONLINE ada0p3 ONLINE ada1p3 ONLINE root@mfsbsd:~ #
I imported and mounted both:
# zpool import -R /oldpool 3940978777956737756 oldzroot # zpool import -fR /newpool 18320603570228782289 zroot
Next: send the data.
snapshot for send
With this command, I snapshot the old zroot for copying to the new zroot.
zfs snapshot -r oldzroot@for_copy
zfs send | zfs recv
This is the copy from old to new:
root@mfsbsd:~ # zfs send -R oldzroot@for_copy | zfs recv -F zroot cannot mount 'zroot': mountpoint or dataset is busy
The cannot mount message results from having zroot mounted. It is not an error.
After copying over the data, I run scrub on both pools. Notice the difference in time.
I think most of this difference is drive-related. The oldzoot is attached to the M/B. The new zroot is attached to the HBA.
The real test would be swapping the drive connections and see how they perform.
These are OS boot drives, not data drives. I think this will be fine.
root@mfsbsd:~ # zpool status zroot oldzroot pool: oldzroot state: ONLINE scan: scrub repaired 0 in 0 days 00:04:51 with 0 errors on Sun Oct 11 14:03:46 2020 config: NAME STATE READ WRITE CKSUM oldzroot ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 ada0p3 ONLINE 0 0 0 ada1p3 ONLINE 0 0 0 errors: No known data errors pool: zroot state: ONLINE scan: scrub repaired 0 in 0 days 00:02:27 with 0 errors on Sun Oct 11 14:01:09 2020 config: NAME STATE READ WRITE CKSUM zroot ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 da0p3 ONLINE 0 0 0 da1p3 ONLINE 0 0 0 errors: No known data errors
The real test
The real test however, is booting from the new drives.
After adding the Boot Image, I was able to see this when booting:
Pressing ctrl-c will take you to this window:
Pressing Enter on SAS9207-8i I was presented with this screen:
The key: Boot Support. I am booting via BIOS (as opposed to UEFI).
After leaving the configuration tool, the boot continued. I took this screen shot which shows the drives attached to the HBA:
In my case, to boot from those devices, I selected F11 and then from the BIOS Boot Manager screen, I selected the devices from which I wanted to boot.
However, from there, it failed.
When I tried to boot, I got this:
When copying around ZFS snapshots, not all attributes are copied. This include the zpool attribute bootfs. This is how I set that.
I booted the system via mfsBSD.
I imported the zroot, by ID, because this system has more than one zroot zpool on it.
# zpool import -R /newzroot 18320603570228782289
Then tell the zpool where to boot from:
# zpool set bootfs=zroot/ROOT/default zroot
Export the zpool:
# zpool export zroot
The system was rebooted again, press F11 to select the appropriate drives, boom, into FreeBSD.
This proves the drives can boot the system.