I continued to perfect the solution for the Ubuntu swap partition problem (although I just upgrated to 1G of memory so it doesn’t manifest itself as quickly as before, w00t!), and would like to share my results:
- As posted earlier, you can use the
freecommand to check if your swap partition is activated (on the last line where it says
Swapyou should see a non-zero value if it’s active)
- From ubuntuguide: you can use the
sudo fdisk -lcommand to find your swap partition (you can identify it by the system type where it should say
Linux swap / Solaris). Alternatively you can use gparted (not installed by default) to visually view your partition scheme.
- If you want to go the UUID route, you can find out the UUID which corresponds to a certain partition by doing
sudo vol_id -u device(in my case this would translate to
sudo vol_id -u /dev/hda5) – thanks to this blog post
- Now you have enough information to adjust your
/etc/fstabfile to point it to the corect swap partition. After restart, you should issue the
freecommand again to make sure that your swap partition got mounted properly.
One reason for using the old
/dev syntax would be that gparted seems to change the UUID of the swap partition when it moves it around (most recently I lost my swap partition when I was resizing the partitions on my machine).
3 responses to “Moving to Ubuntu – swap partition”
Having set up ubuntu amd64 workstation on three software raid multi-disks I found my swap partition was unrecognised. Looking in the /etc/fstab file I was able to fix the problem. Thank you for your helpful page.
My computer hung up everytime my RAM was full. I wondered about not using swap memory at all… Found your page and have been glad about fixing it. Thanks.
I used this post to help me fix a problem that still exists even a year later, but I’ve discovered other posts related even older…so much for LTS…