linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RE: Booting from a raid1 device ?
@ 2003-10-27 21:14 Cress, Andrew R
  2003-10-30  0:54 ` Michael Tokarev
  0 siblings, 1 reply; 18+ messages in thread
From: Cress, Andrew R @ 2003-10-27 21:14 UTC (permalink / raw)
  To: donj; +Cc: linux-raid

Don,

Yes, it certainly can be done.  I do it all the time.

It's not hard with lilo, but grub doesn't support raid/md boot devices
yet.  This means that the grub boot record doesn't automatically get
written to the second disk.  In short, choose lilo for root mirroring if
possible.

The procedure is simplest if you use the distro installer to configure
it, but an existing installation can also be converted to root mirror
(raid1).  
See http://www.tldp.org/HOWTO/Software-RAID-HOWTO-4.html  (sections 4.11
thru 4.14)
or http://scsirastools.sourceforge.net/docs/UserGuide (section 4.0)

The md module MUST be staticly linked, not a module
(CONFIG_BLK_DEV_MD=y).  The other pieces (raid1.o, etc.) can be modules
if included in the initrd image.  The partitions should be marked as
raid autodetect type (0xfd).  

To be fully redundant, the '/boot', '/' and swap partitions should each
be mirrored.

Andy

-----Original Message-----
From: linux-raid-owner@vger.kernel.org
[mailto:linux-raid-owner@vger.kernel.org] On Behalf Of Paul Clements
Sent: Monday, October 27, 2003 11:01 AM
To: donj@asaca.com
Cc: linux-raid@vger.kernel.org
Subject: Re: Booting from a raid1 device ?


Don Jessup wrote:
> 
>   Is it possible to boot from a raid1 device with the md.o built as a
>  2.4.22 kernel module?

Yes, but it's tricky. You'd have to load md.o and raid1.o in your initrd
(or other early boot time initialization) and then use some, e.g.,
statically-linked mdadm tool on that initrd to start the array. You
cannot, however, use md's RAID autodetect to autostart arrays that have
their component partitions marked as RAID autodetect (0xfd), if md is a
module.

--
Paul


> =====
> Don Jessup
> Asaca/Shibasoku Corp. of America
> 400 Corporate Circle, Unit G
> Golden, CO  80401
> 303-278-1111 X232
> donj@asaca.com
> http://www.asaca.com
> -
> To unsubscribe from this list: send the line "unsubscribe linux-raid"
in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread
* RE: Booting from a raid1 device ?
@ 2003-10-30 15:22 Cress, Andrew R
  0 siblings, 0 replies; 18+ messages in thread
From: Cress, Andrew R @ 2003-10-30 15:22 UTC (permalink / raw)
  To: Michael Tokarev; +Cc: linux-raid

Michael,

I think we agree, but do remember that the 'lifetime of the disk' is the
real question here, and the whole reason we are doing mirroring anyway.
When the disk fails and is swapped out with a replacement, the MBR also
has to be rewritten then, and we want that to be as automatic as
possible.

Andy

-----Original Message-----
From: Michael Tokarev [mailto:mjt@tls.msk.ru] 
Sent: Thursday, October 30, 2003 9:27 AM
To: Cress, Andrew R
Cc: donj@asaca.com; linux-raid@vger.kernel.org
Subject: Re: Booting from a raid1 device ?


[...snip...]

> You have to also have a working MBR on the redundant disk as well, or
> you'll never get to the loader if the first disk really fails.
Usually
> it is the loader's responsibility to set up (or at least verify) the
> MBR.  

Well.. not really.  Sure, working MBR should be on all disks involved.
But it is necessary to set it up only once on every disk, and forgot
about it.  "Standard" MBR that comes with MS-DOS, or any other similar
MBR code will work, and there's no reason to touch it during the whole
lifetime of the disk.

[...snip...]

^ permalink raw reply	[flat|nested] 18+ messages in thread
* RE: Booting from a raid1 device ?
@ 2003-10-30 14:11 Cress, Andrew R
  2003-10-30 14:26 ` Michael Tokarev
  0 siblings, 1 reply; 18+ messages in thread
From: Cress, Andrew R @ 2003-10-30 14:11 UTC (permalink / raw)
  To: Michael Tokarev; +Cc: donj, linux-raid

Michael,

If you only have an MBR on the first disk, and it fails, your system
will not boot, since BIOS won't be able to read an MBR from the
redundant disk (the only working one).  You may be thinking of a use
case in which the first disk has a corrupted partition, but its MBR is
intact.

You have to also have a working MBR on the redundant disk as well, or
you'll never get to the loader if the first disk really fails.  Usually
it is the loader's responsibility to set up (or at least verify) the
MBR.  

Andy

-----Original Message-----
From: Michael Tokarev [mailto:mjt@tls.msk.ru] 
Sent: Wednesday, October 29, 2003 7:55 PM
To: Cress, Andrew R
Cc: donj@asaca.com; linux-raid@vger.kernel.org
Subject: Re: Booting from a raid1 device ?


Cress, Andrew R wrote:
> Don,
> 
> Yes, it certainly can be done.  I do it all the time.
> 
> It's not hard with lilo, but grub doesn't support raid/md boot devices
> yet.  This means that the grub boot record doesn't automatically get
> written to the second disk.  In short, choose lilo for root mirroring
if
> possible.

