12

I'm trying to install 64-bit Debian stable on a Lenovo Thinkpad. When I get to the installation step that installs the bootloader, I get this message:

An installation step failed. You can try running 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

Going back to the menu and selecting LILO gives me the same error. The installation log says

May  1 13:24:23 main-menu[188]: WARNING **: Configuring 'grub-installer' failed with error code 1
May  1 13:24:23 main-menu[188]: WARNING **: Menu item 'grub-installer' failed.
May  1 13:24:28 main-menu[188]: INFO: Menu item 'lilo-installer' selected
May  1 13:24:28 main-menu[188]: WARNING **: Unable to set title for fdisk-udeb.
May  1 13:24:28 main-menu[188]: WARNING **: Configuring 'lilo-installer' failed with error code 1
May  1 13:24:28 main-menu[188]: WARNING **: Menu item 'lilo-installer' failed.

I'm not using LVM or RAID. So far, I've tried

  1. Disabling UEFI boot and using legacy boot instead. The error still occurs, with both GRUB and LILO.

  2. Following the instructions on this question and running

    parted /dev/nvme01
    set 1 bios_grub on
    

    from TTY2, but I get an error that says parted not found. On my system /dev/nvme01 is the only hard disk

  3. Check for hardware errors. When I first purchased the system I ran all the available hardware tests, both from within the BIOS and from within Windows, and it passed all of them. I'm assuming that means the hardware isn't malfunctioning.

  4. Per this thread that had a similar error, albeit with LVM, I tried redoing the partitioning with a small /boot partition at the beginning, formatted with ext2. Same error.

  5. Switching to TTY4 to look at the installation output, I also see the error

    chroot: can't execute 'grub-probe': No such file or directory
    

    Searching for information on that turns up this thread and this bug report related to GRUB, but a) those are old, and b) I've run through the installation up to this point over a dozen times now and I get the error every time, so it doesn't seem like a one-off thing.

  6. I've used Gparted to check that the hard disk is completely empty.

  7. Secure boot is disabled in the BIOS.

  8. I've run the installation using the full DVD and the netinstall CD; both are booted from USB, but the problem persists.

I was able to successfully create an msdos partition table and three partitions (for /, /home, and swap) on the drive in the previous installation step, so I don't know why GRUB suddenly can't write to the drive.

How do I fix this and get Debian installed? As of now, the (brand new!) system is completely unusable because I can't get an OS on it.


Could part of the problem be that Debian/parted recognizes the disk incorrectly? It says the disk is 512.1 GB, which is true in the sense that the specs say 512 GB and that's what is advertised, and it will let me allocate all 512 GB to various partitions. However, if I load it in Gparted, the actual disk space is closer to 476 GB, but I assumed that's just the usual 1024 vs 1000 stuff.

(I also posted a version of this question on the Debian forums, so I'll update my question with anything important from that thread and vice versa.)

4
  • Have you tried installing GRUB on an external drive, e.g. a flash drive?
    – McSinyx
    Commented May 4, 2016 at 3:37
  • I see you're using an msdos partition table. Does GPT work?
    – forquare
    Commented May 10, 2016 at 8:48
  • @forquare No, GPT doesn't work either.
    – Michael A
    Commented May 10, 2016 at 14:26
  • @McSinyx I can install GRUB on an external drive, as long as the external drive is recognized as /dev/sdX and not /dev/nvmeXXX or /dev/<some other strange combination>. My preference is not having to use a USB drive just to boot my machine, but it's looks increasingly like that's my only option at this point.
    – Michael A
    Commented May 10, 2016 at 14:27

2 Answers 2

14

Here is what worked for me, using Debian jessie (stable). I basically took the instructions from this wiki post, and stripped out all the steps about dual-booting with Windows, since those didn't apply to my case.

  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.

  4. At the installation stage where GRUB fails to install, open a shell and run the following commands:

    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." You'll see a warning message that gives you boot commands to use; you can ignore this.

  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

    GRUB_CMDLINE_LINUX="intel_pstate=no_hwp"
    

    and add "nomodeset" to the GRUB_CMDLINE_LINUX_DEFAULT so it looks like this:

    GRUB_CMDLINE_LINUX_DEFAULT="quiet nomodeset"
    
  7. Run update-grub.

The last few commands (initramfs onward) are necessary to prevent disk not found errors the second time you try to boot into the new system.

3
  • 2
    Thank you for this one! It worked fine even without using Gparted! Commented Jul 3, 2016 at 12:52
  • When I grub-install --target=x86_64-efi /dev/nvme0n1, I got error: failed to register the EFI boot entry: No such file or directory
    – Rahn
    Commented May 16, 2019 at 12:04
  • @Rahn Is there actually a /dev/nvme0n1 on your system? It's not called something else like /dev/nvme0n2? You should ask a new question, but sudo fdisk -l is the place to start.
    – Michael A
    Commented Jun 9, 2019 at 1:59
0

Since I cannot locate a more recent question, the debian installer tends to stick with the same defaults, even after they're obsolete. If you choose partioning 'guided' whole disk, you will get the old msdos/mbr partitioning scheme.

If one really jumps through hoops, nvme can boot this way.

If you perform a manual partioning, you can use GPT partitioning, which the nvme controller expects, and it doesn't matter what order the partitions are in. You almost never want a PC Linux system in a single disk partition anyway.

For booting a nvme drive, use GPT partition table, 500MB or so /boot; 35-50GB /; 75-100GB /home; 100-150GB /usr; 4-16GB swap area; 300MB efi partition; and let the rest fall into the / partition. The remainder of the drive can be partitioned the way you want, with manually entered mount points, or you can make the mount points after the system is up.

Then, grub will install to nvme during the installation. GPT partioning may be the default during installation if, before booting the installation media, the BIOS is set to UEFI BOOT ONLY.

I have been developing on Linux for 19 years, and Debian since woody.I'm pretty familiar with the Debian installer.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .