LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-11-2008, 09:58 AM   #1
garydale
Member
 
Registered: Feb 2007
Posts: 142

Rep: Reputation: 23
can /boot be on a software RAID5 array?


I'm running Debian/Lenny (testing) which has an up to date kernel, etc. I'm setting up my desktop to use software RAID 5 (replacing a 250G / and 500G /home drive with 3 x 500G drives). The new configuration will have / on a small RAID 5 array with /home on a larger RAID 5 array and 3 swap partitions (one on each physical drive).

At this point I ran into a stumbling block. I'd previously set up RAID 1 on systems and there was no real issue about /boot - it could be read on one drive or the other. From what I've been reading, it looks like Linux can't boot from a software RAID 5 array. However, I haven't seen this issue raised in any recent HOWTOs - just on old ones.

It seems cleaner to boot from a RAID 5 array. While I could set it up as a RAID 1 array, I'd only have the boot information on 2 drives, with some wasted space on the other. This could cause problems if a drive fails and the wrong drive ends up being the boot drive. Setting up /boot on each drive separately and rsync-ing them regularly also seems clumsy.

On the other hand, with RAID 5, I don't need a separate boot partition and all drives are equal when it comes to booting. However, I can't figure out to do a grub setup on a RAID 5 array. Grub seems to want to deal with physical disks that have a readable /boot on them.

Is there a way to boot from a software RAID 5 array?
 
Old 06-11-2008, 12:46 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
I've booted from hardware RAID5 easily, and grub had no problems with it. Never tried it with software, and not even sure you can do it, since you'd have to have some parts of the system up and loaded first, before you could bring the array online.

I'd spring for a hw RAID controller.
 
Old 06-11-2008, 01:15 PM   #3
garydale
Member
 
Registered: Feb 2007
Posts: 142

Original Poster
Rep: Reputation: 23
Hardware RAID is a different kettle of fish. The controller makes the array look like a hard drive, so it's basically the same as booting from a hard drive. Software RAID conceptually could be the same, providing that the RAID driver can be loaded. However, I'm not sure if it's do-able.

The problem with hardware RAID is the expense. RAID 5 controllers seem to start at a couple of hundred dollars and go up from there, without giving any better performance.
 
Old 06-11-2008, 01:19 PM   #4
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,851
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
You would need at least some way of loading the software for the array. I don't know if any of the "fakeraid" boards (or motherboard raid) do RAID 5; you can boot off of RAID 0 with those boards because of the BIOS support and they are a lot more affordable.
 
Old 06-11-2008, 03:56 PM   #5
garydale
Member
 
Registered: Feb 2007
Posts: 142

Original Poster
Rep: Reputation: 23
Yes, but RAID 0 and RAID 1 aren't RAID 5. With RAID 1 to RAID 5 you get s * (n - 1) amount of space (i.e. one less than the number of drives you allocate to the array provide storage space). With RAID 1, n is 2 so you lose half your space. With RAID 5 in a three drive array, you only lose a third of your space. I get 1,000G of usable storage with redundancy for the price of three smaller drives.

However, that extra drive means that you need to look at two drives to get the data.

As I said, there is no reason in principle why software RAID can't handle this. All it needs is to be able to load enough software to read the array. This is not substantially different from needing a driver to read the boot disk - you're just dealing with a different, more complex, device. Hey, you can boot from a USB key, can't you?
 
Old 06-11-2008, 05:02 PM   #6
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,851
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
Sorry that I wasn't clear. The reason I mentioned RAID 0, is that, like RAID 5, you have to read 2 disks to get your OS and array up. Unlike RAID 1, where you only need one disk. I am aware of different RAID levels.

The only way you can boot off RAID 5 or 0 or more than one device is with the help of the BIOS or another device supported by the BIOS. The USB key you mention is a good example. You can't boot from one unless either your BIOS supports that or you use a CD/floppy/harddisk to hold the boot manager to reference it. Fake RAID boards and the onboard versions on some motherboards provide BIOS extensions to allow booting off of RAID 0 devices. They are not true hardware RAID. I do not know if these relatively cheap devices ever support RAID 5, but there is no reason why they could not. However, mine does not. Mdadm can autobuild an array on the fly, but you have to be able to read the kernel first or read an initrd off the disk, which means you need the help of the BIOS or another boot device which can be read at boot time and is supported by the BIOS.

