Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

up vote 31 down vote accepted

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.

share|improve this answer
1  
It's also only a restriction on IDE-type discs. SCSI, for example, have 8, with the third by convention being an overlap partition that spans the entire device. –  MadHatter Apr 22 at 11:40
16  
@MadHatter the partition table by itself is storage type agnostic. It seems that you are describing Solaris Slices, which are a slightly different concept. –  the-wabbit Apr 22 at 11:45
3  
I haven't thought that to be the case, but you're dead right that most of my SCSI partitioning experience is from Solaris. I bow to your correction, and thank you! –  MadHatter Apr 22 at 11:46
3  
Actually, extended partitions came much later; IBM PC DOS 2.0 introduced the MBR as part of its HDD support in March 1983, but it wasn't until 3.3 (April 1987) that extended partitions became available. –  Michael Kjörling Apr 22 at 14:38
    
Actually, the "extended partition" simply points to another MBR-style partition table, which in turn can also contain only 4 entries (each of which could be an extended partition entry that points to another partition table, which can also contain 4 entries (each of which could be an extended partition …)) I reality some operating systems only allow extended partitions in slot 4 and if there is one, then slots 2 and 3 need to be empty, so what you end up in practice is a singly-linked list of partition tables with a primary in slot 1 and a link to the next table in slot 4. –  Jörg W Mittag Apr 22 at 14:56

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.

share|improve this answer

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)

share|improve this answer
1  
I think you're wrong about not being able to boot off one; I think GRUB will happily boot Linux from an extended partition. Other than that, I mostly agree with you. –  MadHatter Apr 22 at 11:38
    
GRUB itself has to be on a primary partition though - the low level bootstrap starts grub, that then lets you pick. –  Sobrique Apr 22 at 11:41
1  
The stage 1 loader shouldn't be on a partition at all; it should be in the MBR. The rest of the code lives inside the /boot partition, and as I say, I believe that can happily be an extended partition. –  MadHatter Apr 22 at 11:42
    
Fair enough. I'll go read up and do my homework. But I suppose still supports the case that whilst primary partitions are limited, that limit is largely irrelevant now. –  Sobrique Apr 22 at 11:49
    
Sorry, that should read "stage 1 and 1.5 loaders", and even then, stage 1.5 is in unused post-MBR-pre-partition space. But stage 2 is firmly in the /boot partition, and I'm still confident that can be on a logical partition. I agree with you that it's fairly irrelevant in a modern LVM context. –  MadHatter Apr 22 at 11:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.