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 accidentally deleted my swap partition via gparted.

(I'm still logged in the system so restoring should be easier) Can someone help me please? I'm not sure how to configure it because the Ubuntu installation did it automatically.

There are 3 partitions right now:

  /dev/sda1 -> Ubuntu installation root, mounted at '/'

  /dev/sda2 -> Windows partition

  /dev/sda3 -> Fedora partition

and /dev/sda4 if im not mistaken was the swap partition (4GB size)

share|improve this question

1 Answer 1

up vote 7 down vote accepted

Just use gparted again to create the additional /dev/sda4 partition, and format it as type "linux swap".

Example:

  • Here, I deleted the my /dev/sda6 swap partition in the highlighted space:

    enter image description here

  • Right-click on that unallocated space, and click on New; choose type "linux-swap", click on Add:

    enter image description here

  • Apply changes

  • Right-click on the new swap partition and choose "swapon":

    enter image description here

  • Unless you removed it, the swap entry in /etc/fstab should still be there.

    • Check from the terminal with: grep swap.*sw /etc/fstab, and you should see a long line like:
    UUID=adc15cab-1cd4-4278-9a1d-59016cced6dd none swap sw  0  0
    • If you do not see such a line, obtain the UUID using sudo blkid | grep swap, and add a line in this format to /etc/fstab.
share|improve this answer
    
I dont see the swap partition listed in fstab. The only sda* entry in fstab is sda1 (which is the root '/' ) –  Adonis K. Aug 26 '12 at 18:29
1  
@Varemenos: please see edited answer. –  izx Aug 26 '12 at 20:44

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.