where to put swap

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
red123
Level 2
Level 2
Posts: 65
Joined: Mon Sep 27, 2010 1:46 am

where to put swap

Post by red123 »

Should I put my swap partition on my SSD or on my secondary HD with my /home partition? Or does this matter?

wayne128
Level 10
Level 10
Posts: 3412
Joined: Tue Jul 13, 2010 12:15 am

Re: where to put swap

Post by wayne128 »

red123 wrote:Should I put my swap partition on my SSD or on my secondary HD with my /home partition? Or does this matter?
You should not put swap in /home.
Swap has different file system.

As swap is used for hibernation purpose, it should work anyway in SSD or HD. Read more details below
https://help.ubuntu.com/community/SwapFaq

red123
Level 2
Level 2
Posts: 65
Joined: Mon Sep 27, 2010 1:46 am

Re: where to put swap

Post by red123 »

I meant to say if I should put my swap partition on my secondary HD which is also where I put my /home partition.

pythagorean
Level 3
Level 3
Posts: 149
Joined: Tue Mar 23, 2010 2:36 am
Location: Chicago
Contact:

Re: where to put swap

Post by pythagorean »

personally, I wouldn't waste the space at all. I have watched my system monitor numerous times with a variety of applications to see if swap is ever used and I have never seen it move off ZERO per cent at all.

User avatar
gn2
Level 5
Level 5
Posts: 885
Joined: Mon Nov 30, 2009 5:54 am
Location: Bonnie Scotland

Re: where to put swap

Post by gn2 »

red123 wrote:Should I put my swap partition on my SSD
If you will use swap: Absolutely not.
If you will not use swap: Doesn't matter where it goes.

User avatar
Dave68
Level 4
Level 4
Posts: 295
Joined: Wed Jun 16, 2010 1:15 pm
Location: Bolivar, Missouri

Re: where to put swap

Post by Dave68 »

I have my swap on the same Hard Drive that I have my / and /home partitions(Secondary, and External at that).

Although, there are some that would say a small Swap on the Primary and a small Swap on the Secondary tend to give a Raid effect to the Swap System.
pythagorean wrote:personally, I wouldn't waste the space at all. I have watched my system monitor numerous times with a variety of applications to see if swap is ever used and I have never seen it move off ZERO per cent at all.
I have never tried this, and was under the impression that Swap was a must. I'm not questioning this statement, I've just never tried it.

Another World of Possibilities :lol:

Thanks,
Dave
Linux User: 528038
Primary PC: Version: LMDE (201101), 32 Bit.
Alternate 1: Version: Peppermint One OS, 32 Bit.
Laptop: Version: Julia Main (10), AMD 64
Image

User avatar
seeley
Level 7
Level 7
Posts: 1867
Joined: Sun Mar 07, 2010 7:20 am

Re: where to put swap

Post by seeley »

Hi red123!
For "swap" you need an own partition - it has another file system as /home, it's impossible to put swap into /home.
I tested - with 1 internal hard disk: as primary partition, within an extended partition (as first logical = number 5, as last and in the middle) - no difference;
even no "swap" made problems - so as a normal user (without "suspend to disk") it plays no role.
seeley
seeley @ Linux multiboot

User avatar
DrHu
Level 17
Level 17
Posts: 7525
Joined: Wed Jun 17, 2009 8:20 pm

Re: where to put swap

Post by DrHu »

Typically an ssd drives is faster and has lower latency than a regular hard drive, other than that it doesn't matter much.

Most Linux distributions even if they require a swap partition or file when installed (being part of that installation procedure) but do not make any use of the swap area, if your hardware is adequate to that task of running the OS + applications; as you have enough RAM (memory) and system storage and are not at the minimum for use of the hardware with that installed software
Last edited by DrHu on Thu Dec 16, 2010 3:33 pm, edited 1 time in total.

User avatar
ivan_rookie
Level 2
Level 2
Posts: 91
Joined: Wed Dec 08, 2010 2:51 pm
Location: Berlin

Re: where to put swap

Post by ivan_rookie »

I personally (Mint 10 64-bit Gnome) did not assign a swap partition at all, because I think 4GB of RAM can handle everything. Until now my installation is superfast, responsive and it never manages to 'eat' more than 900MB of my memory even when running browsers and other intensive apps. Also, I wouldn't put a swap partition on a SSD.
"Running Windows on a Core i7 is like having a brand new Porsche,
but only be able to drive backwards with the handbrake on."

User avatar
AK Dave
Level 6
Level 6
Posts: 1042
Joined: Wed May 14, 2008 3:39 pm
Location: Anchorage, AK USA

Re: where to put swap

Post by AK Dave »

The only purposes for swap in a desktop or laptop system should be for emergency extra ram, or for suspend/resume functions. Either way, you want the fastest lowest latency you can get. If you have an SSD, by all means USE IT! If you have a USB3 thumb drive on a USB3 port, USE IT!

If you're planning to regularly use swap to supplement RAM, you're doing it wrong already. Maybe you have some obscure high-end system need which would actually be better handled by having gobs and gobs more ram. Swap isn't ram. It is a filesystem that augments ram, but it is mind-numbingly slower than real ram so if it is ever actually used you're already in trouble.

Now, on a high-end workstation (not a desktop at all at this point) where you actually regularly need somewhere north of 16gb of ram just to function and can't bring yourself to farm out some of this work to a beowulf cluster then all bets are off.

For a question in the Noob forum, the answer is: SSD.

User avatar
mads
Level 6
Level 6
Posts: 1296
Joined: Wed Nov 03, 2010 3:44 pm
Contact:

Re: where to put swap

Post by mads »

red123 wrote:Should I put my swap partition on my SSD or on my secondary HD with my /home partition?
On your secondary HD with your /home partition.

red123 wrote:Or does this matter?
"gn2" has already answered this part.

Dude
Level 1
Level 1
Posts: 7
Joined: Sat Nov 14, 2009 5:53 am

Re: where to put swap

Post by Dude »

I have the best luck when I put / in one partition and swap in another partition on the same drive. When I spread my data to more than one drive, it just slows the system down. I don't use a separate /home partition. Everything on a single / partition works best for me. I'm using a 90gb OCZ Agility 2 SSD.

By the way, I do have a separate WD 500gb hard drive to backup my data. I leave it unmounted most of the time and just mount it when I need it. It's not even listed in /etc/fstab.

Post Reply

Return to “Newbie Questions”