Should a Linux Swap partition be on the RAID?
When setting up a new system, if I am planning on mirroring two hard drives, what should I do with the SWAP area? I can think of three things I can do...
- Do a mirror of the SWAP partition
- Stripe it for speed
- Create two separate SWAP partitions
I can see number 1 just seeming "normal" compared to the rest of the partitions, but does it need to be mirrored? Would the system break if the Stripe (option 2) died? Would the system use both SWAP partitions if I created two separate ones? What would be the ideal setup?
11 Answer
Swap is memory, so if it died you'd probably get a kernel panic. At the very least, you'd see some binaries crash. That being said, if you don't need / want your system to keep running after a disk up and dies on you, go ahead and stripe because performance is king re:swap.
4