Bug 238628

Summary: "Drive Device Names"; Update Information for NVMe & Flash Storage
Product: Documentation Reporter: Wooty <wooty>
Component: Books & ArticlesAssignee: freebsd-doc (Nobody) <doc>
Status: Closed FIXED    
Severity: Affects Many People CC: imp
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   

Description Wooty 2019-06-16 20:13:12 UTC
LINK: https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/disk-organization.html
SECTION: Table 3.3. Disk Device Names
ISSUE: No information on PCIe storage naming conventions; NVMe.
DESCRIPTION: I am setting up FreeBSD as a Dual-Boot so I can test hardware on bare metal, the problem I am running into is GRUB configuration. As Linux and BSD (possibly GRUB as well) have different naming conventions, I am spending a lot of time using trial and error in order to get this functioning. I am using m.2 NVMe based storage, and am unsure what is needed to set the NVMe path correctly.

An Example GRUB configuration:

menuentry "FreeBSD 12" {
        insmod bsd
        insmod ufs2
        set root='(hd2,gpt7)'                                #Assuming 'hd2' is GRUB assigned
        kfreebsd /boot/kernel/kernel
        kfreebsd_loadenv /boot/device.hints
        kfreebsd_module /boot/splash.bmp type=splash_image_data
        set kFreeBSD.vfs.root.mountfrom=ufs:/dev/nvd0p7      #Assuming 'nvd0' is BSD assigned (Tried 'nvme0n1p7')
        set kFreeBSD.vfs.root.mountfrom.options=rw
        boot
}

An Example Device tree:
    nvd0        GPT             %Boot Drive
        nvd0p1  ms-recovery         *MS Windows
        nvd0p2  efi                 *MS Windows
        nvd0p3  ms-reserved         *MS Windows
        nvd0p4  ms-basic-data       *MS Windows Data
        nvd0p5  linux-data          *Linux
        nvd0p6  efi             #GRUB Location
        nvd0p7  freebsd-ufs     #FreeBSD 12 Root
    ada0        GPT 
        ada0p1  linux-data          *Linux Home
    ada1        GPT
        ada1p1  ms-basic-data       *MS Windows Data
    da0                         #FreeBSD 12 USB
        da0p1   efi             #FreeBSD 12 USB
        da0p2   freebsd-boot    #FreeBSD 12 USB
        
An Example of /dev:
    m.2 NVME PCIe Drive:    /dev/nvd0   /dev/nvd0p1 /dev/nvd0p2 /dev/nvd0p3, etc.
    USB 3.0 USB Install:    /dev/nvme0  /dev/nvme0ns1
    
OBSERVATIONS: Using the FreeBSD Install media, I was able to chroot into my installation and see how fstab was configured, and how FreeBSD named devices. However, looking under '/dev' directory, I noticed my USB drive was being labelled as 'nvme0'. If I had fewer partitions on my boot drive, this could have easily lead me to more headache. Another interesting thing is upon updating grub, it identified an "unknown linux" drive at '/dev/nvme0n1p7

CONCLUSION: I believe these naming conventions should be updated in the documentation, as a newish user I am still learning differences, and I believe dual-booting is an entry point for a lot of new users. NVMe drives are becoming more competitive in price, and are becoming more widely used, and having this information would have saved me a lot of time.

I still am not able to boot into my FreeBSD system, I am just getting a black screen and the system seems locked, and using all of the device identifiers above, am still stuck. However, this could be a result of one of my other GRUB options not being used properly, just still not 100% on the device name.
Comment 1 Warner Losh freebsd_committer freebsd_triage 2021-07-10 22:32:13 UTC
f6cee70fe25 fixes this. I forgot to tag the bug in the commit though.
New names will be on the web site within the hour.