Guide to disks and disk partitions in Linux

Extended and Logical Partitions

This article is an attempt to provide basic information about disk naming and partition numbering conventions, in non-technical terms, to those new to Linux. So, it’s a Linux disk partitioning guide. I believe a basic understanding of all the aspects concerning how a disk is referenced and partitioned will put you in a better position to troubleshoot installation and disk-related problems.

Basic information about partition tables and the difference between primary and logical partitions will be covered.

Hard Drive Naming Convention: – The first thing you need to know is there is no “C drive” or “D drive” in Linux. There are equivalents, but when you come across a reference to a hard drive in a modern Linux system, you will typically see something like /dev/sda, /dev/sdb, /dev/sdc, … etc. The “dev” is short for device, and in this case, a block storage device. The “sd” is short for SCSI mass-storage driver. (SCSI stands for Small Computer System Interface.) For the rest of this article, the “/dev/” will be dropped, so all references to hard drives and partitions will start with the last part only.

The first hard drive detected by a Linux system carries the sda label. In numerical terms, it is hard drive 0 (zero; counting begins from 0, not 1). The second hard drive is sdb, the third drive, sdc, and so on. In the screenshot below, there are two hard drives – sda and sdb, detected by the installer.
Partitions in Linux guide

This screenshot comes from an installation attempt where three hard drives were attached to the system.
3 Partitions in Linux

Partition Tables: – A partition table describes the partitions of a hard drive or any storage device. And there are two standards for the layout of the partition table – MBR (Master Boot Record) and GPT (GUID Partition Table). MBR, also know as ms-dos, is what you might call the first standard. GPT came much later. While MBR is still the most widely used partition table, it comes with two major limitations which led to the development of GPT. They are:

  1. It does not allow the configuration of more than four main partitions. Those partitions are called primary partitions.
  2. Disk partitions may not exceed 2TB

The first limitation will be discussed in the next section. Nothing more will be written about the second in this article.

Partitions and Partition Numbering: – To install an operating system on a hard drive, it must first be subdivided into distinct storage units. Those storage units are called partitions. Under the MBR partitioning scheme, which is the default on virtually all Linux distributions, there are three different types of partitions – Primary, Extended, and Logical. Extended, and Logical partitions will be discussed further down.

Related Post:  How To Make Python Run As Fast As Julia

With MBR, any partition that is not explicitly created as an extended or logical partition, is a primary partition. And, as stated earlier, there can be no more than four primary partitions. The screenshot below was taken from an installation process where four primary partitions were created. If you observe closely, you will see that the first primary partition is sda1 and the last sda4. Unlike hard drives, partition numbers start from 1, not 0 (zero). Any space not allocated to the primary partitions is shown as “Free.” But while it may be free, it is, however, unusable. And that is because as far as the system is concerned, that free space does not exist.
Guide to Linux disk partitioning Debian

So if you attempt to create another partition using the free space, the installer will throw up the type of error message shown in this image. The error message will always say, “not enough free space,” even when you know that there is space available. And it does not matter how much that free space is. It will be unusable.
Linux Disk partition guide Error

To get around the four primary partitions limit of the MBR partition table, the smart guys involved came up with the concept of an extended partition. By tagging a partition as an extended partition, it is then possible to create many more partitions under the extended partition. Those partitions are called logical partitions. Theoretically, there is no limit to the number of logical partitions that you can create. Note: Only one extended partition may be configured on a single hard drive.

What the concept of extended partition brings to the table is illustrated in the screenshot below. You can see that there are three primary partitions (sda1, sda2 and sda3). And the fourth partition is an extended partition, which makes it possible to create more partitions (sda5, sda6 and sda7 in this example). Under an extended partition, you can have free space, and that free space will still be usable. So you do not have to allocate all the available free space to the logical partitions of an extended partition.
Extended and Logical Partitions

Being able to create logical partitions comes in handy when you have to dual-boot a Linux distribution with other operating systems like Windows, PC-BSD or even another Linux distribution, especially if that other operating system has used up three primary partitions. In the image below, 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. That meant there was 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

Related Post:  Disk encryption in ROSA Marathon 2012

In the last two screenshots, the extended partitions were the last primary partitions (sda4). But it does not have to be. In this screenshot, for example, the extended partition is the second primary partition (sda2), and 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 the number 5.
Linux disk partitioning guide

Not all installation programs broadcast the presence of an extended partition. But if you know what to look for, you can tell if one exists. In the image below, for example, you can see the partition numbers go from 1, then 5, 6 and 7. The presence of partition number 5 and above, is the most obvious tell-tale sign of an extended partition. This image, by the way, was taken while installing Ubuntu.
Linux disk partition guide Fedora

GPT: – As stated earlier, GPT, or GUID Partition Table, overcomes two limitations of the MBR scheme – maximum of four primary partitions, and the 2TB limit to partition sizes. In the image below, for example, you can see that there are eight partitions, with about 45GB still available. The most important point to note here is that all eight partitions are primary partitions, as the concept of extended and logical partitions is foreign to GPT.
Linux disk partition guide Ubuntu

With GPT, there can always be unallocated space at the end of existing partitions. And unlike the case with an MBR scheme that has no extended partition, that “unallocated” space can be used to create new or additional partitions, unless the maximum number of partitions possible with GPT has been reached. In the image below, for example, there are six partitions and a small unallocated space remaining. The unallocated space may be used to create a new partition.
Linux disk partition guide Mint

Currently, Chakra is the only Linux distribution that is configured to use GPT by default. You may read GPT disk partitioning guide for Chakra to see the steps involved. Fedora 16, which is slated for release in early November 2011, will support GPT. Test installations of the first beta release show that GPT will be the default in standalone installations. In dual-boot setups, MBR will be used if there is an existing operating system installed on MBR partitions on the target disk. You may read feature preview of Fedora 16 installer and Fedora 16 KDE and GNOME alpha screenshots for a few screenshots of GPT partitions in Anaconda, the Fedora system installer.


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

Hola! Did you notice that no longer run network ads?  Yep, no more ads from the usual suspects that track and annoy 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 or your favorite cryptocurrency.

  • Bitcoin
  • Ethereum
  • Xrp
  • Bitcoin cash
  • Bitcoin sv
  • Litecoin
  • Binance coin
  • Cardano
  • Ethereum classic
Scan to Donate Bitcoin to bc1qzvlte2m224zkayhdc7fdfjkp2rsgt0l5a496ua

Donate Bitcoin to this address

Scan the QR code or copy the address below into your wallet to send some Bitcoin

Scan to Donate Ethereum to 0x0F4362DFF77F3Ba0Dc637F5f3Eba35D09a2fA60C

Donate Ethereum to this address

Scan the QR code or copy the address below into your wallet to send some Ethereum

Scan to Donate Xrp to r4ggjvL36njsMCYTkJ3S7cTHscPsMsSGQv

Donate Xrp to this address

Scan the QR code or copy the address below into your wallet to send some Xrp

Scan to Donate Bitcoin cash to qrs0dedzp9t55af3nfwypydghp29r0xguy9s20fz2k

Donate Bitcoin cash to this address

Scan the QR code or copy the address below into your wallet to send some Bitcoin cash

Scan to Donate Bitcoin sv to 15K9TLyVDBtLuG9cYvXCX9SSkq9C9oUKHK

Donate Bitcoin sv to this address

Scan the QR code or copy the address below into your wallet to send some Bitcoin sv

Scan to Donate Litecoin to LetJ9QQMb7u2LMZ9Tu6rtHwcBcQFW98fbG

Donate Litecoin to this address

Scan the QR code or copy the address below into your wallet to send some Litecoin

Scan to Donate Binance coin to bnb1ga8trq08ssqepd90v6225nzfgy448pu5pw8gxp

Donate Binance coin to this address

Scan the QR code or copy the address below into your wallet to send some Binance coin

Scan to Donate Cardano to addr1qx2354yw49etstfljpdhwja3ajjlt487lg95vu9ngy2q6vu4rf2ga2tjhqknlyzmwa9mrm997h20a7stgectxsg5p5esq5l7d9

Donate Cardano to this address

Scan the QR code or copy the address below into your wallet to send some Cardano

Scan to Donate Ethereum classic to 0xcD6CC972a2297FcafACDcfE042C55C69516a9264

Donate Ethereum classic to this address

Scan the QR code or copy the address below into your wallet to send some Ethereum classic

Subscribe for updates. Trust me, no spam!

Sponsored links

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

Upcoming events

27 Responses

  1. i’m use gpt partition and uefi, can i install dual boot deepin os and windows 10? i’m on windows 10 now

  2. I have lost count how many times I lost my HDD data due to messing up with partitions while trying to install linux since Ubuntu 8.04. After a decade I am still trying and messed up with the 750GB HDD data on this laptop just two days ago. However I am hopeful with the Mint 17.1 this time and I am about to repartition this one. Without argue, your explanation is quite something. Like someone said above, you can communicate meaning when nobody seems to make sense.
    Thank You!

  3. I have a hp dv7 with win 7 2td h/drive partitioned in half. Tryed to load mint along side but mint would’nt see win 7 it started to load mint on the other half 1tb the boot loader would’nt see both and win 7 started again. I allacated more space on the same drive as (shrunk) win7, mint will not see win7. So I droped the partition this inturn droped win 7. Could’nt install win 7 but mint installed after installation I still have 2tb hard drive partitioned in 2 1tb partitions. I have to install win 7 then mint on the same 1tb but mint will not see it. My computer came from the factory partitionrd can it be droped and how. I use mint more than win 7 but there are some programs that only work on windows. Hope you can understand al of that…..

      1. I don’t think the installer of Mint 15 has support for UEFI hardware. Try Mint 17 and even at that, use the Something else option when it comes to disk partitioning step of the installation process.

  4. Just what I was looking for! This is invaluable information for beginners like me. Extremely well written and can’t be any easier to understand 🙂


  6. extremely well written and very very helpful post!!!!
    i had a serious confusion with the linux tree because i have been using windows all my life and couldn’t convert my brain from C: to sda.–__–…thanks a lot for this post..:D

  7. You’re simply the best.
    You should think of writing a book on Linux.
    What ever subject, no meter how complicated, it seems you have the ability to get the message to the others

  8. Yup, this really is a fantastic article. It’s so clear and concise. And the information covered is very useful. I wish there were more articles like this one. Thanks!

  9. Can you add information about UUID and disk labels please? Distributions are going the UUID route but you can get around ugly UUIDs by labeling your disks. Much appreciated. Thanks.

  10. In the 5th picture (counting the error message picture), you point to the free space and say its “Free (and usable) space”. But that’s only true IF you made the extended partition bigger…? Isn’t it? Cause it’s outside the extended partition…

  11. This is the Best Article I have ever read on Partitions!! and I’m gonna spread it and use it to tech my friends!

    Thank You!!! This has helped me learn the key concepts in partitions, even though I have been using linux for past 4 years!

    1. Yes, I agree totally, a brilliant explanation of partitioning drives, including starting out with the acronyms, and explanations of the words relating to those acronyms which are mostly omitted in other tutorials, and often leaves those new to a subject scratching their heads before they have completed the first paragraph.

Leave a Reply

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

Get the latest

On social media
Via my newsletter

Partner links

1. Attend Algorithm Conference, a top AI and ML event for 2021.
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.