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)? |
Excuse me, the 1st question mark does not have any sense :-)
|
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. |
Some people don't mirror their swap partition because it's extra overhead. If performance is an issue, then take that into consideration.
|
Thanks for the accurate description of cases!
|
All times are GMT -5. The time now is 10:42 PM. |