[Scottish] Swap partitions -- do modern boxen really need them? Discuss

Miah Gregory scottish at mailman.lug.org.uk
Wed Jul 16 13:59:01 2003

On Wed, 16 Jul 2003, Kyle Gordon wrote:

> I'd like to use swsusp to suspend my laptop to disk. However, with 256Mb RAM, 
> and my affection for KDE, I regularly find myself eating into the 256Mb swap 
> that I have. I might, in some instances, be using a total of say, 300Mb, so 
> it attempts to save 300Mb into a 256 swapspace... I could resize my 
> partitions to cope (lack of foresight - my fault anyway) and give it more 
> swap, but how can I be sure that it doesn't use up more that space either?

> I know this may sound strange, and I've probably got the wrong end of the 
> stick when it comes to swap matters, so feel free to LART me.

The important thing is to never, ever run out of memory AND swap. Linux
doesn't like it. At all. If you want to be able to suspend too, the you
need to add more swap space, or reduce the amount of memory you use before

I don't think there are any magical solutions to this (unfortunately for

A half hearted hack for this would be to have a second swap partition, the
size of your ram plus a little bit extra, which is not activated at boot,
then have a small script to replace the command you normally run to
suspend, eg:

swapon /dev/hda3
swapoff /dev/hda3

Since dosuspend shouldn't (in theory) return until the machine comes back
up, the swapoff is safe. If that's not the case, you'll need to manually
switch that extra swap partition off before using your machine again.

Miah Gregory