Linux Software Raid Explanation

fixx

Well-Known Member
Joined
Feb 13, 2006
Messages
288
Reaction score
7
Location
South Africa
Hi Guys

I just need some expert advice with Linux Software RAID 5. I bought an Intel desktop board a while back with fake-rade controller onboard. I used 4 old 1TB drives and it crashed today.

The machine was running CentOS 6.2 and had an NFS export which was used by a Xen server for its storage to store the virtual machines on.

I now want to use the same hardware with 4 x 2TB hard drives and let Linux handle the raid 5 volume.

What I want to know, when one of the drives break down, how easy is it to get the server to boot again? And to replace the broken drive and merge the raid volume with a new hard drive.
Is there anything specific when it comes to the location of the boot partition etc etc?

Yes, I know, I should rather buy a proper server with hardware RAID I have heard the stories before. All I need is an answer to the above.

Thanks
 
Well for me its pretty simple but it can break in a big way and you sometimes really need to know what you are doing.

Normally its a command to mark the raid as bad, then a command to remove it from the raid. Power down the machine. Replace drive, boot up, add new drive to the raid... and it automatically rebuilds. The commands are pretty simple: http://www.ducea.com/2009/03/08/mdadm-cheat-sheet/

If you are just using this as a fileserver have you thought about FreeNAS? It comes with a nice gui for people unfamiliar with mdadm commands :D

Also, I prefer RaidZ over Raid5.
 
Well theoretically you'd stick the new drive in and it would begin rebuilding,but sometimes crap happens
In a 4 disk RAID5 dependant on what made the drive/array bog out you should be able to rebuild relatively easy,only problem is while rebuilding if a second drive failure happens your array is toasted
Cost vs Integrity you should rather go RAID10
 
Well for me its pretty simple but it can break in a big way and you sometimes really need to know what you are doing.

Normally its a command to mark the raid as bad, then a command to remove it from the raid. Power down the machine. Replace drive, boot up, add new drive to the raid... and it automatically rebuilds. The commands are pretty simple: http://www.ducea.com/2009/03/08/mdadm-cheat-sheet/

If you are just using this as a fileserver have you thought about FreeNAS? It comes with a nice gui for people unfamiliar with mdadm commands :D

Also, I prefer RaidZ over Raid5.

Lol. In before me :D
 
Linux can;t boot off a software raid5 drive sadly, so your boot partition will still need to be a raid1 or raid10 even, then the data partition can be a raid5.

OpenIndiana on the other hand can boot off a raidz or raidz2. I prefer raidz2, because you can then lose up to 2 drives before the raid fail. Also what I love love love about zfs, is your data is online while you do a disk check, as opposed to offline on non-zfs.
 
Linux can;t boot off a software raid5 drive sadly, so your boot partition will still need to be a raid1 or raid10 even, then the data partition can be a raid5.

OpenIndiana on the other hand can boot off a raidz or raidz2. I prefer raidz2, because you can then lose up to 2 drives before the raid fail. Also what I love love love about zfs, is your data is online while you do a disk check, as opposed to offline on non-zfs.

Since when cant it boot off a software raid5? I have a few boxes setup like that.
 
Since when cant it boot off a software raid5? I have a few boxes setup like that.
It is a well know fact. Your /boot is probably not on the software raid5.

Edit: Looks like grub2 (pre grub2 and lilo cant boot off software raid5) can actually boot off a software raid5, I've obviously used raid arrays for much longer than grub2 is old, and since I have not looked at it since going zfs it is something I obviously missed.
 
Last edited:
It seems that some are getting confused by the different types of raid that are available. You essentially get 3 types:

1) Hardware RAID - a physical separate controller in your system which the drives plug into handles the creation and management of your RAID. It transforms the array of drives into Logical drives and reports those to the BIOS as physical drives.

2) Fake RAID. This is where you enable the RAID setting in your computer's BIOS (as opposed to IDE or AHCI). For all intents and purposes it acts exactly like hardware RAID, as in it has its own BIOS for creating and managing your drives and setting up the RAID array. Your OS needs specific driver support for this fake RAID chipset else it will see the individual drives instead of recognising the array.

3) Software RAID. This gets handled entirely by your OS and uses raid management utilities such as mdadm (as mentioned in ghoti's post). There is no reason not to use this RAID type as it works incredibly well and if I ever have a choice between fake raid and software, I will opt for software.

The OP is using mode 2 from my list, therefor removing a bad drive from the array is as simple as powering down the machine (unless you want to take your chances with hotplugging?) booting up and going into the fake raid BIOS and making sure it picks up the new drive and rebuilds the array.



edit: As an aside, I would highly recommend _against_ RAID5 on any drives bigger than 500GB. Firstly your chances of getting a URE increase exponentially when drive sizes increase ( http://www.zdnet.com/blog/storage/why-raid-5-stops-working-in-2009/162 ) and you're actually asking for trouble by using RAID5 these days. Do yourself a favour and stick with RAID1 or RAID10 if you have the spare drives. Not only will you gain performance with RAID10 but your array can suffer from a theoretical 2 drive failures as opposed to RAID5's 1 drive failure. If you're stubborn and feel that you sleep better at night with parity then go with RAID6.
 
Last edited:
Top
Sign up to the MyBroadband newsletter
X