Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I recently did a fresh install of Ubuntu 12.04 andpurposly got rid of my windows partition and my original swap partition in the process. Now my system won't see any swap space. My partition table is set up like this:

  • /dev/sda2 ext4 459.24GB (main ubuntu partition)

  • /dev/sda1 linux-swap 6.52GB (unrecognized swap space)

I even ran the free command in the terminal and it wouldn't see anything:

    _zach@Skynet:~$ free

                 total       used       free     shared    buffers     cached
    Mem:       4048624    1782908    2265716          0      42332     709264
    -/+ buffers/cache:    1031312    3017312
    Swap:            0          0          0

    zach@Skynet:~$ 

So my question is, what can I do to get my system to recognize my swap?

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted
  1. In a terminal, run the command

    sudo blkid
    

    This command is used to locate/print block device attributes.

  2. Then read the file /etc/fstab with the command cat /etc/fstab. You are looking for an entry denoting your swap partition, if it isn't there then

    sudo gedit /etc/fstab
    

    and add a line at the end of fstab to automount your swap partition. It will read as follows:

    UUID=<enter here the UUID for your /dev/sda1 device> none swap sw   
    
  3. Save the fstab file and then reboot.

share|improve this answer
    
Why does the UUID changes after partition resizing ? –  smonff Jul 15 '13 at 13:36
1  
I don't know, possibly because (being a different size) it is now effectively a 'new' partition? –  Clive van Hilten Jul 16 '13 at 11:46
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.