linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* partitioned raid 5 and proper partition alignment
@ 2009-08-08  6:12 Matthias Dahl
  2009-08-08  7:56 ` Goswin von Brederlow
  0 siblings, 1 reply; 4+ messages in thread
From: Matthias Dahl @ 2009-08-08  6:12 UTC (permalink / raw)
  To: linux-raid

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:

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?

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: partitioned raid 5 and proper partition alignment
  2009-08-08  6:12 partitioned raid 5 and proper partition alignment Matthias Dahl
@ 2009-08-08  7:56 ` Goswin von Brederlow
  2009-08-08 11:09   ` Matthias Dahl
  0 siblings, 1 reply; 4+ messages in thread
From: Goswin von Brederlow @ 2009-08-08  7:56 UTC (permalink / raw)
  To: Matthias Dahl; +Cc: linux-raid

Matthias Dahl <ml_linux_raid@mortal-soul.de> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: partitioned raid 5 and proper partition alignment
  2009-08-08  7:56 ` Goswin von Brederlow
@ 2009-08-08 11:09   ` Matthias Dahl
  2009-08-08 22:21     ` Goswin von Brederlow
  0 siblings, 1 reply; 4+ messages in thread
From: Matthias Dahl @ 2009-08-08 11:09 UTC (permalink / raw)
  To: Goswin von Brederlow; +Cc: linux-raid

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: partitioned raid 5 and proper partition alignment
  2009-08-08 11:09   ` Matthias Dahl
@ 2009-08-08 22:21     ` Goswin von Brederlow
  0 siblings, 0 replies; 4+ messages in thread
From: Goswin von Brederlow @ 2009-08-08 22:21 UTC (permalink / raw)
  To: Matthias Dahl; +Cc: Goswin von Brederlow, linux-raid

Matthias Dahl <ml_linux_raid@mortal-soul.de> writes:

> 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...?!

Yes you are. The filesystem will never ever see the parity block of a
stripe. It only ever sees the 128k data. Writing 128k data will write
a full stripe of 192k to disk.

MfG
        Goswin

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-08-08 22:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-08  6:12 partitioned raid 5 and proper partition alignment Matthias Dahl
2009-08-08  7:56 ` Goswin von Brederlow
2009-08-08 11:09   ` Matthias Dahl
2009-08-08 22:21     ` Goswin von Brederlow

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).