Back to Top

Thursday, April 05, 2007

Moving to Ubuntu - swap partition

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 free command to check if your swap partition is activated (on the last line where it says Swap you should see a non-zero value if it's active)
  • From ubuntuguide: you can use the sudo fdisk -l command 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/fstab file to point it to the corect swap partition. After restart, you should issue the free command 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 comments:

  1. Anonymous11:16 PM

    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.

    ReplyDelete
  2. Anonymous1:50 AM

    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.

    ReplyDelete
  3. Anonymous5:10 AM

    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...

    ReplyDelete