LinuxQuestions.org
Help answer threads with 0 replies.
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 10-10-2008, 10:25 AM   #1
amitpardesi
LQ Newbie
 
Registered: Aug 2007
Posts: 13

Rep: Reputation: 0
Question Creating RAID 5 with 2 disks using mdadm


Hi,

I am using mdadm to emulate s/w raid on my system.

I am trying to create a RAID 5 configuration on my system. I have 4 disks, each of X GB, with me. I can create a raid 5 by the following command:

mdadm --create --level 5 --chunk 4 --raid-devices 3 --spare-devices 1 --run /dev/md0 /dev/sdb /dev/sdc /dev/sdd /dev/sde

The above command creates a perfect raid.

By the definition definition of RAID 5, it requires minimum of 3 disks (excluding spare disk) for its configuration. RAID-5 is nothing but RAID-0 with distributed block level parity.

Now, if I try to create RAID 5 with the following command:

mdadm --create --level 5 --chunk 4 --raid-devices 2 --run /dev/md0 /dev/sdb /dev/sdc

It still goes ahead and creates a RAID 5 with just two disks.

That means it is using one disk of writing data & other for parity. Is this right? Shouldn't mdadm fail, when we provide only 2 disks to create RAID-5?

Though it keeps intact other raid-5 configuration. Say, if I have spare disk & any one of the 2 disk is gone bad the spare disk is added to raid to maintain its clean status.

Just want to know whether mdadm should fail of not, while creating RAID-5 with 2 disk. If no, then the very definition of RAID-5 is contradicted.

Please comment.

Regards,
Amit
 
Old 10-10-2008, 10:40 AM   #2
shan_nathan
Member
 
Registered: Jun 2007
Location: India
Distribution: Redhat
Posts: 137

Rep: Reputation: 15
I think Raid 5 need minimum 3 disks. if any one fail it start write the parity in the memory. It is applicable for harware-raid controller while that time the performence will go down while you reboot again in the boot up again it will start to regenerate parity. i think for sw/raid also it's doing the same thing only.


Quote:
Originally Posted by amitpardesi View Post
Hi,

I am using mdadm to emulate s/w raid on my system.

I am trying to create a RAID 5 configuration on my system. I have 4 disks, each of X GB, with me. I can create a raid 5 by the following command:

mdadm --create --level 5 --chunk 4 --raid-devices 3 --spare-devices 1 --run /dev/md0 /dev/sdb /dev/sdc /dev/sdd /dev/sde

The above command creates a perfect raid.

By the definition definition of RAID 5, it requires minimum of 3 disks (excluding spare disk) for its configuration. RAID-5 is nothing but RAID-0 with distributed block level parity.

Now, if I try to create RAID 5 with the following command:

mdadm --create --level 5 --chunk 4 --raid-devices 2 --run /dev/md0 /dev/sdb /dev/sdc

It still goes ahead and creates a RAID 5 with just two disks.

That means it is using one disk of writing data & other for parity. Is this right? Shouldn't mdadm fail, when we provide only 2 disks to create RAID-5?

Though it keeps intact other raid-5 configuration. Say, if I have spare disk & any one of the 2 disk is gone bad the spare disk is added to raid to maintain its clean status.

Just want to know whether mdadm should fail of not, while creating RAID-5 with 2 disk. If no, then the very definition of RAID-5 is contradicted.

Please comment.

Regards,
Amit
 
Old 10-10-2008, 10:49 AM   #3
edgjerp
Member
 
Registered: Dec 2004
Location: Trondheim, Norway
Distribution: kubuntu 10.04
Posts: 308

Rep: Reputation: 31
In reality, the first command creates a raid 6 array, which does not really make sense when you have 4 drives total. if that setup gives you the space you need, it is probably safer to use raid10, for better redundancy. raid5 basically combines the speed of striping with the security of mirroring. unless your drives are old and likely to fail soon, (and if so, why do you use them for trusted storage) there is probably no need to keep a hot spare.


did you try to create a 2-disk raid5 array, or is it a question. my guess is that mdadm would either create a degraded 3-drive array or fail.
 
Old 10-10-2008, 10:51 AM   #4
farslayer
Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,232
Blog Entries: 5

Rep: Reputation: 189Reputation: 189
Not supposed to link to other forums, but this question and discussion has already taken place.
http://ubuntuforums.org/archive/index.php/t-566803.html

with only 2 drives you do NOT have a RAID 5 array, no matter whether mdadm complained or not.
If you want to have fault tolerance and only have 2 drives then setup a RAID 1 array.


According to the MAN page for mdadm.. http://man-wiki.net/index.php/8:mdadm
Quote:
Normally the array will be started after it is assembled. However if
--scan is not given and insufficient drives were listed to start a com-
plete (non-degraded) array, then the array is not started
(to guard
against usage errors). To insist that the array be started in this
case (as may work for RAID1, 4, 5 or 6), give the --run flag.
so no mdadm would not throw an error,
 
Old 10-12-2008, 01:54 AM   #5
amitpardesi
LQ Newbie
 
Registered: Aug 2007
Posts: 13

Original Poster
Rep: Reputation: 0
Thumbs up

Hi,

Thanks everyone for posting your thought with your valuable time.

I got the answer that I was looking for.

Special thanks to 'farslayer' for pointing out the ubuntu forams list where similar discussion has already taken place. This made the picture clearer for me.

Thanks once again.

Regards,
Amit
 
Old 10-12-2008, 08:33 PM   #6
dasy2k1
Member
 
Registered: Oct 2005
Location: 127.0.0.1
Distribution: Ubuntu 12.04 X86_64
Posts: 958

Rep: Reputation: 35
i use RAID5 rather than 10 on a 4 disk setup...

if each disk is 500GB (like mine) then RAID5 gives 1.5TB space where RAID10 gives 1TB
as im more instersted in the size avalable and speed increace that stripinfg gives but am not prepared with the one drive fails you loose everything aspect of RAID0
5 was the obvious choice at least that can withstand 1 of 4 failing without loss (but 2 failing kills the whole array) whereas with 10 one can fail, or 2 but not any 2
 
Old 10-13-2008, 12:02 AM   #7
farslayer
Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,232
Blog Entries: 5

Rep: Reputation: 189Reputation: 189
SQL recommends a RAID 10 Array for high performance databases because it outperforms RAID 5 for that application.
The RAID level you choose will depend on what you plan to use the array for.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Why can't I mount this md0 raid? (mdadm and software raid) cruiserparts Linux - Software 35 01-05-2013 04:35 PM
Using mdadm - Failed RAID-5 Array but individual disks check out ok JRFrogman Linux - Server 0 06-05-2008 03:46 PM
RAID mdadm - Sending E-Mails on RAID Failure? rootking Linux - General 1 12-25-2007 04:59 AM
mdadm error creating raid1 Ezplan Fedora 7 07-26-2007 11:35 AM
Change raid1-mdadm disks Debian Suhy Linux - Software 1 07-03-2006 04:48 PM


All times are GMT -5. The time now is 11:51 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration