For several releases, grub-installer sometimes could not find the right place to install the bootloader. See:

1. Objectives

2. History

2.1. Behaviour in wheezy

:TODO: what happens if existing bootloader / OSes are detected?

2.2. Behaviour in current daily d-i

the same complex logic as before

if (hd0) seems correct after the checks above, it will ask to install to "the MBR of the first disk" (this yes/no dialog doesn't give the user any information to help identify the disk)

otherwise, a new dialog asks the user to confirm

the first option is "Enter device manually", followed by $dev_list in grub-mkdevicemap order; each device listed in the dialog includes a description to help identify it

choosing "Enter device manually" gives a much less informative dialog asking for an exact device path

:FIXME: in the first dialog, $default_choice is supposed to preset the default selection to our best guess - is that not working properly?

in preseed installs, "Enter device manually" seems to be always chosen and the install gets stuck, see:

3. Dialogs

    Install the GRUB boot loader to the master boot record?
    <Go Back>  <Yes> <No>

This is not very good. It is sometimes wrong about which disk has the MBR. It doesn't give information to help the user identify the device before confirming. This dialog is only shown in some cases (typically CD/DVD/PXE installs).

    Device for boot loader installation:
    [o] Enter device manually
    [ ] /dev/sda (ata-QEMU_HARDDISK_QM00001)
    <Go Back>

This dialog (new since wheezy) is much better. Sometimes(?) the default selection is something other than the "Enter device manually" option. All devices detected by grub-mkdevicemap are listed, along with some information to help identify them.

    Device for boot loader installation:
    <Go Back>  <Continue>

This is also not very good. Only an expert user should be asked something like this. No list of detected devices is shown. It is too late to return to partman and look at mount points.

4. Test cases



arch, platform/hardware

install media

install target



references / who can test



i386 on old Fujitsu Amilo laptop

Xfce ISO booted from USB stick

the first hard disk (of two)

manual, whole-disk LVM

{X} asks to enter device manually, pre-filled with /dev/sdb (correct) but the instructions are to use /dev/sda for the first disk (which is wrong, that's the install media); detection is right but the user is given wrong instructions

n/a - not my laptop


jessie d-i daily 20140908

linux-i386 in Qemu


the only hard disk


(./) grub-installer guesses (hd0), asks (yes/no) whether to install to MBR, it works

anyone: qemu -hda hda.raw + TFTP options


jessie d-i daily 20140911

kfreebsd-amd64 in Qemu


the only hard disk


(./) grub-install does *not* assume (hd0), actually due to a bug, instead asks to choose from a list (other; /dev/ada0), but works if choosing /dev/ada0



jessie d-i daily

amd64 in VirtualBox

ISO image mounted as virtual CD-ROM

the only hard disk

auto preseed

{X} grub-install does *not* assume (hd0), but instead displays the new dialog of "Enter device manually" and only one more option (the only disk); this dialog interrupts the preseed process

mail on -boot@


jessie d-i daily 20140914

kfreebsd-amd64 on

mini.iso as virtual CD-ROM

the first hard disk (of two)

expert mode; gpt, ZFS root, /boot on UFS

{X} asks (yes/no) whether to install to MBR, then asks to "Enter device manually" with no other options - grub-mkdevicemap doesn't understand recognise virtio device /dev/vtbd0



jessie d-i daily 20141001

linux-amd64 in Qemu

mini.iso as (first) virtual hard drive

one real hard disk


{X} 763580 pre-selects /dev/sda in list

anyone: qemu -hda mini.iso -hdb foo.cow

TODO: add examples of real hardware, which is where we have the most issues

4.1. When the detection is right

most CD/DVD installs? PXE installs?

4.2. When the detection is wrong

most(?) installs from a removable USB stick; the removable drive may appear as the first disk drive; the install media is broken if the bootloader is overwritten, and the system's real hard drive left without a bootloader

installs to an external hard drive (but is it possible to guess the user's intent in this situation?)

perhaps when firmware is loaded from USB stick - could be inserted before or after boot - could grub-mkdevicemap ever mistake it for (hd0)?

multipath? SATA RAID?