Re: partitioned raid 5 and proper partition alignment

2 messages, 2 authors, 2009-08-08 · open the first message on its own page

Re: partitioned raid 5 and proper partition alignment

From: Goswin von Brederlow <hidden>
Date: 2009-08-08 07:56:59

Matthias Dahl [off-list ref] writes:
Hello everyone.

I've really looked around everywhere but it is hard to find any decent 
information about partitioned software raid 5. If someone could please help me 
out that would be great. Thanks a lot in advance...

I am trying to partition a raid 5 but I cannot figure out the partition 
alignment. My raid has 3 disks and a chunk size of 64kib, thus a total stripe 
width of 192kib (data + parity). I am using sfdisk w/ sector units and I 
currently align everything to the stripe width size:
But each stripe only holds 128k of data. You have to align to that.
dreamgate ~ # sfdisk -l -uS /dev/md_d0

Disk /dev/md_d0: 485990272 cylinders, 2 heads, 4 sectors/track
Units = sectors of 512 bytes, counting from 0

   Device Boot    Start       End   #sectors  Id  System
/dev/md_d0p1           384 314572799  314572416  83  Linux
/dev/md_d0p2     314572800 629145599  314572800  83  Linux
/dev/md_d0p3     629145600 3887922175 3258776576  83  Linux
/dev/md_d0p4             1       383        383  83  Linux

The problem is I cannot figure out how to deal with sector 0 which usually 
contains the mbr and partition table. So does the striping begin w/ sector 0 
or w/ sector 1 because sector 0 is handled specially?
No, nothing special about sector 0. And the actual MBR would go to the
component devices of your raid. Depending on the metadata version you
use that could overwrite your metadata.
If sector 0 is not handled specially and striping starts there, my partitions 
above are properly aligned otherwise they are off exactly 512 byte.

Like I said, if someone could give me a hint, I'd really appreciate it.

Thanks a lot in advance,
matthew.
MfG
        Goswin

Re: partitioned raid 5 and proper partition alignment

From: Matthias Dahl <hidden>
Date: 2009-08-08 11:09:59

Hi.

On Saturday 08 August 2009 09:56:59 you wrote:
But each stripe only holds 128k of data. You have to align to that.
I beg to differ. There are two data chunks and one parity chunk, thus a whole 
stripe is 192k long if you've a 64k chunk size. If you align to 128k and you 
put e.g. ext4 on it with the correct fs stride and stripe-width settings, 
you'll probably end up with worse performance since you start in the middle of 
a stripe even though properly aligned to a chunk boundary. Or am I totally on 
the wrong track here...?!
No, nothing special about sector 0. 
So sector 0 gets striped like all the others meaning that it counts to the 
first 192k stripe? So in order to get everything properly stripe aligned it 
was correct to leave a 196.096 byte span free after sector 0.

Best regards,
matthias.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help