LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-17-2008, 01:48 AM   #1
h725
Member
 
Registered: Apr 2008
Posts: 114

Rep: Reputation: 15
Swap space and raid


Hi all,

some people use raid1 for swap partition, others raid0, others without any raid (simply adding the two or more partition "linux swap" into /etc/fstab).

What is the best method?
Thanks
 
Old 10-17-2008, 05:12 AM   #2
Tux-Slack
Member
 
Registered: Nov 2006
Location: Slovenia
Distribution: Slackware 13.37
Posts: 511

Rep: Reputation: 37
Hello,

first of I apologize if I'll mix up the raid0 and raid1, raid0 mirroring and raid1 "bigger disk space" with 2 or more hard disks.

Having SWAP on raid0 which I think is mirroring makes no sense to me. You have a SWAP partition on one disk and a clone of it on the other. So if one disk goes the other stays intact and the swap partition is saved, which doesn't make sense because you're gonna have to shutdown and take the busted disk out.

On the other hand raid1 make no sense to me either, because raid1 works in such way that it combines two or more disks, let's say both are 120GB and when you put them in a raid1 you have 240GB, but recording onto a raid1 is done in a meaning something gets written on one disk, something on other, not in means of files but in means of bits of files.
So why put SWAP on a raid1 field? I think it's better of to just create a separate partition on one of the hard disks and have swap located there.

Just my personal opinion.

Regards
 
Old 10-17-2008, 08:12 AM   #3
ledow
Member
 
Registered: Apr 2005
Location: UK
Distribution: Slackware 13.0
Posts: 241

Rep: Reputation: 34
The method recommended by anyone involved with the kernel is (I believe) to just swapon a partition on each drive, and this will perform it's own "raid" between them without any extra code being involved. So they say that you just let Linux handle it all, which seems fair enough to me seeing as they wrote the code, and it also means that all you need is a swap partition on each raid'd drive, which you're probably going to do anyway. You won't get any speed advantages by doing it any other way, because the swap code already "raids" multiple swapspaces automatically.
 
Old 10-17-2008, 10:53 AM   #4
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
Tux-Slack did have the RAIDs reversed, RAID0 is a combination of drives, RAID1 is a mirror. Neither is needed with swap. Having a swap space on each disk is fine, combining them into some form of RAID is a waste of processor power, because you get nothing for the combination. As mentioned above, the kernel treats one large swap partition the same as it treats multiple small partitions. So you lose processing to make a RAID swap partition, and gain nothing for it.

Peace,
JimBass
 
Old 10-18-2008, 12:01 AM   #5
Tux-Slack
Member
 
Registered: Nov 2006
Location: Slovenia
Distribution: Slackware 13.37
Posts: 511

Rep: Reputation: 37
Quote:
Originally Posted by JimBass View Post
Tux-Slack did have the RAIDs reversed, RAID0 is a combination of drives, RAID1 is a mirror.
I knew it that I was going to write them wrong, thank you for the correction.
 
  


Reply



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
how to reduce swap space and reclaim the space grantm Linux - Newbie 7 08-16-2012 07:05 AM
swap file or swap space? simonb1975uk Linux - General 11 08-15-2008 02:39 PM
swap space (or) swap file yusufs Linux - Newbie 8 07-17-2008 02:02 AM
how much swap space is needed; how to increase swap space? johnpaulodonnell Linux - Newbie 5 03-23-2007 03:20 AM
How to unmount actual swap and mount a new(bigger) swap space? isaac Linux - Newbie 1 06-06-2004 01:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:55 PM.

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