1

I finally decided to replace Windows Vista by Ubuntu. I needed several attempts as I am not experienced with disk partitions. I want to have only one partition with ubuntu installed there. I managed to install ubuntu. However, I have three partitions instead of only one, please look at the picture.

enter image description here

I want to delete two redundant partitions so that only one remains.

Details on the partitions:

  1. Partition type: Linux (Bootable); Contents: Ext4 (version 1.0) — Mounted at Filesystem Root

  2. Partition type: Extended; Contents: Extended Partition

  3. Partition type: Linux swap; Contents: Swap (version 1) — Active

I guess that I can keep only the first partition and delete the others. However, when I try to delete one of those two partitions, I receive the following error message:

Error deleting partition: Error deleting partition /dev/sda2: Command-line `parted --script "/dev/sda" "rm 2"' exited with non-zero exit status 1: Warning: Partition /dev/sda2 is being used. Are you sure you want to continue? (udisks-error-quark, 0)

What can I do now?

2

The swap partition is the traditional way in Linux of handling what in Windows is called "virtual memory". That is, when you run out of RAM (among other situations; other examples of things that use swap include hibernating the system (suspend to disk)), the swap partition will be used as an "overflow" for things that won't fit in RAM (which of course will be slower but means your system can keep running rather than having to crash or kill processes seemingly at random).

So, the simple answer is that you don't need to delete this partition; it's a normal part of Ubuntu.

The "extended partition" can be seen as a "container" for additional partitions. Because it's a very old format dating from the IBM PC/MS-DOS days, the partition table used on modern computers only allows four partitions by default. In order to let you have more than this, systems will create an "extended partition" which is just another (more powerful) partition table stored in place of a partition, effectively giving you the ability to create any number of partitions rather than just four.

(If you really positively do want to delete it, which I don't recommend at all, you can stop the system from using it by typing "sudo swapoff /dev/sda3" at a terminal before deleting it.)

  • Ok, thank you for the clarification. I wondered why the partition is named "Linux swap". Do have any idea about the second partition? – Pako Nov 10 '16 at 18:50
  • I've just edited my answer, as I realised I didn't mention it. It's a bit more complicated to explain, it's basically a container for more partitions. – Muzer Nov 10 '16 at 18:51
  • Thanks. I will certainly keep the "Linux swap" partition. But I don't think I will ever need more than four partitions, so is there any way to delete the "extended partition"? Or is there any good reason to keep it anyway? – Pako Nov 10 '16 at 18:53
  • To delete it you'd have to first delete the swap partition, then recreate it afterwards. It's possible, but it'll literally only save 512 BYTES of space (correct me if I'm wrong, someone), and so really, given the size of modern hard drives, it's causing no harm by being there. – Muzer Nov 10 '16 at 18:54
  • Well, the size of the extended partition is 4,3 GB. If I can somehow resolve this issue by reinstalling ubuntu for example, then I have no problem with that (as I have a fresh install anyway). But I am not sure if that would help. – Pako Nov 10 '16 at 18:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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