Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

GRUB and LILO both fail to install to NVMe hard disk

Ask for help with issues regarding the Installations of the Debian O/S.
Message
Author
michael_a
Posts: 28
Joined: 2016-05-03 13:59

Re: GRUB and LILO both fail to install to NVMe hard disk

#21 Post by michael_a »

Arch looks like my best bet then. Unfortunately, I can't get the USB drive to boot when UEFI-only boot is enabled. I made it from the Arch dual-architecture ISO using dd, but it simply doesn't boot. Unless you have any ideas, I'll try a few different ways of remaking the live USB to see if I can get it to boot; then I can finally run the efibootmgr and actually get the Debian system working.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: GRUB and LILO both fail to install to NVMe hard disk

#22 Post by Head_on_a_Stick »

michael_a wrote:using dd
That's rather vague, care to share to exact command that you used?

Don't bother with unetbootin, it's a POS and won't work with Arch images.

Are you sure the USB stick isn't faulty?

Can any operating system boot in UEFI mode from a USB stick on your machine?
deadbang

michael_a
Posts: 28
Joined: 2016-05-03 13:59

Re: GRUB and LILO both fail to install to NVMe hard disk

#23 Post by michael_a »

Sorry, you're right that that was vague. The dd command was

Code: Select all

dd if=archlinux-2016.05.01-dual.iso of=/dev/sdb1
I've used several different USB drives and get the same result every time, and when I initially bought this machine, I hooked up various USB drives to every USB port and was able to read/write data without trouble (I realize that probably doesn't qualify as a rigorous test). I can boot the Debian image in UEFI mode without trouble (well, trouble installing Grub to the drive, hence this whole thread).

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: GRUB and LILO both fail to install to NVMe hard disk

#24 Post by Head_on_a_Stick »

michael_a wrote:The dd command was

Code: Select all

dd if=archlinux-2016.05.01-dual.iso of=/dev/sdb1
That is the wrong command -- *do not* specify a partition number, target the entire device and flush the buffers afterwards:

Code: Select all

# dd bs=4M if=archlinux-2016.05.01-dual.iso of=/dev/sdb status=progress && sync
https://wiki.archlinux.org/index.php/US ... NU.2FLinux
deadbang

User avatar
kiyop
Posts: 3983
Joined: 2011-05-05 15:16
Location: Where persons without desire to improve themselves fear to tread, in Japan
Been thanked: 3 times

Re: GRUB and LILO both fail to install to NVMe hard disk

#25 Post by kiyop »

michael_a wrote:

Code: Select all

dd if=archlinux-2016.05.01-dual.iso of=/dev/sdb1
Somebody made a similar mistake.
Why did you add "1" (partition number)? Is there any web page suggesting so? If there is, please let me know the URL.
Openbox, JWM: Jessie, Sid, Arch / Win XP (on VirtualBox), 10
http://kiyoandkei.bbs.fc2.com/

michael_a
Posts: 28
Joined: 2016-05-03 13:59

Re: GRUB and LILO both fail to install to NVMe hard disk

#26 Post by michael_a »

Code: Select all

dd bs=4M if=archlinux-2016.05.01-dual.iso of=/dev/sdb status=progress && sync
This gives me an error: "unrecognised operand: status" but if I omit that flag, the command works fine. However, in UEFI mode, the USB boots, but if I select the default menu option ("Arch Linux archiso x86_64 UEFI CD") to boot into the live CD, my system hangs on a black screen. I downloaded the Arch iso from the worldwide Rackspace mirror and verified that the SHA1 checksum is correct. Even hitting control alt delete for a soft reboot doesn't have any effect.

If I disable UEFI boot and enable Legacy Only, then select "Boot Arch Linux (x86_64)" from the non-UEFI menu, it hangs on

Code: Select all

Probing EDD (edd=off to disable)... ok
and once again, control alt delete has no effect. Even though EDD doesn't seem to be the problem (since it looks like it's hanging on whatever the next step is), I tried adding edd=off to the boot option. As expected, it just hangs on a black screen with a blinking cursor.

Unless there's something obvious that I'm missing here, I'm thinking I should just bite the bullet and install Debian with a boot partition on a separate (non-NVMe) USB drive. It's clunky, and I hate having to carry an extra USB drive just to boot my laptop, but right now I haven't been able to get any OS installed and booting on the machine. Not Debian, Arch, Ubuntu, or even Windows 10, so at this point, it's a lightweight, very portable coaster.

User avatar
dotlj
Posts: 646
Joined: 2009-12-25 17:21

Re: GRUB and LILO both fail to install to NVMe hard disk

#27 Post by dotlj »

I have a new notebook with NVMe using a Toshiba 128GB which booted nicely from a debian-8.4.0-amd64-CD-1.iso image from a USB flashdisk and installed on /dev/sda1.
As I'm using Debian Stable on other machines, I use
cat debian-8.4.0-amd64-CD-1.iso > /dev/sdx where x is determined by dmesg | tail after inserting the usb flashdisk.
In installing Debian, use expert mode, it gives more options. When it comes to installing grub if offers a choice between
/dev/sda
/dev/sda1
and other options. As you set up partitioning, you know that /dev/sda1 is /boot, so write to it and it had no complaints.
I did try a few of the UEFI options, the disk is partitioned inside the Debian installer using GPT, that's another option it gives.
When it boots, it takes longer for me to type in my 20+ character password than it does for the system to go from password request to opening all the previously opened windows in KDE and I type fast. :wink:

michael_a
Posts: 28
Joined: 2016-05-03 13:59

Re: GRUB and LILO both fail to install to NVMe hard disk

#28 Post by michael_a »

I have a new notebook with NVMe using a Toshiba 128GB which booted nicely from a debian-8.4.0-amd64-CD-1.iso image from a USB flashdisk and installed on /dev/sda1.
To be clear, /dev/sda1 is referring to the internal NVMe hard drive, an external USB drive that the bootloader is installed on, or the external USB drive that holds the installation files from the ISO image? On my machine, /dev/nvme0n1 is the internal hard drive, with /dev/nvme0n1p1 as the first partition, and so on, and it's these NVMe entries in /dev/ that GRUB doesn't seem to recognize.

User avatar
dotlj
Posts: 646
Joined: 2009-12-25 17:21

Re: GRUB and LILO both fail to install to NVMe hard disk

#29 Post by dotlj »

On my machine, Debian Jessie sees the NVMe as /dev/sda, the other internal sata disk as /dev/sdb and the usb flashdisk I used to install Debian as /dev/sdc.
During the installation, in disk partitioning, I removed all partitions from /dev/sda and created my own partitions, chose the mount points and filesystems.
At the end of the installation, Debian Jessie wrote GRUB to the NVMe which it saw as /dev/sda
In my setup, /dev/sda1 is mounted as /boot
GRUB installed nicely and boots nicely from the NVMe.

michael_a
Posts: 28
Joined: 2016-05-03 13:59

Re: GRUB and LILO both fail to install to NVMe hard disk

#30 Post by michael_a »

dotlj wrote:On my machine, Debian Jessie sees the NVMe as /dev/sda, the other internal sata disk as /dev/sdb and the usb flashdisk I used to install Debian as /dev/sdc.
This is not the case on my machine. In a previous post I posted the output from "fdisk -l", and the NVMe drive shows up as /dev/nvme0n1. There is a pre-existing bug report about grub-install failing on NVMe drives because it can't translate the partition name (/dev/nvme0n1p1) into the disk name (/dev/nvme0n1). The bug is listed as "fixed" and backported to Jessie/stable (the version of Debian I'm trying to install), so why it's still failing is beyond me.

Over the next few days, I'll try downloading the most recent release of Debian testing and see if that installs properly, because presumably that version should have versions of grub and initramfs with the necessary patches. I'm on a slow connection, so it takes me a while to download an ISO image, but I'll give it a try.

User avatar
dotlj
Posts: 646
Joined: 2009-12-25 17:21

Re: GRUB and LILO both fail to install to NVMe hard disk

#31 Post by dotlj »

I have an MSI computer. I checked the specifications on your Lenovo Thinkpad X1 Carbon and are quite different.
Maybe the BIOS or something else? Debian Jessie and Stretch both show my disk as /dev/sda

Code: Select all

fdisk -l

Disk /dev/sda: 119.2 GiB, 128035676160 bytes, 250069680 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: xxxxxxxxxx

Device     Boot  Start       End   Sectors  Size Id Type
/dev/sda1  *      2048    499711    497664  243M 83 Linux
/dev/sda2       501758 250068991 249567234  119G  5 Extended
/dev/sda5       501760 250068991 249567232  119G 83 Linux

Disk /dev/sdb: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: yyyyyyyyy

Device      Start        End    Sectors   Size Type
/dev/sdb1    2048     249855     247808   121M Linux filesystem
/dev/sdb2  249856 1953523711 1953273856 931.4G Linux filesystem

I thought that I had kept the GPT, but I must have changed it to DOS. You could try that inside the Debian installer as I did.

michael_a
Posts: 28
Joined: 2016-05-03 13:59

Re: GRUB and LILO both fail to install to NVMe hard disk

#32 Post by michael_a »

The problem obviously lies with the version of grub-installer that Debian jessie (stable) is using (version 1.117+deb8u1); that version doesn't include the version that fixes the bug related to NVMe drives. The version of grub-installer included in Debian stretch (version 1.132) does include the fix, and that installer was able to install to /dev/nvme01 correctly.

However, for stability reasons, I'd really rather not use the testing version of Debian on my main machine (this laptop). Is there any way to use the newer version of grub-installer with the stable version of Debian? Or should I install Debian stable without the bootloader, then try to install grub on /dev/nvme01 from a (testing/stretch) Debian live CD, since that live CD will use the newer version that recognizes my hard drive?

User avatar
dotlj
Posts: 646
Joined: 2009-12-25 17:21

Re: GRUB and LILO both fail to install to NVMe hard disk

