PDA

View Full Version : [ubuntu] Swap file not working?



Paul T.
June 16th, 2009, 06:40 PM
After doing a clean install of Ubuntu 9.04 onto my notebook, I booted from CD and used Gparted to resize partitions to max size, and resized swap file to 2Gb (2 x memory), all went well but now system monitor is telling me that 0 bytes of 0 bytes on swap file being used. Have I somehow disabled the swap file? If so how do I re-enable it?

Paul.

Amilo1718
June 16th, 2009, 06:42 PM
the OS doesn't need the use of the swap partition all the time...
especially when you have already a RAM of 1 gig
:popcorn:

Paul T.
June 16th, 2009, 06:50 PM
I understand that system doesn't need swap file all the time, but prior to resizing partitions system monitor would report that swap file is using 0 bytes of 194 mb, now it's implying that swap file is 0 bytes?

Amilo1718
June 16th, 2009, 06:53 PM
what does gparted tell you about the size of your swap file?

boof1988
June 16th, 2009, 06:53 PM
After doing a clean install of Ubuntu 9.04 onto my notebook, I booted from CD and used Gparted to resize partitions to max size, and resized swap file to 2Gb (2 x memory), all went well but now system monitor is telling me that 0 bytes of 0 bytes on swap file being used. Have I somehow disabled the swap file? If so how do I re-enable it?

Paul.

The UUID for the swap partition is probably different (now that it has been resized).

Of many options, two of which are...

Change the UUID (listed in your /etc/fstab) to match the UUID of the swap partition.
Change the UUID of the partition to match the UUID listed in /etc/fstab


I think that #1 is the easier of the two.

Paul T.
June 16th, 2009, 07:08 PM
Thx all for the advice, ashamed to say problem was my fault..... during re-partitioning I turned swap file off in GParted and forgot to turn it back on, 'doh :oops:

Paul T.
June 16th, 2009, 09:07 PM
Seems I was a bit premature to say it's sorted. I can start swap file with GParted, but on rebooting it switches itself off again. :confused:

jimv
June 16th, 2009, 10:07 PM
Easy to fix:

First use this command to get the UUID of your swap partition:

sudo blkid

Then put that ID in these two files:

/etc/fstab (where it says swap)
/etc/initramfs-tools/conf.d/resume (there's only one line in here)

Paul T.
June 17th, 2009, 06:28 PM
Easy to fix:

First use this command to get the UUID of your swap partition:

sudo blkid

Then put that ID in these two files:

/etc/fstab (where it says swap)
/etc/initramfs-tools/conf.d/resume (there's only one line in here)

Jimv, followed your instructions and it worked, many thx. :D