Debian Bug report logs - #252009
LILO/GRUB problems when root is on RAID1

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: Martin Michlmayr <tbm@cyrius.com>

Date: Tue, 1 Jun 2004 02:33:02 UTC

Severity: normal

Tags: d-i, patch

Merged with 292513, 310798, 391489, 489006, 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, Paul Fleischer <proguy@proguy.dk>:
Bug#252009; Package mdcfg. Full text and rfc822 format available.

Acknowledgement sent to Martin Michlmayr <tbm@cyrius.com>:
New Bug report received and forwarded. Copy sent to Paul Fleischer <proguy@proguy.dk>. Full text and rfc822 format available.

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

From: Martin Michlmayr <tbm@cyrius.com>
To: submit@bugs.debian.org
Subject: LILO/GRUB problems when root is on RAID1
Date: Mon, 31 May 2004 23:26:51 -0300
Package: mdcfg

----- Forwarded message from Andrew Pollock <apollock@debian.org> -----

From: Andrew Pollock <apollock@debian.org>
Subject: Re: RAID1 install fails
Date: Tue, 1 Jun 2004 09:11:23 +1000
To: Martin Michlmayr <tbm@cyrius.com>
Cc: "W. Borgert" <debacle@debian.org>, debian-boot@lists.debian.org
User-Agent: Mutt/1.5.4i

On Mon, May 31, 2004 at 12:50:25PM -0300, Martin Michlmayr wrote:
> * W. Borgert <debacle@debian.org> [2004-05-31 12:13]:
> > GRUB message on vt3:
> > /dev/md0 does not have any corresponding BIOS drive.
> > 
> > LILO:
> > An installation step failed. (...)
> > failing step is: Install the LILO boot loader on a hard disk.
> 
> I don't know how to get LILO and GRUB to boot from RAID.  I thought it
> might just work... anyone got a good idea?

Bulk hackery, that's how.

See http://lists.debian.org/debian-boot/2004/05/msg03665.html

This worked for me insofar as I got GRUB to install, but I didn't seem to
have a menu.lst, despite the above saying I should have. I had to do further
hackery at a grub prompt along the lines of:

root (hd0,0)
kernel /vmlinuz ro root=/dev/md0 md=0,/dev/foo,/dev/bar
initrd /initrd.img
boot

where /dev/foo (and optionally /dev/bar) were the members of my /dev/md0.
(Optional, as in my case, I was trying to build a degraded RAID1).
If you have an md1, add "1,/dev/baz,/dev/blaz" to the above incantation.

Once I managed to boot into the sucker, I recreated my initrd for good
measure, and ran update-grub, and it built a menu for me. It wasn't for the
faint of heart at all.

HTH

Andrew


-- 
To UNSUBSCRIBE, email to debian-boot-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

----- End forwarded message -----

-- 
Martin Michlmayr
tbm@cyrius.com



Information forwarded to debian-bugs-dist@lists.debian.org, Paul Fleischer <proguy@proguy.dk>:
Bug#252009; Package mdcfg. Full text and rfc822 format available.

Acknowledgement sent to Martin Michlmayr <tbm@cyrius.com>:
Extra info received and forwarded to list. Copy sent to Paul Fleischer <proguy@proguy.dk>. Full text and rfc822 format available.

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

From: Martin Michlmayr <tbm@cyrius.com>
To: 252009@bugs.debian.org
Subject: [faj@bzz.no: Re: RAID1 install fails]
Date: Thu, 10 Jun 2004 20:33:47 +0100
----- Forwarded message from Finn-Arne Johansen <faj@bzz.no> -----

From: Finn-Arne Johansen <faj@bzz.no>
Subject: Re: RAID1 install fails
Date: Thu, 3 Jun 2004 22:24:06 +0200
To: debian-boot@lists.debian.org
User-Agent: Mutt/1.5.5.1+cvs20040105i

On Mon, May 31, 2004 at 12:50:25PM -0300, Martin Michlmayr wrote:
> * W. Borgert <debacle@debian.org> [2004-05-31 12:13]:
> > GRUB message on vt3:
> > /dev/md0 does not have any corresponding BIOS drive.
> > LILO:
> > An installation step failed. (...)
> > failing step is: Install the LILO boot loader on a hard disk.
> I don't know how to get LILO and GRUB to boot from RAID.  I thought it
> might just work... anyone got a good idea?

When I set up raid, (I always to that after the installation), I edit
the menu.lst manually, and changes /etc/kernel-img.conf to not run
postinstall/prerm-hooks, but to place symlinks in /boot instead

Then I make sure that to create symlinks for the already existing
kernel-images. 

for more info, please see
http://developer.skolelinux.no/dokumentasjon/skolelinux_softwareraid_howto.txt


-- 
Finn-Arne Johansen 
faj@bzz.no
http://bzz.no/


-- 
To UNSUBSCRIBE, email to debian-boot-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

----- End forwarded message -----

