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

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.


The swap partition is made as an extended partition to make it simpler to add extra partitions later. This way, there's space for future changes with minimal impact.

Else if you even add another partition by shrinking the sda1 and making a new primary, the swap may just change to sda3 instead of sda5. In which case some settings will have to be adjusted so it can still be used.