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

Bug #427048 reported by Dustin Kirkland  on 2009-09-09
76
This bug affects 14 people
Affects Status Importance Assigned to Milestone
grub-installer (Ubuntu)
High
Colin Watson
Karmic
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) on 2009-10-01
affects: grub2 (Ubuntu Karmic) → grub-installer (Ubuntu Karmic)
Changed in grub-installer (Ubuntu Karmic):
status: Triaged → Fix Committed
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
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!

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.

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 ?

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

tags: added: iso-testing
whoop (tiredandnumb) wrote :

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

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.

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  Edit
Everyone can see this information.

Other bug subscribers