Solved Cannot boot from NVMe device (Samsung SSD 970 EVO 250GB)

Hello FreeBSD community,

since I bought a new desktop almost 10 month ago, I had installed FreeBSD 11.2 with ZFS-on-root on a harddrive. This worked as expected. Now I wanted to install FreeBSD on my Samsung SSD 970 EVO, which is a NVMe device. Unfortunately the system cannot mount the root device. During the boot process it stops with the following error message:
Code:
Mounting from zfs:zroot/ROOT/default failed with error 6


The ZFS module seems to be loaded, because I see the following:
Code:
ZFS filesystem version: 5
ZFS storage pool version: feature support (5000)


Installing with UFS works fine on the SSD. I tried FreeBSD 11.2-RELEASE and 12.0-RELEASE.
Any advice would be great.
 
Error 6 is ENXIO and I've met it when experimented with multiple installations of FreeBSD on the same medium. The problem was that pools from previous installs was messing with the last one and attempted to mount.

Probably it's worth to remove hdd (if it's plugged) and secure erase NVMe device. Leave only installation and target media.
 
I use dual NVMe drives, 2x Samsung 970 EVO 500 GB in a mirrored ZFS bootpool. Using FreeBSD12.0-RELEASE-p3 currently and it boots just fine.
Initially I used it with 11.2 and then I upgraded to 12.0. Both worked.

As you are able to work with UFS, I assume your kernel detects the NVMe correctly. It's probably the boot loader that can't cope with it somehow?

Can you specify in more detail what kind of boot loader are you using and how your disk is partitioned with ZFS? Do you use encryption? Is your /boot inside the zroot pool or is it separate?
I use a GPT partitioning with legacy boot. I have a freebsd-boot partition which was created via:
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot ....

And then I have a separate bootpool, which in turn boots the kernel and mounts an encrypted ZFS root.
My kernel is virtually identical with GENERIC, what comes as a stock kernel in the installer.
 
I use the default installer method to install the system with automated ZFS partitioning and GPT (UEFI).

abishai pointed me to the right direction: zpool import showed two pools with the same name zroot, one on the HDD and one on the SSD. I wasn't able to destroy either of them (because of unavailability and corruption), but upon creation and destruction of a new pool with a different name on both devices, I got rid of these old pools. I installed again on the SSD and the system boots fine now.

Thank you very much.
 
This feels like a very old bug and I don't know why it's not better documented and why how to fix it is not documented. Really, the code should deal with this (more) gracefully.

I had a serious loss of data one time back more than 10 years ago on a Solaris box when another box died and I tried to recover data from those drives in an another Solaris ZFS box. BOOM! Apparently ZFS cannot tolerate duplicate rpool (Solaris name for root pool). The box went into a kernel trap death spiral and I was never able to get the data off those drives. It is hard to believe this is still happening. But great that you got around it on FreeBSD.
 
Back
Top