[SOLVED] Fails to install GRUB on NVMe PCI Express SSD

Help with issues regarding installation of Debian

[SOLVED] Fails to install GRUB on NVMe PCI Express SSD

Postby Lakef » 2017-02-16 09:14

I can not install the GRUB boot loader on NVMe PCI Express SSD 3.0 x4 (Corsair Force MP500 M.2 240GB CSSD-F240GBMP500). The motherboard is Gigabyte GA-X170-EXTREME ECC, and CPU Intel Xeon E3-1245 v5.

I try to install Debian 8.7.1 64 bit (debian-8.7.1-amd64-netinst.iso), but the installation program refuses to install GRUB. This means that I can not start/boot Debian when I reboot after the (failed) installation.

During install i get the following messages for example:

Continue without boot loader
No boot loader has been installed, either because you chose not to or because your specific architecture doesn't support a boot loader yet. You will need to boot manually with the /vmlinuz kernel on partition /dev/nvme0n1p2 and root=/dev/nvme0n1p2 passed as a kernel argument.

Image

Install the GRUB boot loader on a hard disk
An installation step failed. You can try to run the failing item again from the menu, or skip it and choose something else. The failing step is: Install the GRUB boot loader on a hard disk

Image
Last edited by Lakef on 2017-02-23 13:25, edited 8 times in total.
Lakef
 
Posts: 30
Joined: 2017-02-16 08:58

Re: Fails to install GRUB on NVMe PCI Express SSD

Postby Lakef » 2017-02-16 19:12

I have searched the internet about the error, but I can not figure out if it is a showstopper or if there is a solution to remedy this without losing performance and stability. On the internet, I have seen error reports (for Debian and Ubuntu) of GRUB boot loader failing to install on NVMe SSD's connected to PCIe port (via for example M.2 interface on motherboard).

I am a total newbie to Debian and Linux, but want Debian in order to make a computer that at the same time is a NAS (network attached storage), email server, file server and web server. But now it seems like there is not support for the hardware I have chosen. I went for an NWMe SSD connected to PCIe via M.2 interface in order to achieve 3000 MB/s read, instead of a regular SSD which only read in e.g. 530 MB/s (which is close to the SATA 3 maximum rate of ~600 MB/s).

Is there anybody that knows if this is a showstopper? Is there any proper remedy for this? What should I do next?

As I have seen this problem been mentioned on the internet before, I would guess it is reported, but I do not know how to find out if there is a group currently working on this error. Maybe they even have a "tested" or "unstable" solution to the problem?
Lakef
 
Posts: 30
Joined: 2017-02-16 08:58

Re: Fails to install GRUB on NVMe PCI Express SSD

Postby debiman » 2017-02-17 07:00

i tried to understand what nvme is and whether an nvme pci ssd is a non-standard technique. i don't know. maybe up to you to do the research?

but it seems that the install went ok, and all you have to do is to install grub.