I suppose you could write a patch to grub to incorporate RAID 5 and have it installed on the MBR of all the disks, but as far as I know, no one has gotten that ambitious. There is a grub patch for dmraid for support of fakeraid, but, again, the fakeraid would have to support the RAID level you want.

Anyone else know any different?
 
Old 06-12-2008, 10:07 AM   #7
garydale
Member
 
Registered: Feb 2007
Posts: 142

Original Poster
Rep: Reputation: 23
The cheap boards don't support RAID 5. That's why they're cheap.

re. booting: I think the BIOS just has to let the boot loader get the first sector of the device. Most RAID boards, and even SATA and IDE controllers, need a driver to work.

Interestingly, I've even run across a case where I could start an install from a CD but not complete it because at some point in the install process, Linux stops using the BIOS and tries to load its own driver.

I guess I'm just going to have to add a non-RAID boot partition and use rsync to keep all three drives current (so any drive could be used to boot the system).
 
Old 06-12-2008, 10:23 AM   #8
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
Per the Gentoo docs no..

http://gentoo-wiki.com/Talk:HOWTO_Ge..._5_and_.2Fboot
 
Old 06-12-2008, 10:30 AM   #9
TwoFeathers
LQ Newbie
 
Registered: Jul 2007
Posts: 7

Rep: Reputation: 0
Software Raid

We did this with a Dell having 5 disks. We had root and boot mirrored on disk 0 and 1. Then, the remainder of these drives and an equal portion of the remaining 3 disks as software RAID5. The "pieces" unused on disks 2, 3, and 4 were used for swap.
 
Old 06-12-2008, 11:35 AM   #10
garydale
Member
 
Registered: Feb 2007
Posts: 142

Original Poster
Rep: Reputation: 23
Farslayer: That's an interesting suggestion they make - about setting up the /boot as RAID 1 across all the disks. I'd only heard of 2-disk RAID 1 before, but I suppose there is no reason why a 3-disk RAID 1 can't be done. It eliminates the need to sync the disks.

Thanks.
 
Old 06-12-2008, 11:42 AM   #11
garydale
Member
 
Registered: Feb 2007
Posts: 142

Original Poster
Rep: Reputation: 23
TwoFeathers: I'd thought about doing that too, but with a three disk RAID 5, it would have left me with just one swap partition. I've set mine up with the swap partitions separate (non-RAID), although I've seen a warning that this could lead to a problem if a swap partition becomes unavailable.

I'm not familiar enough with how Linux handles swapping to decide if it's a real problem or not. Have you any ideas on it?
 
Old 06-13-2008, 11:06 PM   #12
garydale
Member
 
Registered: Feb 2007
Posts: 142

Original Poster
Rep: Reputation: 23
Just to let people know how things worked out:

I have a 3-disk system currently running as follows:
/dev/md0 - 100M RAID 1 array for /boot
/dev/md1 - 820G RAID 5 array for /home
/dev/md2 - 90G RAID 5 array for /

plus 3 x 2G non-RAID partitions for swap.

Using 3 disks in a RAID 1 array for /boot was something I'd not considered, but it seems to work OK. Each drive has grub installed, so any of them can boot if needed.
 
Old 06-14-2008, 08:54 AM   #13
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
Thanks for the update !! Glad to see you got it working
 
  


Reply

Tags
boot, raid, software



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Raid5 array works but won't start on boot hazmatt20 Linux - Server 3 12-14-2007 01:28 AM
Removed RAID5 array and now no boot Child of Wonder Ubuntu 2 07-27-2007 09:58 PM
Want to move LVM installation to RAID5 array - how do I get it to boot? nethbar Linux - Software 0 05-29-2007 10:49 AM
RAID5 Array Recovery after OS upgrade hazmatt20 Linux - Server 25 04-19-2007 08:41 AM
Secure Deletion with RAID5 array neilschelly Linux - Security 2 12-05-2004 06:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration