Debian Bug report logs - #489006
debian-installer: After grub software raid installation, machine fails to boot with first drive removed or blanked.

Package: grub-installer; Maintainer for grub-installer is Debian Install System Team <debian-boot@lists.debian.org>; Source for grub-installer is src:grub-installer.

Reported by: Tim Small <tim@buttersideup.com>

Date: Wed, 2 Jul 2008 18:00:02 UTC

Severity: normal

Tags: d-i, patch

Merged with 252009, 292513, 310798, 391489, 578338, 582367

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#489006; Package debian-installer. Full text and rfc822 format available.

Acknowledgement sent to Tim Small <tim@buttersideup.com>:
New Bug report received and forwarded. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Tim Small <tim@buttersideup.com>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: debian-installer: After grub software raid installation, machine fails to boot with first drive removed or blanked.
Date: Wed, 02 Jul 2008 18:56:51 +0100
Package: debian-installer
Version: 20070308etch2
Severity: normal

I preseeded an Etch installtion with:

d-i grub-installer/bootdev  string (hd0) (hd1)

but it didn't do what I expected with respect to software RAID, and
failed drives.

The current behaviour seems to be:

boot from sda if it is first BIOS drive (0x80)
boot from sdb if it is second BIOS drive (0x81)

If the first hard drive is completely failed, or missing, it will
attempt to boot from the second drive, but fail, because it tries to
acces drive 0x81, but the BIOS has now assigned 0x80 to the remaining
drive.

If I "dd if=/dev/zero of=/dev/sda count=1" (i.e. remove partition
table, and beginning of grub code) then the boot still fails, as the
BIOS still assigns the second drive 0x80.

OTOH, if the first hard drive is present, but unreadable, AND the BIOS
attempts to boot from the second hard drive, but still assigns the
second drive 0x81, then boot will succeed with the existing code, but
not with my post-install commands (however you could still get the
machine to boot by disabling or removing the first drive).  However, I
haven't observed a BIOS which behaves like this.  

I got better behaviour by executing this as a
post-install step:

echo '(hd0) /dev/sdb' > /target/boot/grub/device.map
in-target /usr/sbin/grub-install hd0
echo '(hd0) /dev/sda' > /target/boot/grub/device.map
in-target /usr/sbin/grub-install hd0

Behaviour with the additional post-install steps seems to be:

boot from sda if it is first BIOS drive (0x80)
boot from sdb if it is first BIOS drive (0x80)

It is possible to make sdb the second BIOS drive (0x80) by telling
the BIOS to boot from the second drive, and/or physically removing
sda.  If I "dd if=/dev/zero of=/dev/sda count=1" (i.e. remove partition
table, and beginning of grub code) then the boot still succeeds.

A better fix, which should work in all situations, would be to change
grub so that it attempts to attempt to fall-back to reading from BIOS
drive 0x81 if 0x80 doesn't work (is blank / or unwell i.e. reads fail
etc.).  Without reviewing the grub code in detail, I don't know if this
second fix would be possible.


-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.25-2-amd64
Locale: LANG=en_GB, LC_CTYPE=en_GB (charmap=ISO-8859-1)

-- no debconf information




Bug reassigned from package `debian-installer' to `grub-installer'. Request was from Jérémy Bobbio <lunar@debian.org> to control@bugs.debian.org. (Thu, 03 Jul 2008 14:21:05 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#489006; Package grub-installer. (Wed, 03 Jun 2009 22:51:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Felix Zielcke <fzielcke@z-51.de>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. (Wed, 03 Jun 2009 22:51:04 GMT) Full text and rfc822 format available.

Message #12 received at 489006@bugs.debian.org (full text, mbox):

From: Felix Zielcke <fzielcke@z-51.de>
To: 489006@bugs.debian.org, 489006-submitter@bugs.debian.org
Subject: debian-installer: After grub software raid installation, machine fails to boot with first drive removed or blanked.
Date: Thu, 04 Jun 2009 00:36:55 +0200
I think this shouldn't anymore happen with grub2.
It supports the Linux Software RAID.
Could you please try it? (grub-pc package)
-- 
Felix Zielcke





Message sent on to Tim Small <tim@buttersideup.com>:
Bug#489006. (Wed, 03 Jun 2009 22:51:05 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#489006; Package grub-installer. (Wed, 17 Jun 2009 13:45:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Raphael Hertzog <hertzog@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. (Wed, 17 Jun 2009 13:45:03 GMT) Full text and rfc822 format available.

Message #20 received at 489006@bugs.debian.org (full text, mbox):

