I have a Debian Wheezy system. On a recent upgrade, I got an error message from GRUB telling me that embedding was not supported for ext2 file systems (huh? Never seen that one before.) and after a bit of digging the problem appears to be that I was installing GRUB into the boot record of /dev/md0, which is formatted directly (no partitions inside the MD container).

I was able to get past this by manually pointing grub-install at the raw disk device (in GRUB parlace, (hd0)) instead, but I have a feeling that this will come up again the next time GRUB gets updated.

This led me to start looking for where the GRUB installation location is actually stored on Wheezy. However, grepping for md0 didn't yield anything interesting.

Hence my question: On Debian Wheezy specifically, where exactly does one set the GRUB installation location? In other words, if I want to change my GRUB setup from being in a partition boot record to being in the master boot record, say, what specific file (and setting within that file) do I need to change?

  • A couple things to check. Is /boot mounted from a partition on the boot device? Also, what is in file /boot/grub/device.map which may be left over from grub-legacy and sometimes references by grub2?
    – Gregor
    Apr 18, 2015 at 3:51
  • @Gregor I'm not sure I see what you are going for. /boot exists within the root partition, which is mounted by-uuid and lives on the device /dev/md0, but I don't see how the physical location of the contents of /boot has any bearing on whether GRUB is installed in the partition boot record or the master boot record, and on which device(s). device.map is dated from around when I installed the current device that holds the root file system, and has a mixture of old and current entries, but the physical device that holds /dev/md0 is in the list (as hd0).
    – user
    Apr 18, 2015 at 12:06

1 Answer 1


So the problem is, grub is likely to assume that because /boot is on /dev/md0 and (hd0) is indicated as /dev/md0 in device.map that the MBR should go on /dev/md0, and then you see an error message because /dev/md0 does not have an MBR. The good news, is that is the the original MBR and bootstrap are still on your bios boot device (probably /dev/sda), which is why your system boots. This lower-level boot-strap code changes rarely, so it is not a huge problem if it is not updated. You may just have to live with this error message, however, there are a couple things you could try/check:

  • make sure you don't have another boot partition on the bios boot device, that you simply cannot see, because it is not mounted. This could happen if your /etc/fstab was missing an entry for /boot
    • it would show up as an ext2 or ext4 partition, probably less that 500MB.
  • rename device.map because grub2 does not really need it and it might be providing mis-information to the post-install script and/or grub-install.
  • then, run grub-install /dev/sdX (where sdX is your actual bios boot device). This will update the MBR and bootstrap code on that device, in case it is out-of-date.
    • if that doesn't work, you could do: grub-install --boot-directory=/boot /dev/sdX

You configuration is a little odd, but should be supported ok in grub2. In the end, you may just have to live with the error message and run grub-install manually once a year.

You must log in to answer this question.

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