so, try that.
make yourself a bootable (usb?) linux medium (don't even have to be debian, but it must have grub2, which 99% have), boot into it, and install grub to the first hard drive of that computer.

steps:
Code: Select all
sudo fdisk -l
sudo grub-install /dev/<whatyoufoundfromfdisk>

be aware that you have to install it to e.g. /dev/sda and NOT /dev/sda1.
User avatar
debiman
 
Posts: 584
Joined: 2013-03-12 07:18

Re: Fails to install GRUB on NVMe PCI Express SSD

Postby Lakef » 2017-02-17 08:36

Debiman, thank you for giving me some ideas of how to solve the problem of installing GRUB! I made the installation via USB-stick loaded with Debian (Jessie) 8.7.1 (debian-8.7.1-amd64-netinst.iso). Would that contain GRUB2 rather than an older version of GRUB? I booted from the USB-stick, then I selected the graphical install option. Where would it be possible to run the instructions you suggested, i.e. "sudo grub-install /dev/nvme0n1"?

About NVMe

NVMe (NVM Express, Non-Volatile Memory Express is a logical device interface. It allows flash memorys to communicate at higher speeds than SATA 3. SATA 3 interface allows up to 600 MB/s, but NVMe uses the PCIe lanes. A device that uses four PCIe version 3.0 lanes can theoretically achieve 4000 MB/s.The NVMe devices connect to the motherboard via M.2, U.2 or PCIe connector.

I guess basically NVMe is the industry standard for PCIe SSDs. I guess one could use PCI Express connected SSD and NVMe SSD interchangeably. For me the terminology is still sligtly confusing.

Linux give the NVMe devices a different name than regular devices. Regular devices get names such as "/dev/sda", but NVMe devices get names as for example "/dev/nvme0n1".

There can be errors in my text above.

Links to information about NVMe:
http://www.nvmexpress.org/
http://www.pcworld.com/article/2899351/ ... -nvme.html
Lakef
 
Posts: 30
Joined: 2017-02-16 08:58

Re: Fails to install GRUB on NVMe PCI Express SSD

Postby Lakef » 2017-02-17 13:10

I have searched the internet and read some of the information about the problem that the Debian (and other Linux systems, such as Ubuntu) fails to install GRUB on NVMe SSD. The pages I currently think are the most relevant are the following:

http://www.poweredbyjeff.com/2015/10/29 ... an-Jessie/

https://lists.debian.org/debian-user/20 ... 00062.html

https://wiki.debian.org/InstallingDebia ... SSD/jessie

http://unix.stackexchange.com/questions ... ing-debian

A couple of programs/tools were suggested at viewtopic.php?f=17&t=125595
Would they be of some interest to use at some point? :

http://www.supergrubdisk.org/super-grub2-disk/

https://sourceforge.net/p/boot-repair-cd/home/Home/
Lakef
 
Posts: 30
Joined: 2017-02-16 08:58

Re: Fails to install GRUB on NVMe PCI Express SSD

Postby Segfault » 2017-02-17 13:16

Grub is not the only bootloader in the world. Use something else. UEFI can load the OS without bootloader, too.
Segfault
 
Posts: 304
Joined: 2005-09-24 12:24

Re: Fails to install GRUB on NVMe PCI Express SSD

Postby Lakef » 2017-02-17 14:46

Segfault wrote:Grub is not the only bootloader in the world. Use something else. UEFI can load the OS without bootloader, too.


My motherboard has UEFI BIOS. Shall I enter the motherboard UEFI BIOS and change some setting?
Lakef
 
Posts: 30
Joined: 2017-02-16 08:58

Re: Fails to install GRUB on NVMe PCI Express SSD

Postby Lakef » 2017-02-17 15:10

debiman wrote:make yourself a bootable (usb?) linux medium (don't even have to be debian, but it must have grub2, which 99% have), boot into it, and install grub to the first hard drive of that computer.

steps:
Code: Select all
sudo fdisk -l
sudo grub-install /dev/<whatyoufoundfromfdisk>


I guess I you mean that I shall make a bootable USB with Debian operative system. I already have a bootable USB with "a small installation image" of Debian Jesssie (debian-8.7.1-amd64-netinst.iso). What I do not understand is where, how and when to write the terminal commands you suggest. Because there is no GRUB, I can not start Debian in order to write any terminal commands.

In my case I guess the terminal commands you suggested would be:
Code: Select all
sudo fdisk -l   #in order to get the list of devices
sudo grub-install /dev/nvme0n1 #which was the name the device get when use the Debian Graphical install option (of UNetbootin) when booting on the USB-stick I prepared.

As you say GRUB shall not be installed on a partition. In my case this means that GRUB shall NOT be installed on for example "/dev/nvme0n1p1", rather it should be installed on "/dev/nvme0n1".
Lakef
 
Posts: 30
Joined: 2017-02-16 08:58

Re: Fails to install GRUB on NVMe PCI Express SSD

Postby Segfault » 2017-02-17 15:48

Lakef wrote:
Segfault wrote:Grub is not the only bootloader in the world. Use something else. UEFI can load the OS without bootloader, too.


My motherboard has UEFI BIOS. Shall I enter the motherboard UEFI BIOS and change some setting?

You need properly placed and configured EFI stub kernel and it will show up in UEFI boot menu and it will boot without any additional loaders involved. To get a choice, like booting backup kernels you need a boot manager like eEFInd.
Segfault
 
Posts: 304
Joined: 2005-09-24 12:24

Re: Fails to install GRUB on NVMe PCI Express SSD

Postby Lakef » 2017-02-18 18:26

I have looked at the following pages now:

p1: 'Lukasz Szybalski' https://lists.debian.org/debian-user/20 ... 00062.html
p2: 'Jeff Ferrari' http://www.poweredbyjeff.com/2015/10/29 ... an-Jessie/
p3: 'LucaAlloatti' https://wiki.debian.org/InstallingDebia ... SSD/jessie

They propose solutions that are alike, but with small differences. It seems like one can reach a terminal via booting the debian operative system install USB-stick. There shall be an option for that according to internet page p3 (boot live USB ->Advanced ->Rescue mode..). Corresponds 'advanced' to 'graphical expert install' in the UNetbootin menu (the menu for the install USB)?
Image'

The three internet pages (p1, p2 and p3 linked to above) more or less suggests to write the following commands in the terminal/shell:

cd /target ( should it rather be "cd /dev/nvme0n1" in my case?)
mount --rbind /proc proc/
mount --rbind /sys sys/
mount --rbind /dev dev/
mount --rbind /run run/
chroot . /bin/bash

What are the "mount --rbind" commands above for? Do they simulate/pretend that the archives in the USB-stick directory "/proc" exist in the device directory "/dev/nvme0n1/proc" ? Why are they not copied then? Are they not needed later (when the system in installed)?

Shall I replace target with the path to the device I want to install Debian? In my case the path to the device (SSD M.2 NVMe PCIe) is "/dev/nvme0n1". Should I replace "/target" above with "/dev/nvme0n1" then?

Do you think that these commands are correct for my use?

Image

then they suggest GRUB is installed, but disagree wether it should be performed with 'backport' (which I think are 'test' or 'unstable' version of Debian) or not. Jeff Ferrari (p2) says NVMe support is much better for kernels with version number above 3.19. I have no clue what version of kernel that Debian 8.7.1 has, and I can not find it by searching the internet. Anybody knows what kernel has Debian 8.7.1 has or how to check it up?

For stable version :

apt-get update
apt-get install grub-efi-amd64
update-grub
grub-install (Should it rather be "grub-install --target=x86_64-efi /dev/nvme0n1" ?)

For backport version :

apt-get -t jessie-backports install linux-image-amd64
apt-get -t jessie-backports install grub-efi (Should this not rather be "grub-efi-amd64" ?)
update-grub
grub-install (Should it rather be "grub-install --target=x86_64-efi /dev/nvme0n1" ?)

How do you think the commands should be in my case for best solution?
Last edited by Lakef on 2017-02-19 13:21, edited 1 time in total.
Lakef
 
Posts: 30
Joined: 2017-02-16 08:58

Re: Fails to install GRUB on NVMe PCI Express SSD

Postby Head_on_a_Stick » 2017-02-18 23:01

Lakef wrote:
Segfault wrote:Grub is not the only bootloader in the world. Use something else. UEFI can load the OS without bootloader, too.


My motherboard has UEFI BIOS. Shall I enter the motherboard UEFI BIOS and change some setting?

https://wiki.debian.org/EFIStub
“Such is modern computing: everything simple is made too complicated because it’s easy to fiddle with; everything complicated stays complicated because it’s hard to fix." — Rob Pike

How to report a problem
User avatar
Head_on_a_Stick
 
Posts: 6288
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Fails to install GRUB on NVMe PCI Express SSD

Postby Lakef » 2017-02-19 13:45

GRUB-EFI-AMD64

After research on the internet, I have some information about the difference between "grub-efi-amd64" and "grub-efi" packages. The "grub-efi" package that either links to grub-efi-ia32 or grub-efi-amd64, depending on the architecture.

I have found a stable version, a test version and an unstable version of "grub-efi-amd64":

Stable: grub-efi-amd64 (2.02~beta2-22+deb8u1) https://packages.debian.org/jessie/grub-efi-amd64
Test: grub-efi-amd64 (2.02~beta3-4) https://packages.debian.org/stretch/grub-efi-amd64
Unstable: grub-efi-amd64 (2.02~beta3-5 and others) https://packages.debian.org/sid/grub-efi-amd64

Which version should I go for do you think?

KERNEL VERSION

I try to figure out the kernel version. It it the 'kernel-common' package to look for?

Stable: kernel-common (13.014+nmu1) https://packages.debian.org/jessie/kernel-common
Test: kernel-common (13.018) https://packages.debian.org/stretch/kernel-common
Unstable: kernel-common (13.018) https://packages.debian.org/sid/kernel-common

If I use the test/stretch version of "grub-efi-amd64" (
apt-get -t jessie-backports install grub-efi-amd64) do I also have to use the test/stretch version of the kernel, in order to maintain compatibility?

Would this install the test/stretch version of the kernel?
apt-get -t jessie-backports install kernel-common
or are more packages necessary?

Does this install the whole test/stretch version of the Debian operative system?
apt-get -t jessie-backports install linux-image-amd64
Last edited by Lakef on 2017-02-19 22:08, edited 8 times in total.
Lakef
 
Posts: 30
Joined: 2017-02-16 08:58

Re: Fails to install GRUB on NVMe PCI Express SSD

Postby Lakef » 2017-02-19 13:51

Head_on_a_Stick wrote:
Lakef wrote:
Segfault wrote:Grub is not the only bootloader in the world. Use something else. UEFI can load the OS without bootloader, too.


My motherboard has UEFI BIOS. Shall I enter the motherboard UEFI BIOS and change some setting?

https://wiki.debian.org/EFIStub


Thank you for informing me about this possibility! It is great to know this second possibility if I do not manage to make GRUB function.
Lakef
 
Posts: 30
Joined: 2017-02-16 08:58

Re: Fails to install GRUB on NVMe PCI Express SSD

Postby Lakef » 2017-02-19 15:26

Oh, I think I have found the kernel version now. In the link below I found "Linux kernel image: 3.16 series". Still I have not found the version of the kernel of the stretch/test version or Debian Jessie.

Chapter 2. What's new in Debian 8:
https://www.debian.org/releases/stable/ ... #newdistro
Lakef
 
Posts: 30
Joined: 2017-02-16 08:58

Re: Fails to install GRUB on NVMe PCI Express SSD

Postby Lakef » 2017-02-19 23:13

PROBLEM SOLVED

I booted the computer with the Debian install USB-memory-stick. In the Debuab GNU/Linux UEFI installer menu, I selected advanced options > graphical expert install. When I had the message that GRUB could not be installed, I ran a shell (from within the graphical expert install). This is what I wrote in the shell:

cd /target
mount --rbind /proc proc/
mount --rbind /sys sys/
mount --rbind /dev dev/
mount --rbind /run run/
chroot . /bin/bash

I got a root@XXX:/# prompt where I wrote:

apt-get update
apt-get install grub-efi-amd64
update-grub
grub-install

I quit the shell and finished the installation with the graphical expert install. Please note that, because I had already installed GRUB via the command line, I declined to install GRUB when asked by the graphical interface. I withdrew the USB-memory-stick and rebooted. Then I could log into Debian!!!

Note:
grub-efi-amd64 above should be replaced by grub-efi-amd32 for a 32-bit architeture. If one writes grub-efi-amd, then the correct architecture is chosen automatically.

Hoorah!!! It seems like the problem is solved!
Lakef
 
Posts: 30
Joined: 2017-02-16 08:58

Next

Return to Installation

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable