I'm using Linux soft RAID1 (or called `md' or multi-device). I want to create such a RAID device that is big enough to hold an old partition. I knew the soft RAID needs some blocks to store metadata so the resulted device is always a bit smaller than the RAID partition. So my problem is that how to determine the right size of RAID partitions given a required result device size.

Let's take RAID1 (mirror) as a sample. I have created two RAID partitions (sda1 and sdb1) and combined them as a RAID1 device (md0), using metadata 0.90:
sda1 and sdb1 are both of 481949 sectors (all sectors are of 512 bytes)
the size of the result md0 device is 481792 sectors (157 sectors less)

Another example (also RAID1) using metadata 1.2:
sda2 and sdb2 are both of 199238344 sectors
the size of result md1 device is 199236152 (2192 sectors less)

The difference in size seems totally random to me, or maybe they are related to the version of metadata used. So if I need a result RAID1 device of size q, what size should I choose for the underlying RAID partitions?

(I knew I can grow or shrink the old partition a bit but that isn't a good solution, because it's risky and not every file system supports resizing.)

Thanks!

link|improve this question
feedback

migrated from stackoverflow.com Jun 15 '11 at 5:07

This question came from our site for professional and enthusiast programmers.

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.