From: Raphael Hertzog <hertzog@debian.org>
To: Felix Zielcke <fzielcke@z-51.de>
Cc: 489006@bugs.debian.org
Subject: Re: debian-installer: After grub software raid installation, machine fails to boot with first drive removed or blanked.
Date: Wed, 17 Jun 2009 15:43:27 +0200
On Thu, 04 Jun 2009, Felix Zielcke wrote:
> I think this shouldn't anymore happen with grub2.
> It supports the Linux Software RAID.
> Could you please try it? (grub-pc package)

How are we supposed to try it?

grub-install /dev/md0 ?

In any case, grub-installer still needs some modifications to do the
proper operation, whatever it is.

I'm interested in seeing this bug resolved and I can do the required
tests if needed.

Cheers,
-- 
Raphaël Hertzog

Contribuez à Debian et gagnez un cahier de l'admin Debian Lenny :
http://www.ouaza.com/wp/2009/03/02/contribuer-a-debian-gagner-un-livre/




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#489006; Package grub-installer. (Wed, 17 Jun 2009 14:03:08 GMT) Full text and rfc822 format available.

Acknowledgement sent to Felix Zielcke <fzielcke@z-51.de>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. (Wed, 17 Jun 2009 14:03:08 GMT) Full text and rfc822 format available.

Message #25 received at 489006@bugs.debian.org (full text, mbox):

From: Felix Zielcke <fzielcke@z-51.de>
To: Raphael Hertzog <hertzog@debian.org>, 489006@bugs.debian.org
Subject: Re: Bug#489006: debian-installer: After grub software raid installation, machine fails to boot with first drive removed or blanked.
Date: Wed, 17 Jun 2009 16:00:00 +0200
Am Mittwoch, den 17.06.2009, 15:43 +0200 schrieb Raphael Hertzog:
> On Thu, 04 Jun 2009, Felix Zielcke wrote:
> > I think this shouldn't anymore happen with grub2.
> > It supports the Linux Software RAID.
> > Could you please try it? (grub-pc package)
> 
> How are we supposed to try it?
> 
> grub-install /dev/md0 ?

Either grub-install '(md0)' if you want to have grub2 in all MBRs
of /dev/md0 or just the old way like grub-install /dev/sda for every
disk.
update-grub generates grub.cfg with `set root=(md0)' and the same is
used for the --prefix in the grub-mkimage call in grub-install.
The prefix is the variable where grub2 loads all it's modules and the
config from.

> In any case, grub-installer still needs some modifications to do the
> proper operation, whatever it is.
> 
> I'm interested in seeing this bug resolved and I can do the required
> tests if needed.
> 

-- 
Felix Zielcke





Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#489006; Package grub-installer. (Thu, 18 Jun 2009 12:22:35 GMT) Full text and rfc822 format available.

Acknowledgement sent to Raphael Hertzog <hertzog@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. (Thu, 18 Jun 2009 12:23:04 GMT) Full text and rfc822 format available.

Message #30 received at 489006@bugs.debian.org (full text, mbox):

From: Raphael Hertzog <hertzog@debian.org>
To: Felix Zielcke <fzielcke@z-51.de>
Cc: 489006@bugs.debian.org
Subject: Re: Bug#489006: debian-installer: After grub software raid installation, machine fails to boot with first drive removed or blanked.
Date: Thu, 18 Jun 2009 14:19:49 +0200
On Wed, 17 Jun 2009, Felix Zielcke wrote:
> Am Mittwoch, den 17.06.2009, 15:43 +0200 schrieb Raphael Hertzog:
> > On Thu, 04 Jun 2009, Felix Zielcke wrote:
> > > I think this shouldn't anymore happen with grub2.
> > > It supports the Linux Software RAID.
> > > Could you please try it? (grub-pc package)
> > 
> > How are we supposed to try it?
> > 
> > grub-install /dev/md0 ?
> 
> Either grub-install '(md0)' if you want to have grub2 in all MBRs
> of /dev/md0

I tried this and it did work like expected.

> > In any case, grub-installer still needs some modifications to do the
> > proper operation, whatever it is.

I would suggest to force install grub-pc when boot partition is on RAID
and replace (hd0) by (md0) for installation in MBR. Maybe we need a
supplementary check that ensures that (hd0) is part of (md0).

I might try to come up with a patch.

Cheers,
-- 
Raphaël Hertzog

Contribuez à Debian et gagnez un cahier de l'admin Debian Lenny :
http://www.ouaza.com/wp/2009/03/02/contribuer-a-debian-gagner-un-livre/




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#489006; Package grub-installer. (Mon, 22 Jun 2009 13:15:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Raphael Hertzog <hertzog@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. (Mon, 22 Jun 2009 13:15:02 GMT) Full text and rfc822 format available.

Message #35 received at 489006@bugs.debian.org (full text, mbox):

From: Raphael Hertzog <hertzog@debian.org>
To: Felix Zielcke <fzielcke@z-51.de>
Cc: 489006@bugs.debian.org
Subject: Re: Bug#489006: debian-installer: After grub software raid installation, machine fails to boot with first drive removed or blanked.
Date: Mon, 22 Jun 2009 15:14:22 +0200
[Message part 1 (text/plain, inline)]
tag 489006 patch
thanks
On Thu, 18 Jun 2009, Raphael Hertzog wrote:
> I would suggest to force install grub-pc when boot partition is on RAID
> and replace (hd0) by (md0) for installation in MBR. Maybe we need a
> supplementary check that ensures that (hd0) is part of (md0).
> 
> I might try to come up with a patch.

Here's a (raw) patch. I quickly tested it and it seems to work. I do not
check if (hd0) is part of (md0) however... you might want to
avoid entirely the problem by installing both to (hd0) and (md0).

The call to grub-mkdevicemap is needed otherwise grub-probe doesn't work.

Cheers,
-- 
Raphaël Hertzog

Contribuez à Debian et gagnez un cahier de l'admin Debian Lenny :
http://www.ouaza.com/wp/2009/03/02/contribuer-a-debian-gagner-un-livre/
[patch (text/plain, attachment)]

Tags added: patch Request was from Raphael Hertzog <hertzog@debian.org> to control@bugs.debian.org. (Mon, 22 Jun 2009 13:15:07 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#489006; Package grub-installer. (Sun, 11 Apr 2010 10:21:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sven Mueller <sven@incase.de>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. (Sun, 11 Apr 2010 10:21:03 GMT) Full text and rfc822 format available.

Message #42 received at 489006@bugs.debian.org (full text, mbox):

From: Sven Mueller <sven@incase.de>
To: 489006@bugs.debian.org
Subject: have /boot on md0 (dm-raid1), but install grub to MBRs of both disks?
Date: Sun, 11 Apr 2010 12:12:14 +0200
Well, Subject basically says what I try:

I want to have
/boot on /dev/md0 (raid1, sda1+sdb1)
/ on /dev/md1 (also raid1, sda5/sdb5
swap, non-critical data on lvm on /dev/md2 (raid0, sda6/sdb6)

The Debian installer easily lets me create such a layout, even using
preseeding. However, grub (both legacy and grub2) fail to generate a
device mapping for md0, thus being unable to install grub.

In my opinion such a partition layout should either be impossible to
create with d-i (or at least generate a warning) or grub-pc should
support this setup. Especially since this sort of partitioning is an
example in the partman-raid (or was it partman-lvm?) documentation. Not
exactly the way I described it, but with /root on lvm on raid.

Regards,
Sven




Merged 292513 489006. Request was from Miguel Figueiredo <elmig@debianpt.org> to control@bugs.debian.org. (Sat, 29 Jan 2011 14:57:07 GMT) Full text and rfc822 format available.

Forcibly Merged 252009 292513 310798 391489 489006 578338 582367. Request was from Miguel Figueiredo <elmig@debianpt.org> to control@bugs.debian.org. (Sat, 29 Jan 2011 17:00:06 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#489006; Package grub-installer. (Sat, 29 Jan 2011 22:36:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Miguel Figueiredo <elmig@debianpt.org>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. (Sat, 29 Jan 2011 22:36:06 GMT) Full text and rfc822 format available.

Message #51 received at 489006@bugs.debian.org (full text, mbox):

From: Miguel Figueiredo <elmig@debianpt.org>
To: 489006@bugs.debian.org
Cc: Raphael Hertzog <hertzog@debian.org>
Subject: #489006 debian-installer: After grub software raid installation, machine fails to boot with first drive removed or blanked
Date: Sat, 29 Jan 2011 22:33:25 +0000
[Message part 1 (text/plain, inline)]
Hi,

i've made a (very) slight modification to Raphael's patch so it can be applied 
against current grub-installer code.

So here it goes for review.


-- 
Melhores cumprimentos/Best regards,

Miguel Figueiredo
http://www.DebianPT.org
[md0_grub-installer.patch (text/x-patch, attachment)]

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sat Apr 19 10:26:18 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.