Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 05-01-2008, 05:46 PM   #1
Registered: Mar 2007
Posts: 157

Rep: Reputation: 30
raid 1 and swap

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)?
Old 05-01-2008, 05:47 PM   #2
Registered: Mar 2007
Posts: 157

Original Poster
Rep: Reputation: 30
Excuse me, the 1st question mark does not have any sense :-)
Old 05-04-2008, 07:25 AM   #3
Registered: Nov 2005
Location: The People's Republic of South Yorkshire
Distribution: FC3, CentOS4&5, Hardy Heron, Mythbuntu
Posts: 62

Rep: Reputation: 15

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.
Old 05-04-2008, 11:48 AM   #4
Senior Member
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986

Rep: Reputation: 45
Some people don't mirror their swap partition because it's extra overhead. If performance is an issue, then take that into consideration.
Old 05-04-2008, 12:21 PM   #5
Registered: Mar 2007
Posts: 157

Original Poster
Rep: Reputation: 30
Thanks for the accurate description of cases!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hot swap raid collen Linux - Hardware 1 10-16-2007 04:41 AM
Raid array swap file problem rgreeves Ubuntu 1 09-24-2007 05:50 AM
Best Practices for RAID Swap paco36 Linux - Software 1 04-20-2007 03:15 PM
FC6 Raid 1 on /, /boot, and swap sephiro499 Fedora 4 12-23-2006 03:37 AM
swap and raid 1 xrado Linux - General 1 05-20-2005 08:01 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:32 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration