Tuesday, October 31, 2006

Fixing Edgy's swap

If you have upgraded from Ubuntu Dapper to Edgy, the question of "Where in the world is my swap space?", is likely to become relevant if you ever hibernate your laptop. It appears that your laptop will resume from an image in your swap space and if this image is corrupted it can break your filesystem.

You will find that you cannot activate your swap space again without recreating it. So in order to get your system back to health you need to do the following: (we will assume that /dev/hda3 is your swap space)

# Create swap space
sudo mkswap /dev/hda3
The above command will print out the new UUID for your swap space.

# Edit /etc/fstab and modify the line for the swap space or insert a line that looks like the following (using your own UUID of course)
UUID=cc284b80-8541-4253-86ab-b29809c201c8 none swap sw 0 0

# Now edit the configuration file for resume from hibernation
vim /etc/initramfs-tools/conf.d/resume

# Change the RESUME line to (still using your own UUID)
RESUME=UUID=cc284b80-8541-4253-86ab-b29809c201c8

# Now regenerate your initrd image
update-initramfs -u

# Reboot


Swap away!!

0 comments: