grub2 needs to install the bootloader to each disk in a RAID1 array providing /boot

Bug #427048 reported by Dustin Kirkland 
84
This bug affects 16 people
Affects Status Importance Assigned to Milestone
grub-installer (Ubuntu)
Fix Released
High
Colin Watson
Karmic
Fix Released
High
Colin Watson

Bug Description

Binary package hint: grub2

Intrepid, Jaunty, and a backport to Hardy allowed Ubuntu to install into a RAID1 array, and thereafter boot from any of the hard drives in the array. Thus, a degraded array event would not yield the system unbootable.

There were several aspects to solving this problem (partman, mdadm, the initramfs, and grub).

The grub pieces need to be ported forward to grub2.

In grub's grub-install script, there's a check if /boot is on a disk provided by a /dev/md device, and if so, the bootloader is installed to each disk in the array.

This is perhaps a bit hackish, though functional. It may be desirable to rework this into something more robust in the longer term.

However, at this point karmic-servers have regressed on the ability to boot from a degraded RAID.

:-Dustin

Changed in grub2 (Ubuntu):
importance: Undecided → High
status: New → Triaged
assignee: nobody → Colin Watson (cjwatson)
tags: added: regression-potential
Changed in grub2 (Ubuntu):
milestone: none → karmic-alpha-6
Changed in grub2 (Ubuntu):
milestone: karmic-alpha-6 → ubuntu-9.10
Colin Watson (cjwatson)
affects: grub2 (Ubuntu Karmic) → grub-installer (Ubuntu Karmic)
Changed in grub-installer (Ubuntu Karmic):
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package grub-installer - 1.43ubuntu4

---------------
grub-installer (1.43ubuntu4) karmic; urgency=low

  * Fix typo in fallback case when computing $disc_offered_devfs.
  * If /boot is on an MD device and we're using GRUB 2, install GRUB there
    rather than (hd0); GRUB 2 will interpret that as meaning that it needs
    to install to each of the RAID members (LP: #427048).

 -- Colin Watson <email address hidden> Fri, 02 Oct 2009 15:22:33 +0100

Changed in grub-installer (Ubuntu Karmic):
status: Fix Committed → Fix Released
Revision history for this message
Conor (ronocdh) wrote :

The workaround for this, if installing Karmic beta server edition, would be to manually install grub to each drive, right? It's not that the installer can't do it, it's just that it doesn't automatically, as I understand it.

This would be the basic "setup (hdx,x)" stuff, if I'm understanding this correctly. Someone please set me straight if I'm wrong!

Revision history for this message
Brandon Checketts (brandonchecketts) wrote :

Trying this on Karmic beta (AMD64) and the grub installation fails with a red screen

====================================
Unable to install GRUB in /dev/mdo
Executing 'grub-install /dev/md0 failed'
This is a fatal error
====================================

I tried to shell out and install grub during install, but couldn't figure out how. I continued installation without installing a boot loader.

Rebooted to Alternate CD, and chose to repair a broken installation. Once to a shell, I ran
grub-install /dev/sda
grub-install /dev/sdb

Removed CD and rebooted. It ended up at a grub shell. At which point I ran the following to boot into the system (note the difference in grub2 commands)

set root=(hd0,1)
linux /vmlinuz-2.6.31-14-generic ro root=/dev/md1 (use tab-completion on the kernel image filename)
initrd /initrd.img-2.6.31-14-generic (use tab-completion)
boot

At that point, it started up normally. Once logged in, I started a terminal and then ran this command as root to create a minimal grub.cfg file (note that it is no longer called menu.lst)

grub-mkconfig > /boot/grub/grub.cfg

I'm now able to reboot into a working system.

Revision history for this message
Nikolay Konstantinov (nikolay-konstantinov) wrote :

problem with 9.10 server clean install.
i have RAID0 ... ubuntu sees it .. but when i get to the point when i have to install GRUB .. it gets to 16% and breaks down trowing me in to main menu.
any idea how to fix this ?

Revision history for this message
Nikolay Konstantinov (nikolay-konstantinov) wrote :

is there other way exept clean install on 8.10 and afetr that do-release-upgrade to 9.10 ?

tags: added: iso-testing
Revision history for this message
stop (whoopwhoop) wrote :

This seems to be broken again in lucid. Can't get grub installed with software raid1.

Revision history for this message
Steve Jackson (aearenda) wrote :

Broken for me in Lucid too, on setup from the i386 Alternate CD.
====================================
Unable to install GRUB in /dev/md1
Executing 'grub-install /dev/md1 failed'
This is a fatal error
====================================

Manual setup succeeded in the alternate CD repair chroot using grub-install /dev/sda repeated for /dev/sdb.

Revision history for this message
Colin Watson (cjwatson) wrote : Re: [Bug 427048] Re: grub2 needs to install the bootloader to each disk in a RAID1 array providing /boot

I'm tracking the current problems with grub2 and RAID in Lucid as bug
527401
, rather than reopening this old bug.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.