I'm not sure why your system ended up with 2 swap partitions, but it's easy to fix.
I recommend using gparted
instead of fdisk
or Disk Utility
. You can delete the "extra" swap partition and resize the others to claim the freed disk space. It will also tell you if either swap partitions are being actually used or not. Very helpful. gparted
is not installed by default, but it is available for install in the repositories. It is also pre-installed in Live sessions from the Ubuntu install CD/USB.
About the extended partition: using a traditional partition table, you can only have 4 primary ("non-extended") partitions. Since you already have 3 NTFS/Windows, and you need 2 more for Ubuntu (OS and Swap), this only can be done using an extended partition. So your 4 primary partitions are the 3 NTFS ones + Extended (the extended partition itself takes up 1 "slot"), and the other partitions are within the extended.
Using gparted
, check the status of your swap partitions. If they are locked, it's being currently used by the system. Take note of their status, and decide which one you want to keep and which to delete. Also, right-click them both, go to information, and take note of their UUID (sudo blkid
also works).
The possible scenarios are:
1 - The one you want to delete is NOT being used by the system: nice, just delete the partition.
2 - Both swaps are being used by the system: right-click it the one you want to delete, select Swapoff
. To make that permanent, remove its entries from /etc/fstab
and /etc/initramfs-tools/conf.d/resume
(deleting the lines that match its UUID). Now you can safely delete the partition.
3 - Just the one you want to delete is being used, the one you want to keep is not: right-click the one you want to delete, select Swapoff
. Right-click the other, select Swapon
. Edit /etc/fstab
and /etc/initramfs-tools/conf.d/resume
, and replace the UUID from one to the other. Delete the unwanted partition.
If any changes are made to /etc/initramfs-tools/conf.d/resume
, use the following command to apply the changes:
sudo update-initramfs -u
If you have any question about the answer, feel free to ask!
sudo fdisk /dev/sda
and use x (extra functionality), then f (fix partition order), then w (write table to disk and exit). Then retry in gparted. – MestreLion May 26 '11 at 11:55/etc/fstab
and/etc/initramfs-tools/conf.d/resume
and now everything work well. – Binarylife May 26 '11 at 12:07