Saturday, 21 March 2009

Hey! Where'd my swap go?

I've just noticed that I've got no swap space! (Dell 1525 running Ubuntu 8.10).

I first installed my laptop with Ubuntu 8.04, and later upgraded to 8.10. After the upgrade I noticed that hibernate no longer worked, and I think (from memory) I found an error message saying something about not enough swap space. I briefly thought about trying to find out how to add more swap (I already had a 4G partition defined, and I've only got 2G ram) but then I swiftly moved on to other more pressing issues.

Well, just recently I fired up System Monitor to check on a process, and notice in the bottom right corner it said there was no swap space. Firing up 'top' confirmed this - my system had zero swap!

I could see that I had a swap partition defined:
paul@dell1525:~$ sudo blkid
/dev/sda8: TYPE="swap" UUID="4bd53cb9-611c-4e57-a9df-4754d6bcdd65"

But the corresponding entry in /etc/fstab had a different entry:.
# /dev/sda8
UUID=e6eb6c47-599c-4612-ac8a-287279ee438b none swap sw 0 0

The UUIDs didn't match! Thus no swap. Correcting the fstab file and rebooting resolved the problem, but I don't know what caused it.

Right now, top shows I've got my 4G swap space being used, and hibernate has successfully hibernated and resumed. Perhaps now this laptop will perform better too?

As for adding more swap space, I don't think I need to do that right now - but here is a good article for future reference.


Post a Comment