Using NVME SSD as a system drive on computers with old BIOS and Linux OS

Using NVME SSD as a system drive on computers with old BIOS and Linux OS

With the appropriate configuration, you can boot from an NVMe SSD even on older systems. It is assumed that the operating system (OS) is capable of working with NVMe SSDs. I am specifically referring to booting the OS, as the NVMe SSD is recognized by the OS after booting if the existing drivers are available. No additional software is required for Linux. For BSD and other Unix-based operating systems, this method will likely work as well.

To boot from any storage device, the initial boot program (IBP), in BIOS or EFI (UEFI), must contain drivers for that device. NVMe SSDs are relatively new compared to BIOS, and older motherboard firmware does not include such drivers in the IBP. You can add the appropriate code in EFI that lacks NVMe SSD support, which will enable full functionality with the device, allowing you to install and boot an operating system. For older systems with so-called 'legacy BIOS', it is unlikely that you can boot the OS in this manner, but it can be bypassed.

How to do it

I used openSUSE Leap 15.1. The steps will be roughly the same for other Linux distributions.

1. Prepare the computer for the operating system installation.
You need a PC or server with an available PCI-E 4x or longer slot; the version does not matter, PCI-E 1.0 is sufficient. Naturally, the newer the PCI-E version, the higher the speed. And of course, an NVMe SSD with an M.2 to PCI-E 4x adapter.
You will also need some storage device with a capacity of 300 MB or more that is recognized in BIOS and can be used to boot the OS. This could be an HDD connected via IDE, SATA, SCSI, or SAS. Alternatively, a USB flash drive or memory card. A floppy disk won't fit. A CD-ROM won't do, as it requires overwriting. DVD-RAM — no idea. Let's refer to this device as a 'legacy BIOS storage device'.

2. Boot the Linux installation environment (from optical disk, bootable flash drive, etc.).

3. When partitioning the disk, we'll distribute the OS across the available storage devices:
3.1. Let's create a partition for the GRUB bootloader at the beginning of the "legacy BIOS drive" with a size of 8 MB. Note that here we leverage a feature of openSUSE — GRUB on a separate partition. By default, openSUSE uses the BTRFS filesystem. If GRUB is placed on a partition with a BTRFS filesystem, the system will not boot. Therefore, a separate partition is used. You can place GRUB elsewhere, as long as it boots.
3.2. After the GRUB partition, we will create a partition for part of the system folder (the "root"), specifically for "\/boot\", with a size of 300 MB.
3.3. The remaining space — the rest of the system folder, swap partition, and user partition "\/home\/" (if you decide to create one) can be placed on NVME SSD.

After installation, the system loads GRUB, which loads files from \/boot\, after which the NVME SSD becomes available, and then the system boots from the NVME SSD.
In practice, I experienced significant speed improvements.

Capacity requirements for the "legacy BIOS drive": 8 MB for the GRUB partition — this is default, and somewhere from 200 MB for \/boot\. I chose 300 MB as a buffer. When updating the kernel (and installing new ones), Linux will fill the \/boot\ partition with new files.

Speed and cost estimation

The cost of a 128 GB NVME SSD is approximately from 2000 rubles.
The cost of an M.2 — PCI-E 4x adapter is approximately from 500 rubles.
There are also M.2 — PCI-E 16x adapters available for four NVME SSDs, priced at about 3000 rubles — if needed.

Maximum speeds:
PCI-E 3.0 4x around 3900 MB/s
PCI-E 2.0 4x 2000 MB/s
PCI-E 1.0 4x 1000 MB/s
Drives with PCI-E 3.0 4x practically reach speeds of around 3500 MB/s.
One can assume that the achievable speed will be as follows:
PCI-E 3.0 4x around 3500 MB/s
PCI-E 2.0 4x around 1800 MB/s
PCI-E 1.0 4x around 900 MB/s

This is faster than SATA 600 MB/s. The achievable speed for SATA 600 MB/s is around 550 MB/s.
Moreover, on older motherboards, the speed of the onboard SATA controller may not be 600 MB/s, but rather 300 MB/s or 150 MB/s. Here, onboard controller = SATA controller built into the chipset southbridge.

I would like to note that NCQ will work for NVME SSD, while older onboard controllers may not have this feature.

I made calculations for PCI-E 4x; however, some drives have a PCI-E 2x bus. This is sufficient for PCI-E 3.0, but for older PCI-E standards — 2.0 and 1.0 — it’s better not to take such NVME SSDs. Additionally, a drive with a memory chip buffer will be faster than one without it.

For those looking to completely avoid the onboard SATA controller, I recommend the Asmedia ASM 106x (1061 and others), which provides two SATA 600 ports (internal or external). It works quite well (after a firmware update) and supports NCQ in AHCI mode. It connects via PCI-E 2.0 1x.

Its maximum speed is:
PCI-E 2.0 1x 500 MB/s
PCI-E 1.0 1x 250 MB/s
The achievable speed will be:
PCI-E 2.0 1x 460 MB/s
PCI-E 1.0 1x 280 MB/s

This is sufficient for one SATA SSD or two HDDs.

Noted drawbacks

1. SMART parameters are not read from NVME SSD, only general data about the manufacturer, serial number, etc. This may be due to the very old motherboard (mb). For my inhuman experiments, I used the oldest mb I could find, with an nForce4 chipset. 2. TRIM should work, but it needs to be checked.

There are also other options: to buy a SAS controller with a PCI-E 4x or 8x interface (are there 16x or 32x?). However, the cheap ones support SAS 600 but SATA 300, while the expensive ones will be costlier and slower than the above method.

Conclusion

For use with M$ Windows, you can install additional software—a bootloader with built-in drivers for NVME SSD.

See here:

www.win-raid.com/t871f50-Guide-How-to-get-full-NVMe-support-for-all-Systems-with-an-AMI-UEFI-BIOS.html
www.win-raid.com/t3286f50-Guide-NVMe-boot-for-systems-with-legacy-BIOS-and-older-UEFI-DUET-REFIND.html
forum.overclockers.ua/viewtopic.php?t=185732
pcportal.org/forum/51-9843-1
mrlithium.blogspot.com/2015/12/how-to-boot-nvme-ssd-from-legacy-bios.html
I suggest that the reader assess for themselves whether this use of NVME SSD is necessary, or if it would be better to purchase a new motherboard (+ processor + memory) with an M.2 PCI-E slot and support for booting from NVME SSD in EFI.

🥇Using NVME SSD as a system drive on computers with an old BIOS and Linux OS | ProHoster

Source: habr.com

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster