[nSLUG] RAID and partitioning

Bill Davidson billdavidson at eastlink.ca
Sun May 6 15:34:18 ADT 2007


Hi:

One thing about Linux that continues to amaze me is the ongoing
innovation.  Some people criticize Linux, saying "It's just an inferior
copy of an old operating system," but it's actually a hotbed of
innovation.  Run-time loadable I/O schedulers, the new kexec system
call, it goes on and on.

So anyway, a while ago I wrote:

> Thanks for that, it was exactly the kind of help I was looking for.  I
> see now that had I read a little further in the RAID HOWTO I would have
> seen:
> 
> "RAID devices cannot be partitioned, like ordinary disks can....The
> solution to the partitioning problem is LVM" !

So yesterday I booted this old server with a Knoppix 5.1 CD and was
reviewing the mdadm man page, when I noticed this option under the
"--create" section:


       -a, --auto{=no,yes,md,mdp,part,p}{NN}
              Instruct mdadm to create the device  file  if  needed,  possibly
              allocating an unused minor number.  "md" causes a non-partition-
              able array to be used.  "mdp", "part" or "p" causes a partition-
              able array (2.6 and later) to be used.  "yes" requires the named
              md device to have a 'standard' format, and the  type  and  minor
              number will be determined from this.  See DEVICE NAMES below.
[snip]
              For  partitionable arrays, mdadm will create the device file for
              the whole array and for the first  4  partitions.   A  different
              number  of partitions can be specified at the end of this option
              (e.g.  --auto=p7).  If the device name ends with  a  digit,  the
              partition  names  add  a 'p', and a number, e.g. "/dev/home1p3".
              If there is no trailing digit, then  the  partition  names  just
              have a number added, e.g. "/dev/scratch3".
[snip]
DEVICE NAMES
       While entries in the /dev directory can have any format you like, mdadm
       has an understanding of 'standard' formats which it uses to  guide  its
       behaviour when creating device files via the --auto option.

       The  standard  names  for  non-partitioned  arrays (the only sort of md
       array available in 2.4 and earlier) either of

              /dev/mdNN
              /dev/md/NN

       where NN is a number.  The standard names for partitionable arrays  (as
       available from 2.6 onwards) is one of

              /dev/md/dNN
              /dev/md_dNN

       Partition  numbers  should  be  indicated by added "pMM" to these, thus
       "/dev/md/d1p2".

So I tried it.  I created a RAID5 array using sdb, sdc, and sdd, and
using the "-ap" option, and used "/dev/md_d0" as the device name.  This
created /dev/md_d0 with major number 253, minor 0, plus /dev/md_d0p1
through /dev/md_d0p4 with minor numbers 1 through 4, plus for some
reason /dev/md_d1 with minor 64 and /dev/md_d1p1 through /dev/md_d1p4
with minor numbers 65-68.

Then I ran fdisk on /dev/md_d0 and created a partition.  I seem to
recall that fdisk complained on exit, but the partition was created.
Then I made a filesystem on /dev/md_d0p1 and mounted it, copied some
files to it, unmounted it, shut down and restarted the machine, ran
"mdadm --assemble...", remounted the partiton, and everything was
there. 

I assume that this is still fairly experimental behaviour, but it is
pretty darned cool.

Of course, after all that, it is still not suitable for what I was
thinking of, because no boot loaders know about RAID5.  And besides, LVM
makes a lot more sense if only because volumes can be resized as needed.

So...  I have (or my daughter's school has) this box with 5 identical
36GB ultra-160 SCSI drives.  The on-board Adaptec AIC-7899 controller
has two channels, so I put three drives on one channel and two on the
other.  I'm thinking I'll create two partitions on each drive, one small
one (say 128MB) and one large one.  I'll use the small partitions on sda
(id 0 on channel A) and sdd (id 0 on channel B) as a RAID1 array to
mount at /boot.  I'll use the other three small partitions for swap.
Then I'll use all five large partitions for a RAID5 array and create
logical volumes on that for everything else.

Now I just have to pick a distro...

Oh, and does anybody have a line on a Voltage Regulator Module for a
Dell Poweredge 1400SC?


-- 
Bill Davidson <billdavidson at eastlink.ca>




More information about the nSLUG mailing list