Swap partition disappeared on Ubuntu 10.10


Somewhere with in the past few weeks my swap partition disappeared. At first I didn’t even notice it stopped working. The first result of this was that the hibernate option also disappeared. I thought it was just some setting that went wrong somewhere with all the kernels I had been fooling around with. I finally realized the swap partition was gone when htop showed a 0/0MB swap size.

Under gnome disk utility the swap partition was showing up as an unknown partition. The solution was to simply select the partition in disk utility and format the partition as Swap Space. Since the swap partition was reformatted the UUID has changed so /etc/fstab must be updated. The UUID of the swap parition can be found by doing:

ls -al /dev/disk/by-uuid/

This will list the disks and partitions on your system according to their UUIDs and the device name their equivalent device name (sda1, sdc3, etc). Here’s what it looks like on my system.

lrwxrwxrwx 1 root root  10 2010-11-22 17:18 91eef435-49c4-4035-8785-24811fd4816e -> ../../sda5
lrwxrwxrwx 1 root root  10 2010-11-22 17:18 A6FCDDA5FCDD6FD3 -> ../../sda2
lrwxrwxrwx 1 root root  10 2010-11-22 17:18 d69ce970-9aed-4bb1-a493-75ce35d76307 -> ../../sda6
lrwxrwxrwx 1 root root  10 2010-11-22 17:18 F680D2F180D2B6F9 -> ../../sda1

The swap partition on my system according to gnome disk utility is /dev/sda6. So I copy the UUID associated with sda6 (d69ce970-9aed-4bb1-a493-75ce35d76307) and update /etc/fstab with the new UUID.

In the end the swap entry in my fstab looks like this:

UUID=d69ce970-9aed-4bb1-a493-75ce35d76307 none            swap    sw              0       0


No Responses Yet to “Swap partition disappeared on Ubuntu 10.10”

  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: