You are not logged in.

#1 2015-12-02 22:21:06

maggie
Member
Registered: 2011-02-12
Posts: 255

RAID5 with 3 disks confusion [solved]

I would like to build a mdadm raid5 using 3 HDDs. I am confused about some of the switches shown on the wiki about creating it since there are only 2 examples and the RAID5 example shows a 4 drive setup. It shows this.

mdadm --create --verbose --level=5 --metadata=1.2 --chunk=256 --raid-devices=4 /dev/md0 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1 --spare-devices=1 /dev/sdf1

Question1)
For my case with 3 drives, should I use --raid-devices=3 --spare-devices=1 or do I want --raid-devices=2 --spare-devices=1
Sorry if this is a stupid question.

Question2)
The wiki also shows Stride and Stripe-width calculations that I don't understand. Where did the chunk size of 512 given on the page come from?

Question3)
Related to Stride and Stripe. In my 3 drive system, the stripe-width should be # of data disks times stride. Is that 2 data disks for me?

Last edited by maggie (2015-12-03 20:30:51)

Offline

#2 2015-12-02 22:30:15

frostschutz
Member
Registered: 2013-11-15
Posts: 1,499

Re: RAID5 with 3 disks confusion [solved]

The example you are showing is a 5 drive setup (sdb1, sdc1, sdd1, sde1 as 4 raid disks, sdf1 as spare disk). If you use raid-devices=2 it's essentially raid 1, not raid 5.

Personally I do not like raid5+spare setups. If you have an extra disk, you can just as well go for raid6 directly and enjoy double redundancy, rather than hope the spare will manage to sync when it's finally supposed to kick in.

Stride and stripe width you can pretty much ignore. Those optimizations make little difference and if you ever grow your raid the values will be off anyway.

Last edited by frostschutz (2015-12-02 22:30:48)

Offline

#3 2015-12-02 22:34:15

maggie
Member
Registered: 2011-02-12
Posts: 255

Re: RAID5 with 3 disks confusion [solved]

frostschutz wrote:

The example you are showing is a 5 drive setup (sdb1, sdc1, sdd1, sde1 as 4 raid disks, sdf1 as spare disk). If you use raid-devices=2 it's essentially raid 1, not raid 5.

Let me backup. I have only 3 drives, sdb sdc and sdd. For raid5, should I define
a) --raid-devices=3 --spare-devices=1
or
b) --raid-devices=2 --spare-devices=1

Offline

#4 2015-12-02 22:40:29

frostschutz
Member
Registered: 2013-11-15
Posts: 1,499

Re: RAID5 with 3 disks confusion [solved]

If you have only three drives, for raid5 it's raid-devices=3 and no spare.

A spare disk is unused and does not hold any data. It only becomes active when another disk fails and is kicked from the RAID, the rebuild then uses the spare disk as a replacement.

Spares may be useful if you have a box in a remote location where you can not replace a disk in a timely manner. For home use it's pointless to have a spare, you should do the replacement with your own two hands.

Last edited by frostschutz (2015-12-02 22:42:25)

Offline

#5 2015-12-02 23:39:15

maggie
Member
Registered: 2011-02-12
Posts: 255

Re: RAID5 with 3 disks confusion [solved]

I will not specify it then. Good explanation. Maybe update the wiki page.

Offline

Board footer

Powered by FluxBB