24

I'm reading the docs over at CentOS.org.

In section 25.1.2. Partitions: Turning One Drive Into Many, there is the following statement:

The partition table is divided into four sections or four primary partitions. A primary partition is a partition on a hard drive that can contain only one logical drive (or section). Each section can hold the information necessary to define a single partition, meaning that the partition table can define no more than four partitions.

I don't understand why there can only ever be four partitions. Is this just the way it was designed in the beginning? Can there really only ever be 4 primary partitions?

HopelessN00b
  • 54,273
Jongosi
  • 364

4 Answers4

37

Is this just the way it was designed in the beginning? Can there really only ever be 4 primary partitions?

Yes, that's exactly it. The partition table at the front of an MBR disk (as opposed to a GPT style disk) has a very strict data-structure that dates from the 1980's when space was a precious, precious thing. The design decision way back then was to only allow four partitions, but allow one of them to be an 'extended' partition that was a pointer to another spot on the disk that could contain a lot more 'logical' partitions.

(This is the same reason why MBR formatted disks have trouble with 2TB+ disks. 512 byte size clusters, and 32bit fields containing cluster-counts for partition size = 2TB maximum disk size. A 4KB cluster size punts the problem down the road a ways.)

GPT is an updated method of handling partitioning that doesn't have these limitations.

sysadmin1138
  • 135,853
26

There are only four because the data structures for the MBR partition table only allow for exactly four records describing partitions:

You could create additional partition tables nested in definitions of what is called an "extended partition", but the partitions defined therein are traditionally called "logical" partitions. Keep in mind that this is a limitation of this specific implementation. Other partition types, like the GUID partition table, do not share this limitation.

the-wabbit
  • 41,352
3

A primary partition is a low level concept - it's to do with the initial booting process of the machine, and is based on a well defined set of specifications. It's thus really quite hard to change the number of primary partitions, because a lot of disk and motherboard manufacturers would have to agree to implement a new standard.

Practically speaking though, this is a moot point - it's of relevance at 'boot time' for getting your OS started in the first place, but that's about it. Extended partitions exist, which allow more partitions on your disk. You couldn't boot off them though.

More fundamentally - most operating systems work with more disk abstraction - logical volume managers - which means that actual on-disk topology is largely irrelevant. (And indeed, it's often not desirable to segment your pool of storage)

Sobrique
  • 3,817
0

Not sure if I am late to the party , but here it goes:

The Partition table size is designed to be 64 bytes and each partition table is 16 bytes. 16 * 4 = 64 and hence there is no more space for any other entries in the partition table.

In order to workaround this the fourth entry has a provision for an Extended partition entry which can have sequential pointers to other Extended partitions.

https://docs.microsoft.com/en-us/windows/win32/fileio/basic-and-dynamic-disks

Guru
  • 3