GPT partitions in Ubuntu

Being able to create logical partitions comes in handy when you have to dual-boot Linux with other operating systems, like Windows, PC-BSD or even another Linux distribution on the same hard drive. And that is especially true if that other operating system has used up three primary partitions.

In Figure 9, which was taken while setting up a system to dual-boot Windows 7 and Fedora 15 (see how to dual-boot Fedora 15 and Windows 7), three Windows 7 partitions already exist on the target hard drive, leaving just one primary partition to play with. Only by setting up the available free space as an extended partition was it possible to install the system. What this also shows is that Linux can boot from a logical partition.

Primary, logical partitions
Figure 9: Another example of an Extended partition in Linux

In Figures 8 and 9, the extended partitions were the last primary partitions (sda4). But it does not have to be. In Figure 10, for example, the extended partition is the second primary partition (sda2) and the first logical partition number is still 5 (sda5). So whether an extended partition is the last primary partition or not, the logical partition number always starts with 5.

Linux disk partitioning guide
Figure 10: Logical partition numbering in Linux

Not all installation programs broadcast the presence of an extended partition. However, if you know what to look for, you can tell if one exists. In Figure 11, for example, you can see the partition numbers start from 1, then jump to 5, 6 and 7. In MBR, that break in numbering is the most obvious tell-tale sign of the existence of an extended partition.

Linux disk partition guide Fedora
Figure 11: How to tell when an extended partition is in use

GPT – As stated earlier, GPT overcomes two limitations of the MBR scheme – maximum of four primary partitions, and the 2 TB limit to partition sizes. Figure 12 shows the partitions on a Toshiba Satellite C55-A Windows 8 computer as seen from the installer of Ubuntu 14.10. (See Dual-boot Ubuntu 14.10 and Window 8 on a Toshiba Satellite C55-A.)

Related Post:  Chronicles of SELinux: Dealing with web content in unusual directories

It’s obvious that there are seven partitions. The most important point to note here is that all seven partitions are primary partitions, as the concept of extended and logical partitions is foreign to GPT.

GPT partitions Linux
Figure 12: GPT partitions in Linux

With GPT, there can always be unallocated space at the end of existing partitions. And unlike in MBR, that “free space” can be used to create additional partitions, unless in the rare instance where the maximum number of partitions possible with GPT has been reached. In Figure 13, for example, there are four partitions and a free space at the end. That space may be used to create new partitions.

GPT partitions in Ubuntu
Figure 13: There is no “unusable” space in GPT

4. File Systems: Before a disk partition can be used to store data, it must first be formatted. The formatting process includes stamping it with a file system. The file system on Windows is NTFS (New Technology File System). It wasn’t really “new technology” when it was released, but everything that Microsoft comes out with is new, even when other outfits have been using it for years.

As with any thing in Linux, there are more than one file systems available. Actually, there are at least two dozen. Figure 14 shows a list of some of the supported file systems in Linux. Ext4, which is an enhanced version of Ext3, is the default on recent releases. Ext3, in turn, is an enhanced version of Ext2. Xfs is rarely used in desktop distributions, but is still popular in server deployments.

Btrfs is a new file system that will soon replace Ext4 as the default Linux file system. It comes with many features that are not available on other Linux file systems, like volume management and RAID awareness. RAID, an acronym for Redundant Array of Inexpensive Disks, is a method of combining two or more hard drives into one logical unit. I do expect to see Btrfs as the default on most Linux distributions by the end of 2015.

Linux filesystems
Figure 14: File systems in Linux

Figure 15 was taken from the advanced partitioning tool window of Ubuntu 14.10 while attempting to install it on a hard drive that already had Windows 8 on it. The Type column shows the file systems for the different partitions. The two with ntfs are Windows 8 partitions and the ext4 type marks a Linux partition.

Related Post:  Replace Ufw firewall with FirewallD on Linux Mint 17 Cinnamon

What about the swap type? Yes, what about swap? Swap is a small section of unformatted hard drive that Linux and other operating systems use as virtual memory. It’s a method of increasing the amount of total RAM (Physical RAM + virtual memory). And it is a given that your distribution will set up a small amount of hard drive as swap space. As in Windows, it is also possible to set up a swap file. However, that practice is most commonly associated with Cloud server deployments.

Linux partitions swap
Figure 15: Swap partition usage in Linux

5. Mount Points: Assigning a mount point to a partition is one of the things that comes with formatting it, aside from stamping it with a file system. In Linux, a partition may be mounted on one of several traditional mount points. On a Linux desktop, the most commonly used mount points are /, /boot, /home, and swap. / is the Linux equivalent of the Windows C drive, /home is where the partition that will hold users’ home directories is mounted, and /boot is the partition for boot loader files.

Linux disk partition guide Mint
Figure 16: Common mount points in Linux

I think that has been a a very basic introduction to disks and disk partitions in Linux. Corrections are always welcome.


Share on facebook
Share on twitter
Share on pinterest
Share on linkedin

Hola! Did you notice that no longer runs network ads?  Yep, no more ads from the usual suspects that track you across the Internet.  But since  I still need to pay to keep the site running, feel free to make a small donation by PayPal.

Subscribe for updates. Trust me, no spam!

Mailchimp Signup Form

Sponsored links

1. Attend Algorithm Conference, a top AI and ML event for 2020.
2. Reasons to use control panel for your server.
3. DHgate Computers Electronics, Cell Phones & more.

17 Responses

  1. Very well written article, but it really didn’t help with a problem.
    Just tried the new Linux Mint 18.3 on my desktop computer.
    I used the live setting with swap partition (300mb). After deciding that yes I want the OS but on my laptop instead, I removed Mint BUT the swap partition is still there and refuses to delete.
    Any ideas on how to do this?

    1. Unlikely you’ll ever encounter it on your system, but the lettering starts all over from a. So it should be sdza, sdzb, sdzc, …, sdzz.

      And on and on and on…

  2. it should be mentioned that logical partitions cannot be used to boot the system; only one of those 4 primary partitions can do that

    1. I think this is mainly for Microsoft Windows. Linux works well with logical partitions; my Ubuntu 18.04 boots from a logical partition without any problem.

    2. AFAIK linux can booting up from logical or extended partition so is no problem where do you install / or /boot partition.

  3. Thank you for an interesting and well written article! Could you please advice on how to install linux on a new computer with two drives, one SSD and one HDD. Is it possible f.ex to have boot, root and swap in three partitions on the SSD and have home in a partition on the HDD? Or would it be better to have the whole Linux installation on the SSD and use the HDD as an extra data storage volume?

    1. Since any data generated on the system will be by you, you can have /home on the HDD, and the other partitions on the SSD. That would be the best configuration.

  4. I installed Kali Linux(dual with windows) on a 200GB extended partition and I am regretting it, since I cannot access that drive unless Im on linux. Why can I not view the extended partition in windows? How to make it accessible? Any other suggestions for me?

    1. Because Kali would probably install the file system as EXT3/4. Windows knows nothing of any of these file systems so to it, they do not exist. You would need to specify fat32 for the file system which would be a bad idea. I do not believe that any linux will install to an NTFS partition but could stand corrected on that.

  5. On my version of ubuntu `fdisk -l` does not list the partition type. The man page specifies that it can not interpret gpt tables. GNU `parted` can.

    `sudo parted -l`

    1. An extended partition is created automatically in the background when you create a logical partition. And that is, if you’re using the installer’s of Ubuntu and its derivatives and any distribution using the new Calamares installer.

      That, of course, only applies if you’re creating the partitions under an MBR partitioning table.

      See Guide to disks and disk partitions in Linux for more on this.

Leave a Reply to Ragil Cancel reply

Your email address will not be published. Required fields are marked *

Get the latest

On social media
Via my newsletter
Mailchimp Signup Form

Sponsored links

1. Attend Algorithm Conference, a top AI and ML event for 2020.
2. Reasons to use control panel for your server.
3. DHgate Computers Electronics, Cell Phones & more.
Hacking, pentesting distributions

Linux Distributions for Hacking

Experts use these Linux distributions for hacking, digital forensics, and pentesting.


The authors of these books are confirmed to speak during

Algorithm Conference

T-minus AI

Author was the first chairperson of AI for the U.S. Air Force.

The case for killer robots

Author is the Director of the Center for Natural and Artificial Intelligence.

Why greatness cannot be planned

Author works on AI safety as a Senior Research Scientist at Uber AI Labs.

Anastasia Marchenkova

An invitation from Anastasia Marchenkova

Hya, after stints as a quantum researcher at Georgia Tech Quantum Optics & Quantum Telecom Lab, and the University of Maryland Joint Quantum Institute, I’m now working on superconducting qubit quantum processors at Bleximo. I’ll be speaking during Algorithm Conference in Austin, Texas, July 16 – 18, 2020. Meet me there and let’s chat about progress and hype in quantum computing.