Booting a NVMe drive

12,689

Solution 1

Had the same ordeal. It was found that the fix required multiple steps to get working correctly. I'll briefly explain, while the exact and thorough steps can be found below via link to the official ubuntu forums.

Basically you have to locate your /boot on a seperate drive along with installing grub to the same drive. The "boot" drive is SATA and obviously seen and bootable through BIOS with a GPT Partition and scheme like so:

Model: ATA Samsung SSD 850 (scsi)
Disk /dev/sdc: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:


Number  Start   End     Size    File system  Name  Flags
 1      1049kB  1075MB  1074MB  ext4               legacy_boot
 2      1075MB  1085MB  10.5MB                     bios_grub
 3      1085MB  500GB   499GB   ext4

You MUST include the legacy_boot on the /boot partition (partition 1), and bios_grub on the unknown partition 2.

Your NVMe drive mus be GPT partitioned as well. During install you must choose to do "SOMETHING ELSE" when installing and tell the installer to mount your previously defined /boot partition and to install grub onto that same drive.

Source:

Solution 2

After a couple of weeks of screwing around (make sure you are booting off the right device!), I found the following worked for me:

  1. With GPartEd erase the SATA drive and create a GPT partition table on it.
  2. If there's already an EFI partition on any device, delete it.
  3. In the installer set up to boot from the SATA drive (creates the bios_grub & EFI partitions), then create a 500MB (maybe less?) partition for /boot, and another partition for the OS. This system directory is here mainly as a backup in case the NVME drive dies.
  4. Optionally set up another partition (could even be on the NVME device) for /home.
sdb                 
├─sdb1              bios_grub
├─sdb2              EFI System Partition
├─sdb3              boot
└─sdb4              system
  1. Run the installer again, with the same settings as the first time. Set a partition on the NVME device as /, and /dev/sdb3 set to /boot again. Make sure that the SATA drive is the boot device. I have 2 partitions on the NVME device... the first is mounted as /home, the second is mounted as / for the OS. This has a GPT partition table as well.
nvme0n1             
├─nvme0n1p1 home    home
└─nvme0n1p2         sys
Share:
12,689
MadHatter
Author by

MadHatter

Updated on September 18, 2022

Comments

  • MadHatter
    MadHatter over 1 year

    Note: this is kind of follow-up of this post: https://superuser.com/questions/1318478/booting-nvme-drive-with-a-bootloader, but I decided to post here since I'm trying to install and boot Ubuntu.

    Summary: I'm installing Ubuntu on a NVMe drive, on a mainboard that doesn't support NVMe boot. I'm doing this by:

    1. Having a SATA drive.
    2. Booting the installation pendrive in UEFI mode.
    3. Creating an EFI partition on the SATA drive.
    4. Installing the / filesystem on the NVMe drive.
    5. Installing the boot loader on the SATA drive.

    The system is correctly installed, but as it reboots, it goes in grub rescue, saying that the volume is unknown.

    Note that as I create the main partition on the NVMe drive, the installer leaves 1 Mb of "free space" at the beginning, so I suspect that the true EFI boot partition goes there.

    Suggestions? Thanks.

    • oldfred
      oldfred over 5 years
      If an UEFI system, I would expect it to support NVMe, otherwise you would not have the connectors for it on motherboard. What motherboard? Many systems have needed NVMe firmware updates & UEFI updates also. New 4K drives have that space normally whether 35 year old MBR or newer gpt partitioning. Post this above & preserve formatting. lsblk -f
    • MadHatter
      MadHatter over 5 years
      I have no M.2 connectors on the mb. I use the nvme drive on a PCIe 4x card. It's a Lenovo S30 workstation. Should I run lsblk -f at grub rescue prompt? I'll do it as soon as I get home. Thanks!
    • oldfred
      oldfred over 5 years
      Grub only has a few terminal commands related to booting. Many NVMe drives have needed firmware updates.
    • Matthew Gaskins
      Matthew Gaskins about 5 years
      ubuntuforums.org/… Had the same ordeal, I thoroughly explained my issue and after some great help from some great folks got it sorted. Happy reading. :)
  • Organic Marble
    Organic Marble over 2 years
    I had given up until I ran across this q&a. Many thanks.
  • Organic Marble
    Organic Marble over 2 years
    I had given up until I ran across this q&a. Many thanks.