GRUB and LILO both fail to install to NVMe hard disk

Help with issues regarding installation of Debian

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

Postby dotlj » 2016-05-12 01:45

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.
User avatar
dotlj
 
Posts: 646
Joined: 2009-12-25 17:21

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

Postby michael_a » 2016-05-16 02:29

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?
michael_a
 
Posts: 28
Joined: 2016-05-03 13:59

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

Postby dotlj » 2016-05-16 04:25

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?
User avatar
dotlj
 
Posts: 646
Joined: 2009-12-25 17:21

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

Postby michael_a » 2016-05-16 14:34

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.
michael_a
 
Posts: 28
Joined: 2016-05-03 13:59

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

Postby dotlj » 2016-05-17 08:00

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
dotlj
 
Posts: 646
Joined: 2009-12-25 17:21


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

Postby michael_a » 2016-05-31 15:49

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.
michael_a
 
Posts: 28
Joined: 2016-05-03 13:59

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

Postby Head_on_a_Stick » 2016-05-31 21:25

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 ;)
User avatar
Head_on_a_Stick
 
Posts: 11134
Joined: 2014-06-01 17:46
Location: /dev/chair

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

Postby GarryRicketson » 2016-05-31 22:50

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
GarryRicketson
 
Posts: 5872
Joined: 2015-01-20 22:16
Location: Durango, Mexico

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

Postby Head_on_a_Stick » 2016-06-01 08:10

Thanks Gary!

I can't create a Debian wiki account, it keeps rejecting my applications :(
User avatar
Head_on_a_Stick
 
Posts: 11134
Joined: 2014-06-01 17:46
Location: /dev/chair

Previous

Return to Installation

Who is online

Users browsing this forum: No registered users and 12 guests

fashionable