[Nottingham] swap on md raid?

Jim Moore jmthelostpacket at googlemail.com
Mon Aug 24 23:54:30 UTC 2009


my head box is running SoftRAID6+1, which is basically RAID5+1 and an
extra stripe of parity data. OK, so this eats up ten drives and four
controllers, but this means I get failure tolerance on the controllers
as well, and being as the setup I've ended up with is pretty much
transparent to the host OS, having to worry about complete failure is
only a priority if I find myself in the middle of a power cut. The
swap sits primarily on CFIDE flash (a 512MB card which is later used
for buffering to the array), which is then written to the array which
itself is accessed by the OS as if it were a single volume - which to
all intents and purposes, as far as the OS is concerned, it is; RAID
management is almost entirely out of kernelspace (except where the
mirroring is concerned - this is handled via Linux kernel LVM, the
rest in controllerspace). What I've ended up with is an array that can
more than keep up with the network and with local traffic, which is
pretty much CG rendering, video encoding and cluster management
(including temporary storage across all nodes), with fault tolerance
of 40% of the drive stack or of any one controller.

Only, don't ask me how in the hell I did all that... designing the
array with off-the-shelf IDE controllers was hell, took me a month and
getting it right was for me, pure luck. Getting the CFIDE to do what I
wanted when I wanted was a serious trick of scripting, something which
is certainly /not/ my strong point, and it was a couple years ago -
since when, I've only ever had two disks fail and they were six months
apart.



On 8/24/09, Sergiusz Pawlowicz <sergiusz at pawlowicz.name> wrote:
> On Mon, Aug 24, 2009 at 22:50, Martin<martin at ml1.co.uk> wrote:
>> Folks,
>>
>> Anyone know if it is still a bad idea to put your swap partition on a
>> linux md raid device (partition)?
>>
>> I remember reading of a corner case whereby the kernel can be forced
>> into panic if the md raid requires a swap operation when the kernel is
>> needing to service a pending swap operation... Is that still the case?
>>
>> How are you supposed to protect the swap from a disk death? Or is your
>> system always doomed if you're using swap?
>
> No, I have swap not only on MD raid, but looking higher also on LVM
> and then encrypted partition, as swap often contents passwords and
> other sensitive data:
>
> # cat /etc/crypttab
> # <target name> <source device>         <key file>      <options>
> cswap /dev/vg/lvm1 /dev/urandom swap
>
> #cat /etc/fstab | grep cswap
> /dev/mapper/cswap       none            swap    sw              0       0
>
> Of course we are talking about modern 2.6.x kernel, where x>=8
>
> BTW, I use raid10,f2 for MD, as it looks it is currently the fastest
> from safe arrays (reading is twice faster then raid1)
>
> S.
>
> _______________________________________________
> Nottingham mailing list
> Nottingham at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/nottingham
>



More information about the Nottingham mailing list