Ugh-blah.  Excuse me folks, but.. maybe someone will be able to
answer this one:

  why the hell a boot loader should "mirror" anything to the second
disk? :)

That is.  Place standard MBR into the boot sector.  An MBR that will
boot
from active partition.  Be it e.g. /dev/hda and /dev/hdb.  Create raid1
device from /dev/hda1 and /dev/hdb1.  Mark both partitions as active.
And install whatever boot loader you want into /dev/md1 - it will be
mirrored automatically to /dev/hda1 and /dev/hdb1 (and to whatever else
disks you'll use).

Should your first disk fail, the system will either not boot because
of bios limitations, or bios may "remap" /dev/hdb into /dev/hda (to
be 0x80), and in this case boot procedure will work.

Well, ok, a boot loader should be able to determine real offsets from
the start of the disk, not from the start of raid device.  I don't
know whenever grub can do that - lilo apparently does, as all our
systems are set up exactly this way...

/mjt


^ permalink raw reply	[flat|nested] 18+ messages in thread
* RE: Booting from a raid1 device ?
@ 2003-10-29 15:50 Cress, Andrew R
  2003-10-31 14:41 ` Eric Wood
  0 siblings, 1 reply; 18+ messages in thread
From: Cress, Andrew R @ 2003-10-29 15:50 UTC (permalink / raw)
  To: Sandro Dentella, linux-raid

Sandro,

From within grub, you can do
> install (hd0,0)/grub/stage1 (hd1) (hd1,0)/grub/stage2
(hd0,0)/grub/menu.lst
to write the boot sector from hd0 to hd1 without a floppy.  

However, you will need to do this again to any replacement disks added
to the raid-1, and if the primary disk's boot info gets corrupted, grub
won't automatically switch to the mirror/secondary, you'll have to
physically remove the corrupted disk.  

Does anybody know if/when the grub project will add raid support?  

Andy

-----Original Message-----
From: linux-raid-owner@vger.kernel.org
[mailto:linux-raid-owner@vger.kernel.org] On Behalf Of Sandro Dentella
Sent: Tuesday, October 28, 2003 3:31 PM
To: linux-raid@vger.kernel.org
Subject: Re: Booting from a raid1 device ?


On Tue, Oct 28, 2003 at 11:56:44AM +0100, Lars Marowsky-Bree wrote:
> On 2003-10-27T23:11:19,
>    Hermann Himmelbauer <dusty@strike.wu-wien.ac.at> said:
> 
>>BTW, assuming I have md.o not as module but statically in the kernel,
which
>>bootloader would support RAID1? I heard LlLO does this job but does
also grub
>>- which I prefer - support Linux SW-RAID1?
> 
> grub doesn't yet afaik.

What does this exactly mean. I always use GRUB for Raid1 setup with boot
partition an md device, and I'm beginning to think I'm using it the
wrong
way!

What I do is I 'setup' the partitios from a floppy:

title Install GRUB into (hd0,0) the first disk
root    (hd0,0)
setup   (hd0)
 
title Install GRUB into (hd1,0) the second disk
root    (hd1,0)
setup   (hd1)


Both partitions (hd0,0) and (hd1,0) are part of /dev/md/0

At that point I'm able to start from both devices... BTW I've never been
able to do that w/o passing from a floppy. If I do that from the CD I
use to
install everithing seems OK but it doesn't boot.


-- 
Sandro Dentella  *:-)
e-mail: sandro.dentella@tin.it 
http://www.tksql.org                    TkSQL Home page - My GPL work
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread
* Booting from a raid1 device ?
@ 2003-10-27 15:25 Don Jessup
  2003-10-27 15:37 ` Gordon Henderson
  2003-10-27 16:00 ` Paul Clements
  0 siblings, 2 replies; 18+ messages in thread
From: Don Jessup @ 2003-10-27 15:25 UTC (permalink / raw)
  To: linux-raid



  Is it possible to boot from a raid1 device with the md.o built as a 
 2.4.22 kernel module?  




=====
Don Jessup
Asaca/Shibasoku Corp. of America
400 Corporate Circle, Unit G
Golden, CO  80401
303-278-1111 X232
donj@asaca.com
http://www.asaca.com

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2003-10-31 17:40 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-27 21:14 Booting from a raid1 device ? Cress, Andrew R
2003-10-30  0:54 ` Michael Tokarev
2003-10-30 10:00   ` Lars Marowsky-Bree
2003-10-31  8:28   ` Luca Berra
2003-10-31 17:40     ` Bill Rugolsky Jr.
  -- strict thread matches above, loose matches on Subject: below --
2003-10-30 15:22 Cress, Andrew R
2003-10-30 14:11 Cress, Andrew R
2003-10-30 14:26 ` Michael Tokarev
2003-10-29 15:50 Cress, Andrew R
2003-10-31 14:41 ` Eric Wood
2003-10-27 15:25 Don Jessup
2003-10-27 15:37 ` Gordon Henderson
2003-10-27 16:00 ` Paul Clements
2003-10-27 22:11   ` Hermann Himmelbauer
2003-10-27 23:02     ` maarten van den Berg
2003-10-28 10:56     ` Lars Marowsky-Bree
2003-10-28 16:23       ` Michael
2003-10-28 20:31       ` Sandro Dentella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).