A quick note about how extended partitions work

September 12, 2006

Hard disk partitioning on PCs is one of those confusing areas, full of peculiar features and apparently random limitations, especially the whole primary partitions versus extended partitions thing.

Fortunately, it's actually fairly simple:

  • primary partitions are just a fixed size array in the first sector (the master boot record, among other things).
  • extended partitions are a chain (a linked list).

Each extended partition starts with a sector (the 'extended master boot record') that describes how big it is and then points to the next extended partition. The whole collection forms a singly-linked list.

One important consequence of this is that changing extended partitions around does destroy some sectors in your current extended partitions, because they get overwritten to set up the new chain. By contrast, changing primary partitions doesn't touch anything besides the MBR.

(Removing extended partitions is not destructive, though, since it doesn't change any sectors that weren't already being used as part of the chain.)

Also, apparently there is no requirement that the chain be ordered by increasing location; you can have a set of extended partitions that zoom around the disk like lost bumblebees. (I admit that I am not quite sure how this works, since the format the Wikipedia page describes seems to forbid that unless you get really creative. But evidently it works, which opens up a pile of other creative tricks.)

Like a lot of things about the PC, primary partitions and extended partitions are quick fixes piled on top of quick fixes, always preserving backwards compatibility. When four partitions turned out to not be enough, the hard disk partitioning scheme wasn't replaced entirely, just augmented.

(And in isolation, the extended partition scheme is not bad; it does have the virtue that it has no arbitrary limits on how many extended partitions you can have. It also needs no BIOS upgrades.)

Written on 12 September 2006.
« Python's extra-clever help() function
The really irritating thing about voicemail »

Page tools: View Source, Add Comment.
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Tue Sep 12 23:43:46 2006
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.