LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-15-2009, 01:57 PM   #1
wsduvall
Member
 
Registered: Aug 2006
Posts: 92

Rep: Reputation: 16
Software RAID5 question


Hey guys,

I've done software RAID0 and RAID1 on my webserver before, but now I'm setting up a fileserver with RAID 5. When creating my software RAID, I get the following output:

Code:
raid5: raid level 5 set md1 active with 2 our of 3 device, algorithm 2
mdadm: /dev/md1 has been started with 2 drives (out of 3) and 1 spare.
Is that correct? Shouldn't it start with 3 drives? I only have 3 drives and I though that was the minimum for RAID5 (and this only appears to be using 2...).

The array is 3 1TB SATA drives, and the RAID5 array does regester as being 1.8TB, so I'm not really sure what to think. Is what I got above normal? Any help for the RAID5 noob would be appreciated!
 
Old 03-15-2009, 02:03 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,646

Rep: Reputation: 7969Reputation: 7969Reputation: 7969Reputation: 7969Reputation: 7969Reputation: 7969Reputation: 7969Reputation: 7969Reputation: 7969Reputation: 7969Reputation: 7969
Quote:
Originally Posted by wsduvall View Post
Hey guys,

I've done software RAID0 and RAID1 on my webserver before, but now I'm setting up a fileserver with RAID 5. When creating my software RAID, I get the following output:

Code:
raid5: raid level 5 set md1 active with 2 our of 3 device, algorithm 2
mdadm: /dev/md1 has been started with 2 drives (out of 3) and 1 spare.
Is that correct? Shouldn't it start with 3 drives? I only have 3 drives and I though that was the minimum for RAID5 (and this only appears to be using 2...).

The array is 3 1TB SATA drives, and the RAID5 array does regester as being 1.8TB, so I'm not really sure what to think. Is what I got above normal? Any help for the RAID5 noob would be appreciated!
As a rule, RAID5 puts disks into an array, with one drive kept as an online spare. If one of the disks in the array fails, the online spare will spin up, and the array keeps going. When you replace the failed drive, the array will stripe the data back to the new primary unit, and take the spare back offline, ready for the next failure.
 
Old 03-15-2009, 06:36 PM   #3
wsduvall
Member
 
Registered: Aug 2006
Posts: 92

Original Poster
Rep: Reputation: 16
I always though one disk held the parity bits while the others held the data. Is that what the 'spare disk' is?
 
Old 03-15-2009, 06:44 PM   #4
okcomputer44
Member
 
Registered: Jun 2008
Location: /home/laz
Distribution: CentOS/Debian
Posts: 246

Rep: Reputation: 53
Quote:
Originally Posted by wsduvall View Post
I only have 3 drives and I though that was the minimum for RAID5 (and this only appears to be using 2...).
Yes it must have minimum three drive.

If your box can't start all three it means that the third drive data build up from the another two.

So check the configuration cause something is wrong.
When you setup a raid 5 and you have more than 3 disk the raid software or hardware whatever, will ask you that "do you want to put the last disk into a spare disk?" or something like that.

So this was not a choice in your case because you don't have 4 or more disk.

You can have a look the configuration here:

http://en.wikipedia.org/wiki/RAID_5#RAID_5

Anyway if it is a test box try to build up the raid 5 again cause something is wrong with it.

This is a good article about software raid just take a look at it:

http://tldp.org/HOWTO/Software-RAID-HOWTO.html


Laz.
 
Old 03-15-2009, 07:02 PM   #5
okcomputer44
Member
 
Registered: Jun 2008
Location: /home/laz
Distribution: CentOS/Debian
Posts: 246

Rep: Reputation: 53
Quote:
Originally Posted by wsduvall View Post
I always though one disk held the parity bits while the others held the data. Is that what the 'spare disk' is?
No, the spare disk is just for the case when a disk from the array goes down. When this occur the spare disk will spin up then will start build up the array from the another disks.

All disks contain the parity and the data too.

Laz.
 
Old 03-15-2009, 08:22 PM   #6
wsduvall
Member
 
Registered: Aug 2006
Posts: 92

Original Poster
Rep: Reputation: 16
Ok, thanks for bearing with me. I just have one more question. I though that RAID5 required a minimum of 3 disk. So why do I have a spare?

@okcomputer44's first post

I was never asked... I simply executed the command:

Code:
mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/sda4 /dev/sdb4 /dev/sdc4
I don't think it should even be able to build a RAID5 without three disk... which is why I'm so curious... I'm going to way for it to finish generatin the RAID and see what happens. I might simulate a failure by unhooking one of the disk (I could try this on all disk...) and see if I can recover the RAID. If I'm not getting the security I need, the I might as well have a 3TB RAID0...

I also just got some more info...

Code:
mdadm --misc --detail /dev/md0
...
Number  Major Minor RaidDevice State
0       8     4     0          active sync /dev/sda4
1       8     20    1          active sync /dev/sdb4
3       8     36    2          spare rebuilding
Its 67% done, so I'm hoping to have more info tomorrow. Thanks guys for the help!

Last edited by wsduvall; 03-15-2009 at 09:04 PM.
 
  


Reply



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
Software RAID5 - beware! Micro420 Ubuntu 7 05-20-2008 05:52 AM
Software RAID5 Difficulties jsaxton86 Linux - Software 1 05-12-2007 11:58 AM
Software Raid5 wierdness Trionnis Linux - Software 2 05-02-2007 12:16 AM
Software RAID5 disasters Hamsjael Linux - Hardware 8 06-15-2005 04:05 AM
adding new hd in raid5 software slack66 Linux - Hardware 1 08-27-2003 12:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:46 PM.

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