-- 
Martin Michlmayr
tbm@cyrius.com



Information forwarded to debian-bugs-dist@lists.debian.org, Paul Fleischer <proguy@proguy.dk>:
Bug#252009; Package mdcfg. Full text and rfc822 format available.

Acknowledgement sent to Martin Michlmayr <tbm@cyrius.com>:
Extra info received and forwarded to list. Copy sent to Paul Fleischer <proguy@proguy.dk>. Full text and rfc822 format available.

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

From: Martin Michlmayr <tbm@cyrius.com>
To: 252009@bugs.debian.org
Subject: [faj@bzz.no: Re: RAID1 on / planned?]
Date: Mon, 14 Jun 2004 23:32:11 +0100
----- Forwarded message from Finn-Arne Johansen <faj@bzz.no> -----

From: Finn-Arne Johansen <faj@bzz.no>
Subject: Re: RAID1 on / planned?
Date: Mon, 14 Jun 2004 23:42:32 +0200
To: Martin Michlmayr <tbm@cyrius.com>,
	Charles Steinkuehler <charles@steinkuehler.net>,
	debian-boot@lists.debian.org
User-Agent: Mutt/1.5.5.1+cvs20040105i
X-Spam-Status: No, hits=-2.2 required=5.0 tests=BAYES_00,RCVD_IN_DYNABLOCK,
	RCVD_IN_SORBS autolearn=no version=2.63

On Mon, Jun 14, 2004 at 09:51:51PM +1000, Andrew Pollock wrote:
> On Sun, Jun 13, 2004 at 02:49:26PM +0100, Martin Michlmayr wrote:
> > * Charles Steinkuehler <charles@steinkuehler.net> [2004-06-11 14:45]:
> > > I'm pretty handy with shell scripting, and could probably come up with a 
> > > fix to the grub stuff (espeically with the nice auto-detect stuff in 
> > > mkinitrd already working!), if that would be of assistance.
> > 
> > It would be good if you could find out why LILO and GRUB fail in the
> > first place instead of being able to cope with the situation.  Then we
> > can figure out whether we need to put in a workaround or whether
> > LILO/GRUB should just get fixed.
> 
> I'll look into it more closely after exams (if it isn't sorted by then) but
> I think in the case of GRUB (from what I've read wrt the hacks to get it to
> work) it's because /dev/md/0 doesn't correspond to a BIOS device.
> 
> I get the general impression that GRUB, whilst a very cool bootloader, is a
> bit rough around the edges when you want to do some of the more esoteric
> stuff...

I dont know if this applies to other architecures than i386, but here is what I done to successfully install on SWRaid: 

Boot in expert mode

Load the following components: 
  autopartkit
  eject-udeb
  lvmcfg
  mdcfg

create partitions: 
  some small for / ( I choose 256-512 MB ) 
  this is the first partion on two disks
  use the rest of the two disks as lvm, on logical partitions
  all 4 partitions should be set up to be used as raid devices

  Then continue to set up the partitions as softwareraid
  the two smaller primary partions as one raid set, 
  and the two larger as another. 

  Then to set up LVM, I need to switch to a terminal (Alt+F2)
  and do 
   pvcreate /dev/md/1
   vgcreate vg_raid /dev/md/1

  Then I switch back and creates three logical volumes
   lv_usr, lv_var, and lv_swap
  And format and mount the partitions

Install the Basesystem
  but before the installation of the kernel, switch to a terminal again
  (Alt+F2), and do a:
    chroot /target apt-get install mdadm

  Then switch back and install the kernel

Installation of grub: 
  The "grub-install", and "update-grub" both have problems with swraid
  root partition.
  The workaround is simple (again in a terminal):
    chroot /target 
     apt-get install grub
     mkdir /boot/grub/
     cp /usr/lib/grub/i386_pc/stage[12] /boot/grub
     cp /usr/lib/grub/i386_pc/*stage1_5 /boot/grub
     grub --no-floppy
      root (hd0,0)
      setup (hd0)
      quit
     exit

then "continue without bootloader"
and finnish the installation and reboot

When the installation reboots, you enter
 root (hd0,0)
 kernel /vmlinuz root=/dev/md0 ro
 initrd /initrd.img
 boot

Then you may continue with the second stage installer

What's missing for this to be easy: 
It would be nice if we could set up lvm on top of raid1 without the
need for switching to the console, and creating the physical volume,
and the volume group manually.
It would be nice if mdadm was installed before the kernel was to be
installed. 

The last caveat is the setup of grub. I'll try to look at that one. 

-- 
Finn-Arne Johansen 
faj@bzz.no
http://bzz.no/

----- End forwarded message -----

-- 
Martin Michlmayr
tbm@cyrius.com



Bug reassigned from package 'mdcfg' to 'grub-installer'. Request was from Miguel Figueiredo <elmig@debianpt.org> to control@bugs.debian.org. (Sat, 29 Jan 2011 16:33:10 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:05 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Apr 17 19:44:46 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.