LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   raid 1 and swap (https://www.linuxquestions.org/questions/linux-server-73/raid-1-and-swap-639214/)

tanoatlq 05-01-2008 05:46 PM

raid 1 and swap
 
Hello,
what is the *common* practice about putting swap in a mirror raid?
I always though that does not make sense, however recently I read
that mirroring the swap can avoid the server crash if one of the
disk fails and virtual memory is in use?
What is your opinion about its use in low-cost servers that should
run xen, samba, and a groupware suite like zimbra (for few people,
< 10)?

tanoatlq 05-01-2008 05:47 PM

Excuse me, the 1st question mark does not have any sense :-)

ajg 05-04-2008 07:25 AM

I always RAID it, purely to ease recovery. When one of the drives fails, the system will tend to hang anyway (and complain about lots of I/O errors), so you usually need to hard-reset it at that point because it won't respond to anything else.
If you have swap on both drives, but not RAIDed, one of the swap partitions will fail to mount because the drive is broken (I don't believe this will cause a massive problem - it'll just complain about it, and may drop to a shell when it boots).
If you only have swap on one of the drives, depending on which drive broke, you may have no swap at all, and a protesting system while it's booting (see above).
If it's mirrored, the MD device sorts it all out for you, and the only thing you need to be concerned about is rebuilding the RAID set.
At the end of the day, that's what RAID is for. To create a system that is reasonably easy to recover from a failed drive. No point in over-complicating things. K-I-S-S.

Micro420 05-04-2008 11:48 AM

Some people don't mirror their swap partition because it's extra overhead. If performance is an issue, then take that into consideration.

tanoatlq 05-04-2008 12:21 PM

Thanks for the accurate description of cases!


All times are GMT -5. The time now is 10:42 PM.