PDA

View Full Version : How to increase swap?



Anniedog
23rd June 2007, 11:08 AM
just increased ram on box below. I have created an extra swap partition for the increase *2. But I am not certain as to the correct situation in fstab is it ok just to add this as a second swap partition in this file.? I do not know if having swap spread over two seperate partions is a good idea or if that is indeed the correct proceedure.

Wayne
23rd June 2007, 11:23 AM
I'd hazard that if you already have 1Gb of swap (x2 of 512) that will be plenty with 1Gb RAM. I have 512Gb RAM and 1Gb of swap and it's hardly ever touched, well OK, 16Kb is being used right now and I'm running Evolution, Pan, Swiftfox and watching a DVD with Totem.

Wayne

Anniedog
23rd June 2007, 12:01 PM
Yep I have 1gb in swap and everything is running fine so it is not really an issue now. But I am very interested in the correct way to increase swap file.

RupertPupkin
23rd June 2007, 11:35 PM
Suppose you created a new swap partition on, say, /dev/hda4.
To activate that new swap partition at boot time, you need to refer to it by a label in /etc/fstab.
Pick a label name that's different from the one being used by your current swap partition. To see what the current swap label is, either look in /etc/fstab or run /sbin/blkid.
When you have decided on a new label name, say, "SWAP2", do this:
/sbin/mkswap -L "SWAP2" /dev/hda4

To activate the swap right now, do this:
/sbin/swapon -L "SWAP2"

To permanently activate the new swap partition, add this line to /etc/fstab:
LABEL=SWAP2 swap swap defaults 0 0

The next time you reboot, the new swap partition should be available. Type 'free' to check that.

GregLee
24th June 2007, 12:22 AM
It is ok to put additional swap partitions in fstab. If a swap partition has a label, you can use that in column one of fstab, as RupertPupkin says, but it isn't necessary that it have a label. You can refer to it by it's partition, e.g. /dev/sda3, if the swap partition happens to be partition #3 on the /dev/sda device. Right now, using fc6, I have one swap partition on /dev/sda referred to by its label in fstab and another on /dev/hdd referred to by its partition (/dev/hdd2). Works fine.

Anniedog
26th June 2007, 11:45 AM
Rupertpumkin Many thanks for this and sorry not to get back but as usual i have been diverted by the Vista boxes I have the great misfortune to have aquired. I note the post from Greglee again much appreciated. I would like to add that in the release notes for FC7 it does say that Labels are used and I note his post for FC6 which in my case is very handy as I still have FC6 as well .