If I use the Debian Stable (Squeeze) Installer to install Debian, booting from a RAID1 pair of drives, does it write grub to the MBR of both drives - if not, how should I best protect against a drive failure - if I just clone the MBR won't it still point to the failed device?


Not sure if the installer does it by default, but if (once the system is booted) you run:

# dpkg-reconfigure -plow grub-pc 

just hit enter until you're prompted for "GRUB install devices", then you can select the MBRs of both drives.

Here is a screenshot of the relevant screen in Debian Jessie (8.3), with GRUB2 version 2.02~beta2-22+deb8u1. This shows the setup of my computer, which has two drives (/dev/sda and /dev/sdb) in a RAID 1 configuration (/dev/md1), and two other drives (/dev/sdc and /dev/sdd) in a RAID 1 configuration (/dev/md0).

enter image description here

  • Thanks. Does the MBR then point at one particular device and if so would they both point at the same device (which would be bad if that one failed)? – Jack Douglas Nov 28 '11 at 15:03
  • The MBR should point the to device the MBR is on. Or possibly the first device. BIOSes make this hard to get right, you should test it to be sure. Pull the power cable off of each of the disks (one at a time). If you get to the grub menu, then you should be good. – derobert Nov 28 '11 at 15:14
  • Each disk will have its own MBR and embedded grub2 core image that will look for your /boot. If your /boot is in an mdadm raid1, then it will find it on either disk. – psusi Nov 28 '11 at 15:39
  • @psusi grub legacy is still the default with the stable debian installer – Jack Douglas Nov 28 '11 at 15:59
  • saying that I'd consider installing grub2 if it is straightforward and does what you say? – Jack Douglas Nov 28 '11 at 16:00

If you install Grub legacy, then it's only installed on the one boot disk. You can add it to the second disk's MBR by running grub-install /dev/sdb (assuming that your second disk is /dev/sdb). Make sure that in both cases, Grub reads from the first BIOS disk (you may need to tweak /boot/grub/device.map for that). If one of the two disks fails, whichever disk is left will be the first BIOS disk.

You can install Grub2 on Debian squeeze, and I recommend that if you have any sort of nontrivial setup such as RAID. Grub2 has the advantage that you can put your whole system on LVM, you don't need a non-LVM /boot partition. As far as I know, the squeeze installer supports installations over RAID+LVM with grub2 (you may need to coerce it a little not to create a separate /boot partition).

  • My apologies for my newbie confusion - I assumed v1.98 was not Grub2, Grub2 is in fact installed. The d-i happily installed booting from a RAID1 array it created btw – Jack Douglas Nov 28 '11 at 18:19
  • The main thing I'm still confused about is whether d-i installed Grub2 to both drives in the arrar or just one - I can test by pulling them out in turn and booting but I wonder if there is a way I can examine the MBR or if there is a tool that will tell me... – Jack Douglas Nov 28 '11 at 18:21
  • 2
    @JackDouglas </dev/sda head -c 512 | hd will at least tell you if Grub is present there. You can also see where it's looking next, but I don't know which bytes to look at. – Gilles Nov 28 '11 at 18:27
  • thanks, interesting. If I understand the output correctly Grub is on sda but not sdb. I'll follow derobert's suggestion to install on sdb as well – Jack Douglas Nov 28 '11 at 22:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.