[ubuntu-us-in] Swap Partition question

Rob Ludwick rob at rcludw.no-ip.org
Fri May 2 06:13:55 BST 2008


Corfy, 

> I have a quick question. For someone who has two harddrives on their 
> system not in a RAID, is it better to have the swap partition on the 
> primary drive with the root files or on the secondary drive with the 
> home files? Or does it matter?

It won't matter.  There's a long series of kernel threads you can read
about this subject if you're bored, but essentially, if you have enough
ram, the amount of swap, and where swap resides, really makes no
difference.

On the other hand let's say you have a 4GB array that you need to load
into memory.   Now in this case the location and amount of swap may
actually make a difference.  So you could put a swap partition on each
drive, to help even out the IO of the swaps when they happen.

There's also /proc/sys/vm/swappiness to generally control the amount of
times your system swaps.  A low number discourages swaps.  A high number
encourages it. 

> (And again since I'm on the subject and so I'm prepared, I assume in a 
> multi-boot situation that multiple distros can use the same swap partition.)

Yes.

--R





More information about the Ubuntu-us-in mailing list