I encountered a boot failure after switching the boot drive from a sata ada0 to a nvme drive nda0 with attaching/detaching, by executing the following commands:
Also, I installed a new ESP on nda0
Finally, I invoked efibootmgr(8) to setup this loader.
The partition tables are as below (ada0p5 is the old bootable, nda0p4 is the new bootable, and ada0p4 is empty):
The output of
The reboot was failed similar to ZFS: can't read MOS of pool rpool.
I notice that using a USB FreeBSD Installer stick could import the zpool from shell, and
Within the installer shell, rebooting without kernel reload works with zpool root correctly by using:
Other configuration I tried:
Related threads:
ZFS: can't read MOS of pool rpool
Mirrored zroot doesn't boot from second disk
How to read error messages at initial stage of the boot process
zpool attach root ada0p5 nda0p4
# after resilvering done
zpool detach root ada0p5
Also, I installed a new ESP on nda0
mount_msdos /dev/nda0p1 /mnt/efi
mkdir -p /mnt/efi/efi/freebsd
cp /boot/loader.efi /mnt/efi/efi/freebsd
Finally, I invoked efibootmgr(8) to setup this loader.
The partition tables are as below (ada0p5 is the old bootable, nda0p4 is the new bootable, and ada0p4 is empty):
Code:
=> 34 1953525101 ada0 GPT (932G)
34 6 - free - (3.0K)
40 532480 ada0p1 efi (260M)
532520 1024 ada0p2 freebsd-boot (512K)
533544 984 - free - (492K)
534528 4194304 ada0p3 freebsd-swap (2.0G)
4728832 209715200 ada0p4 freebsd-zfs (100G)
214444032 1738539008 ada0p5 freebsd-zfs (829G)
1952983040 542095 - free - (265M)
=> 40 1953525088 nda0 GPT (932G)
40 532480 nda0p1 efi (260M)
532520 1024 nda0p2 freebsd-boot (512K)
533544 984 - free - (492K)
534528 50331648 nda0p3 freebsd-swap (24G)
50866176 1902657536 nda0p4 freebsd-zfs (907G)
1953523712 1416 - free - (708K)
zfs list
is as follows:
Code:
NAME USED AVAIL REFER MOUNTPOINT
root 164G 635G 15.9G none
root/linuxdisk0 130G 757G 7.36G -
root/linuxdisk1 1.02G 635G 858M -
root/root 17.0G 635G 96K none
root/root/DEFAULT 17.0G 635G 17.0G /
I notice that using a USB FreeBSD Installer stick could import the zpool from shell, and
zpool status -x
is normal.Within the installer shell, rebooting without kernel reload works with zpool root correctly by using:
Code:
kldload zfs
kenv vfs.root.mountfrom=zfs:root/root/DEFAULT
reboot -r
- SUCCESS.
zfs offline ada0p5
without detaching and reboot. - SUCCESS. Unplug the sata cable from ada0 hard drive and reboot.
- SUCCESS.
gpart destroy -F ada0
to destroy the partition table of ada0 and reboot. - SUCCESS.
zpool labelclear ada0p5
and reboot. - FAILED. Changing the partition type of ada0p1 from EFI to freebsd (let the loader ignore this ESP).
- FAILED. Erase all the content in the ada0p1 ESP.
zpool labelclear
after zpool detach
.Related threads:
ZFS: can't read MOS of pool rpool
Mirrored zroot doesn't boot from second disk
How to read error messages at initial stage of the boot process