[nSLUG] RAID and partitioning

Daniel Morrison draker at gmail.com
Fri May 4 12:37:46 ADT 2007

On 04/05/07, Bill Davidson <billdavidson at eastlink.ca> wrote:

> RAID5 array.  I see that I can build a raid array from any block device,
> either partitions (sda1 + sdb1 etc) or whole disks (sda + sdb etc).  I
> am tempted to do it the second way since the disks are identical, then
> partition the resulting md device, rather than partitioning a whole
> bunch of disks and hoping I get them all exactly the same.  (If the
> resulting array is called md0, what will the partitions be called, md01,
> md02, etc?)  I've never done it this way before.

It's not hard to partition identical disks exactly the same way.  If
you're paranoid you could even use sfdisk (scriptable fdisk) to dump the
partition table of your first disk and then apply it to the others.

You can make your raid from the entire disk if you want, and it will work
fine, but you may have minor problems (i.e. at boot the kernel complains
about an invalid partition table when it scans the disks).

However I don't think it's normal practice to partition the resulting
/dev/md0 device.  I don't know, but I don't think there are devices that
can be made as you suggest (e.g. /dev/md00, /dev/md01).  Note that there
are no minor numbers available, e.g.:

$ ls -l /dev/md0 /dev/md1
brw-rw----  1 root disk 9, 0 1998-04-01 21:37 /dev/md0
brw-rw----  1 root disk 9, 1 1998-04-01 21:37 /dev/md1

In my opinion the correct solution is to use LVM to create logical volumes
within a large RAID array.  So either partition the disks idenitically
with one whole disk partition each, or use the raw disk devices, and
create a /dev/md0.  Now use /dev/md0 as a physical extent in lvm, and
create logical volumes for each filesystem you want.

Using LVM also gets you the ability to make snapshots, and other nifty


More information about the nSLUG mailing list