[nSLUG] RAID and partitioning

D G Teed donald.teed at gmail.com
Fri May 4 14:28:48 ADT 2007


Regarding RAID of swap partitions, I've seen both opinions
from what I've read over the years.

Swap is something you want to be responsive, rather
than able to survive a disk crash and redundant.  The extra
overhead to process heavy use of swap (if that was
ever needed) as RAID could cause a bit of a downward
spiraling performance on a saturated system.

Running several swaps over several disks with equal priority
is what I normally do when there is lots of RAM.

However if I expected swap to get a lot of use every day,
and the applications on the server were critical to keep up,
I'd probably consider a RAID option for swap as it could be important
to keep the system stable when drive death inevitably happens.

--Donald

On 5/4/07, Rory <rory at unixism.org> wrote:
>
>  FWIW:
>
> my preference is to not put swap on a software raid device;  I like having
> swap as close to the 'bare metal' as possible.  Of course, depending on the
> system usage, the relative speed of swap may not matter.
>
> I would split each disk into two parts, a small swap partition and then a
> larger one to be part of the raid/lvm set.  The kernel will do an excellent
> job of interleaving swap reads/writes across all active swap partitions.
>
> R
>
> Bill Davidson wrote:
>
> Hi:
>
> 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" !
>
> On Fri, 2007-05-04 at 12:37 -0300, Daniel Morrison wrote:
>
>  On 04/05/07, Bill Davidson <billdavidson at eastlink.ca> <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
> things.
>
> -D.
>
> _______________________________________________
> nSLUG mailing list
> nSLUG at nslug.ns.cahttp://nslug.ns.ca/cgi-bin/mailman/listinfo/nslug
>
>  _______________________________________________
> nSLUG mailing list
> nSLUG at nslug.ns.cahttp://nslug.ns.ca/cgi-bin/mailman/listinfo/nslug
>
>
>
> _______________________________________________
> nSLUG mailing list
> nSLUG at nslug.ns.ca
> http://nslug.ns.ca/cgi-bin/mailman/listinfo/nslug
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nslug.ns.ca/mailman/private/nslug/attachments/20070504/3f028e95/attachment.html>


More information about the nSLUG mailing list