Ubuntu – Why does Ubuntu 16.04 installation create an extended partition besides the swap

16.04partitioning

I'm installing Ubuntu 16.04 on a 200-GB hard-disk (with 4-GB ram installed). When I let the installation do partitioning for me, it created the following partitions.

Ubuntu auto-partitioning on 200GB hard disk with 4GB ram:

The images shows the following partitions,

  1. Filesystem – 196 GB Ext4 (/dev/sda1)
  2. Extended Partition – 4.2 GB (/dev/sda2) (highlighted in the image)
  3. Swap – 4.2 GB (/dev/sda5)

I canceled and restarted the installation to check how those partitions look like. At one step in the installation you can see the current partitions, and I didn't find the extended partition (highlighted in the image), which means it's not in use. Then why Ubuntu Installation created this partition?

enter image description here

Best Answer

The installer, which Ubuntu inherited from Debian, wants to make sda1 to hold the root filesystem and sda5 to hold the swap area, for reasons which were never articulated and are forever lost in the mist of time. It cannot create sda5 directly, because the old-style Master Boot Record (MBR) partition table cannot have more than 4 entries; to make more than 4 partitions on a MBR-partitioned disk one has to designate one of those 4 entries as an "extended partition" and make the extra partition(s) inside it. Thus you get sda1 for the root file system, an extended partition, and sda5 inside the extended partition. Note that the extended partition is just a container for sda5, it does not have any disk space of its own.

You can always opt for manual partitioning and create the partitions the way you want them to be.