#33 Post by dotlj »

I have not tried this but it should be possible to use Debian Jessie for the install up to grub, open a virtual terminal and install the package from another device, manually install grub, go back to finish the installation (set up users and so on) then reboot

I have installed both Debian Jessie and Debian Stretch on NVMe disks and read all of the bug report which hasn't been updated for over three months. I wonder if there is something else, why Debian Jessie and Stretch both detect my drive as /dev/sda and yours is not?

michael_a
Posts: 28
Joined: 2016-05-03 13:59

Re: GRUB and LILO both fail to install to NVMe hard disk

#34 Post by michael_a »

dotlj wrote:I have not tried this but it should be possible to use Debian Jessie for the install up to grub, open a virtual terminal and install the package from another device, manually install grub, go back to finish the installation (set up users and so on) then reboot
How would I go about doing this? To quote the package description for grub-installer:
Warning: This package is intended for the use in building debian-installer images only. Do not install it on a normal Debian system.
so I don't think I can just put the .deb file on a separate USB drive and install it from a virtual terminal during the installation.

User avatar
dotlj
Posts: 646
Joined: 2009-12-25 17:21

Re: GRUB and LILO both fail to install to NVMe hard disk

#35 Post by dotlj »

Good question.
You can modify an existing Debian CD image. I've done this with another distro using .deb packages but not Debian.
https://wiki.debian.org/DebianInstaller/Modify/CD

Add the grub-installer from Stretch, check dependencies, I think they should be similar to grub-installer from Jessie. If it gets too messy, it may be better to wait for an update or look for an easier alternative. If there are no dependency problems, go ahead. After changing the grub-installer from Jessie to Stretch, add the new checksum for the package and the total in md5sum.txt
The wiki has all the details needed, last step is to generate the new iso with genisoimage.
Naturally, you should not need to do this but from what you describe it looks like an option.

I'm still thinking about an easier option. In your BIOS settings, how are the disks recognized?
Are there any other optinos that might help Debian to find your disk as /dev/sda or /dev/sdb ?

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: GRUB and LILO both fail to install to NVMe hard disk

#36 Post by Head_on_a_Stick »

deadbang

michael_a
Posts: 28
Joined: 2016-05-03 13:59

Re: GRUB and LILO both fail to install to NVMe hard disk

#37 Post by michael_a »

I finally came across this wiki post, and with some tweaking to remove the steps dealing with dual boot, those instructions worked for me. To summarize:
  1. In the BIOS, set "UEFI only" boot.
  2. Using Gparted, create a FAT32 partition at the beginning of the disk with the boot and esp flags. (The Debian installer should be able to do this too, but since the installer incorrectly recognized the size of the disk, I prefer to use Gparted). In my case, the FAT32 partition is /dev/nvme0n1p1.
  3. During the installation, make sure you have a network connection configured (manually or automatically, doesn't matter). Otherwise, the next step will fail.

    Code: Select all

    mount --bind /dev /target/dev
    mount --bind /dev/pts /target/dev/pts
    mount --bind /proc /target/proc
    mount --bind /sys /target/sys
    cp /etc/resolv.conf /target/etc
    chroot /target /bin/bash
    
    aptitude update
    aptitude install grub-efi-amd64
    update-grub
    grub-install --target=x86_64-efi /dev/nvme0n1
    
    Exit the shell and select "Continue without installing a bootloader."
  4. At the installation stage where GRUB fails to install, open a shell and run:,
  5. Once the installation completes, boot into the system. Add "nvme" to /etc/initramfs-tools/modules, then run update-initramfs -u as root.
  6. Edit /etc/default/grub and add this line

    Code: Select all

    GRUB_CMDLINE_LINUX="intel_pstate=no_hwp"
    
    and add "nomodeset" to the GRUB_CMDLINE_LINUX_DEFAULT so it looks like this:

    Code: Select all

    GRUB_CMDLINE_LINUX_DEFAULT="quiet nomodeset"
    
  7. Run update-grub.
These steps worked for me; presumably, the wiki page will be more up-to-date in the future, but I posted them here for completeness. I also updated the Unix.SE post.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: GRUB and LILO both fail to install to NVMe hard disk

#38 Post by Head_on_a_Stick »

michael_a wrote:presumably, the wiki page will be more up-to-date in the future
Probably not, perhaps you should add the information yourself?

I think that's how community wikis are supposed to work ;)
deadbang

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: GRUB and LILO both fail to install to NVMe hard disk

#39 Post by GarryRicketson »

by Head_on_a_Stick » I think that's how community wikis are supposed to work ;)
I think so to, but rather then edit the entire tutorial, / page, it seemed to me like
the easiest thing to do was just add a link to this thread.
I added a link, down at the bottom of the page, under "usefull links"
Looks like that page needs some translations done as well, it is only in
English.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: GRUB and LILO both fail to install to NVMe hard disk

#40 Post by Head_on_a_Stick »

Thanks Gary!

I can't create a Debian wiki account, it keeps rejecting my applications :(
deadbang

Post Reply