Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Software RAID-5 and Grub
View unanswered posts
View posts from last 24 hours

Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message

Joined: 17 Nov 2002
Posts: 1

PostPosted: Sun Nov 17, 2002 8:36 pm    Post subject: Software RAID-5 and Grub Reply with quote

Here are some notes on setting up software RAID-5 on the boot drive(s) of a system using EVMS and getting grub to play nicely with it.

I don't make any representations that any of this is safe. Use it at your own risk. I have yet to go through a test cycle to ensure that these RAID configurations actually work and save any data. It is quite possible that the complete destruction of the data on all of your systems, VCRs and televisions could result from following any suggestions here.

Intro and notes on EVMS

EVMS is a powerful tool for setting up software RAID partitions. It is an excercise for the reader to figure out how to use the EVSM tools, but Daniel Robbins is currently part way through a series on the topic that should be very helpful. Some notes are:

a. If you are setting up a server, avoid the evmsgui in favor of the non-graphical evmsn. evmsn has got quirks, but is perfectly usable and avoids the usually inappropriate seutp of xfree86 on a server system.

b. RAID-5 requires a minimum of three drives, and I'm basing my instructions on this number.

1. Don't make the boot partition RAID-5, instead use RAID-1

Grub won't be able to handle the boot partition as RAID-5. The solution is to set aside boot partition space on all three systems and then create a RAID-1 region (mirrored) on drive 0 and 1, then optionally select drive 2 as the spare. This ensures that hd0 and hd1 always have an up to date copy of the boot partition.

2. It works to setup SWAP partitions as RAID-5

However, I'm not sure whether it is recommended to do it. I'm sure there is a slight performance hit compared to RAID-1 mirroring. It does work fine though and gives more effective swap space than simple mirroring. So I'm going with it for now (comments are appreciated)

3. Setup fstab to point to evms devices


/dev/evms/boot     /boot      ext3     noauto,noatime 1 1
/dev/evms/usr      /          reiserfs noatime 0 0
/dev/evms/swap     none       swap     sw 0 0

4. Setup grub to initialize both hd0 and hd1



grub> root(hd0,0)
grub> setup (hd0)
grub> root(hd1,0)
grub> setup (hd1)
grub> quit

5. Setup grub.conf to give both hd0 and hd1 boot option


# vim /boot/grub/grub.conf


title=HD0 Current
root (hd0,0)
kernel /boot/bzImage root=/dev/evms/usr

title=HD1 Current (backup)
root (hd1,0)
kernel /bzImage root=/dev/evms/usr

Question: Is it really worth putting the hd1,0 choice in grub.conf? As far as I can tell, you will never have an option to select this if hd0,0 is having problems. I think instead that if hd0 fails and you reboot then you'll end up with a grub > prompt and have to manually set grub to use hd1,0 like follows:


grub> root (hd1,0)
grub> kernel /boot/bzImage root=/dev/evms/usr
grub> boot

Is that right? If so, it is really not so bad, just a little less convenient. Anyone know?

Any comments or notes on these instructions is appreciated.
Back to top
View user's profile Send private message

Joined: 18 Feb 2004
Posts: 183
Location: A giant shoe

PostPosted: Tue Jun 06, 2006 6:14 pm    Post subject: Reply with quote

That should work well. It's a little easier, anyway.
Sometimes you feel like a nut, sometimes you don't
Gentoo Forum Member #43303

Yoda of Borg are we: Futile is resistance. Assimilate you, we will.
Back to top
View user's profile Send private message

Joined: 31 Dec 2004
Posts: 24

PostPosted: Wed Nov 15, 2006 5:42 am    Post subject: Reply with quote

Solution to the grub prompt:

# grub
grub> root (hd0,0)
grub> setup (hd1)
grub> quit

That'll install grub to the MBR of the second disk, and if the first disk fails, grub will think that the second disk IS the first disk. That eliminates the need for the second entry.
That which we do not ask will never be learned
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum