Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I plan to create a software-only Linux MD RAID10 array from two identical 1TB discs (using mdadm). Should I create it directly on the two disc devices (/dev/sda and /dev/sdb) or create a partition in each of the drives to use for the array (/dev/sda1 and /dev/sdb1)?

The reason I am asking is because I have heard that the partition approach can be a good idea, making the partitions slightly smaller than the entire device so as to accommodate future replacement discs of slightly smaller size. However, some sources (man mdadm) suggest that this is more correctly achieved using the --size option for mdadm, but I cannot figure out if this will work for RAID10?

share|improve this question
1  
1) RAID 10 requires four volumes (either four disks, or if you are utterly insane 4 partitions on spinning disks). 2) I would go for the volumes (/dev/sda1 etc) to allow for smaller replacement disks and to avoid potential problems with RAID and GEOM meta data. –  Hennes Jul 29 '13 at 12:31
1  
To clarify the differences between RAID 0 (stripe), RAID 1 (mirror) and RAID 10 ( a stripe of mirrors ) and RAID01 ( a mirror of stripes ) please see this post on our sister site SF. –  Hennes Jul 29 '13 at 12:40
    
@Hennes As far as I can see, "Linux MD RAID10" (which I have in mind) requires at least two volumes: en.wikipedia.org/wiki/Non-standard_RAID_levels#Linux_MD_RAID_10. Am I missing something? –  Thomas Arildsen Jul 29 '13 at 13:02
    
@Hennes BTW, thanks for the post on SF. Nice to know that RAID01 should be avoided. And, reading about the capabilities of ZFS has got me very interested now... –  Thomas Arildsen Jul 29 '13 at 13:07
    
A stripe of multiple volumes on a single disk makes no sense. It might work, but the goal of a stripe is to increase performance by combining the speed of multiple drives. A stripe of two volumes on the same drive would effectively yield "twice * half the speed". And that ignores extra overhead and unneeded complexity. As to ZFS, it is very powerful. Just make sure you read all the documentation and that you realise the CPU and RAM needed for some of the advanced features. (E.g. dudeplication). Having said that, Sun made a great system with ZFS. –  Hennes Jul 29 '13 at 14:05
show 3 more comments

2 Answers

I don't think your partition vs drive question relates to your array being a MD RAID 10. The partition vs drive question is preferential. And when it comes to growing or shrinking arrays, if MDADM can do something for RAID 1, it can probably do it for raid 10.

On that note, it is easier if you do not use the whole drive for your array just in case another drive you get in the future ends up being smaller, and whether or not you address such an issue now or later is a matter of preference. I personally use a partition that is slightly smaller for my MD RAID 10 array because it is safer than messing with sizes after the array is in place.

And in contrast to what Hennes has said, you DO get a performance boost when you use a software RAID 10 on two drives. My performance literally doubled the moment I rebuilt my array into 10 from 1 using the same drives in the same computer. Seems ridiculous RAID 1 doesn't naturally read from both discs, but it doesn't! I am thinking about adding a third drive for double redundancy since I am using older drives and I think I run a high risk of failure during a rebuild due to using older hardware in general. And the speed boost doesn't hurt.

As a note, I even have two different size drives (1TB and 2TB),from 2 different manufacturers. Not the best scenario, but it works great! Writes are slower than a single drive, but reads are fast! Only 2 drives and rebuilds are quick! (no parity) Enjoy your two drive RAID 10 and just enjoy all those people like Hennes who are SURE you need 4 drives. :)

share|improve this answer
    
Well, I actually ended up going for RAID1 for the simplicity of being able to mount a single member partition, should I somehow mess up the RAID metadata. I guess that will not be possible with RAID10? –  Thomas Arildsen Jul 31 '13 at 21:16
    
Now that you have confirmed the speed advantage, I am tempted to go for RAID10. I haven't actually repopulated the array yet, so I can easily do it over again. –  Thomas Arildsen Jul 31 '13 at 21:18
    
Simplicity is usually better. RAID 1 is simple and therefore it works great. MD RAID 1 vs MD RAID 10 is was no brainer in my mind after I did it. Before, it seemed kinda weird and complex, but when you go through the motions its really simple. Don't know why all hardware controllers don't do the same thing. –  Damon Aug 1 '13 at 1:31
add comment

I ended up choosing the partition-based solution. After all, this should allow me to mount one of the mirror member partitions as a regular partition if the RAID metadata is somehow lost, as I experienced recently: http://askubuntu.com/questions/311024/raid1-array-lost-after-upgrade-from-ubuntu-11-10-to-13-04. I was not sure whether I would be able to recover like this if I were to create the array directly on the devices using mdadm --size ... solution.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.