[mythtv-users] RAID: full disk or partition (was: Question re: available SATA ports and linux software RAID)

f-myth-users at media.mit.edu f-myth-users at media.mit.edu
Sun Apr 24 06:49:57 UTC 2011

    > Date: Sun, 24 Apr 2011 09:31:18 +1000
    > From: Jean-Yves Avenard <jyavenard at gmail.com>

    > On 13 April 2011 01:13, Robin Hill <myth at robinhill.me.uk> wrote:
    > > No, the stripe size must be a multiple of the FS block size - this is 1,
    > > 2 or 4k for ext2/3/4 (depending on FS size) and defaults to 4k for XFS
    > > (generally this maxes at the memory pagesize, which is 4k for
    > > x86/x86-64). So making the array chunk size a multiple of 4k (default is
    > > 512k for current mdadm - older versions used 64k I think) will mean the
    > > stripe width is irrelevant (so powers of 2 don't come into it at all).
    > >
    > > It's then up to the md driver to try to write complete stripes
    > > (providing enough sequential data is available) .
    > >
    > > In other words, this should be working optimally out of the box, and
    > > there's little you can do to help/hinder it (increasing the
    > > stripe_cache_size for RAID5/6 can help, but at the cost of increased
    > > memory usage).
    > >
    > > The other issue (that Ian seems to have had previously) is that
    > > partitioned arrays need to be arranged so that partitions fall on stripe
    > > boundaries. I wouldn't use a partitioned array anyway - partitioning
    > > first, then making multiple arrays seems more sensible to me.

    > So..

    > When adding a disk to a RAID array ; would you use the full disk (e.g.
    > /dev/sda) or a partition (/dev/sda1).
    > Every single examples of mdadm usage seem to use partitions rather
    > than a full disk

The other advantage of using partitions is that it lets other tools
know what's going on, which makes it less likely that a confused tool
or a confused user will nuke a disk that's part of your RAID.

Not using partitions makes alignment on 4K advanced-format disks
easier, but modern tools will ask the disk, and most seem to default
to leaving the first megabyte free if the disk answers either
"unknown" or "512B", since so many 4K disks lie and claim to be
512B devices.  Modern gparted will do that for Samsung 2T's,
for example.  In my case, I didn't bother forcing minimal alignment;
losing the first meg of a 2T device is inconsequential and gives me
slightly more margin if some wayward tool smashes the first few blocks.

P.S.  I just had occasion to make an ext4fs on top of a RAID10; it
appears to have correctly noticed suitable stride and stripe parameters
from the underlying block device without me having to tell it manually.
(dumpe2fs -h shows "RAID stride" and "RAID stripe width" parameters
for that filesystem, which the same OS version does -not- show for an
ext4fs on top of a non-RAID.)  This is particularly notable because
there is an LVM on top of the RAID10, followed by a LUKS crypto layer,
and finally the ext4fs; this shows that the info is being passed
correctly through the layers.  [This is on Ubuntu 11.04, currently
just-pre-release Natty.]

More information about the mythtv-users mailing list