How does this work - NVMe booting from MBR?

This home server running FreeBSD 15.1 has system on 2 SATA SSD disks using gmirror, MBR and UFS. Mainboard has X370 chipset and CSM enabled. At a whim I added third disk to gmirror - it is NVMe. I expected system not to boot from it, but at least it would be a bit faster (changed gmirror disk read priorities).

Recently I was upgrading CPU and memory and removed all other disks except NVMe. I expected system to be not bootable, but I still ended up in FreeBSD boot menu.
How come? How does this work?
 
My question was more that I understood NVMe needs UEFI and GPT to boot? But I am using CSM and MBR...
As far as I exprerienced, nvme, SATA and USB drives are similar storage devices. How does nvme need GPT? I think the kernel already found out if the device is compatible before loading the partition layout.
 
My question was more that I understood NVMe needs UEFI and GPT to boot? But I am using CSM and MBR...
I don't think that should be a problem. Make a boot partition to hold the bootcode. I would make it decent sized so you can convert it to EFI later if wanted.

A RAID1 mirror with a broken or faulty device is still accessible?
Absolutely. It is so transparent that you really need a cron job to check gmirror status.
 
I have a problem with a 3 disk gmirror with different disk types.
Just a personal thing. It would be one thing if temporary to move a gmirror installation to another machine but for full time use i dunno bout that.
First off I believe all gmirror disks should be of same size.
Preferably same make and model so sectors are the same internally.
You can use any combination of disks for gmirror that doesn't mean it's the most efficient.
Heck just running with UFS sectors un-alligned can cost 50% disk speed.

Also MBR/CSM gmirror brings this problem. Boot Order.
EFI booting uses gmirror GUID to boot from.
CSM requires actual disk....
So manual intervention at reboot needed when a disk fails..
 

Yes, I had mine changed to "Legacy only" cause I assumed it is needed for LSI 9200-8i controllers.
But no disks are connected to them right now, only NVMe on mainboard. Just doing memtest after CPU and memory upgrade.

I have this question because when I search the net I mostly find answers, that one must have GPT and UEFI to boot from NVMe.

I don't think that should be a problem. Make a boot partition to hold the bootcode. I would make it decent sized so you can convert it to EFI later if wanted.


Absolutely. It is so transparent that you really need a cron job to check gmirror status.

AFAIK my system disks have partitions 1a and 1b only for / and swap respectively. Not gonna change it right now cause it works, just was wondering how.
 
The BIOS/UEFI presents it as a disk, much like a USB keyboard and mouse can be emulated as a PS/2 keyboard/mouse and work on operating systems that don't have USB support.
 
I have a problem with a 3 disk gmirror with different disk types.
Just a personal thing. It would be one thing if temporary to move a gmirror installation to another machine but for full time use i dunno bout that.
First off I believe all gmirror disks should be of same size.
Preferably same make and model so sectors are the same internally.
You can use any combination of disks for gmirror that doesn't mean it's the most efficient.
Heck just running with UFS sectors un-alligned can cost 50% disk speed.
I have used different sized disks with gmirror for years, never had a problem. Extra space just remains unused.
I usually prefer using disks of different model in gmirror, assuming they don't fail at the same time.
You might be correct about speed, I have seen gmirror usually slower than single disk.
Then again adding NVMe to gmirror and configuring all reads coming from there made disk like 5x faster than SATA.
 
Yes, I had mine changed to "Legacy only" cause I assumed it is needed for LSI 9200-8i controllers.
I do not think this is the case. It really depends on the firmware flashed to card. Some arre UEFI only.
The card in BIOS Legacy Mode would use OptionROM to boot from the card.
I would test this with an old disk.
UEFI is the best option for automatic rollover and automated rebooting.

 
This bit I wrote is not quite complete:
UEFI looks only for /EFI/BOOT/ directory not a particular drive.

While that is true the real magic comes from ebibootmgr(8).
During installation bsdinstall uses efibootmgr to set in the BIOS the boot option for the GUID of the gmirror you install onto.
You could just as easily write the gmirror GUID to BIOS manually with efibootmgr.
 
Well, last time I tried to legacy BIOS boot with a nvme on VirtualBox, it didn't work.

Internet told me that it's a problem of driver that is not available on old BIOS machine. I didn't dig more.
The subject is interesting.
 
My question was more that I understood NVMe needs UEFI and GPT to boot? But I am using CSM and MBR...
the nvme firmware on many platforms is/was only provided as a UEFI module, so booting from nvme isn't possible in legacy mode.
Otherwise everything that is available as a disk to the BIOS (in CSM/legacy mode) can be used to boot - except if there are artificial limitations (e.g. to sell you a 'premium' version of the same board that can boot from e.g. FC or 3rd party/add-on SAS/RAID crontrollers)
 
To determine if a NVMe will boot in Legacy/CSM mode you need to check if the drive has an OptionROM onboard.
Required for Legacy/CSM booting.


 
Back
Top