This section describes the master boot record (MBR) partitioning scheme, as used in DOS, Microsoft Windows and Linux on PC compatible computer systems. For examples of partitioning schemes used in other operating systems, see the general article on partition tables.
The total data storage space of a PC hard disk can be divided into at most four primary partitions, or alternatively three primary partitions and an extended partition. These partitions are described by 16-byte entries that constitute the Partition Table, located in the master boot record.
The partition type is identified by a 1-byte code found in its partition table entry. Some of these codes (such as 0x05 and 0x0F) may be used to indicate the presence of an extended partition. Most are used by an operating system's bootloader (that examines partition tables) to decide if a partition contains a file system that can be used to mount / access for reading or writing data.
Once a specific partition's type has been identified, additional information about its purpose and probable contents may be found (see: list of partition types). For example, some partition type codes are used to hide a partition's contents from various operating systems. However, if an OS or some partitioning tool has been programmed to also examine the boot sectors of any partition, then its file system may no longer remain hidden. (Note: There are no officially assigned partition types; thus, more than one kind of file system may lay claim to the same code value.) Additionally, partition types and boot indicators can be easily modified using applications such as MBRWizard if required.
A primary partition contains one file system. In DOS and earlier versions of Microsoft Windows systems, the system partition was required to be the first partition. Windows operating systems must be located in a primary partition. Other operating systems do not have this peculiar requirement. However, other factors, such as a PC's BIOS (see Boot sequence on standard PC) may also impart specific requirements as to which partition must contain the primary OS.
The partition type code for a primary partition can either correspond to a file system contained within (e.g. 0x07 means either an NTFS or an OS/2 HPFS file system) or indicate that the partition has a special use (e.g. code 0x82 usually indicates a Linux swap partition). The FAT16 and FAT32 file systems have made use of a number of partition type codes due to the limits of various DOS and Windows OS versions. Though a Linux operating system may recognize a number of different file systems (ext4, ext3, ext2, ReiserFS, etc.), they have all consistently used the same partition type code: 0x83 (Linux native file system).
A hard disk may contain only one extended partition; the extended partition can be subdivided into multiple logical partitions. In DOS/Windows systems, each logical partition may then be assigned an additional drive letter. Linux operating systems can be installed into (and run from) logical partitions, whereas Windows operating systems are restricted to primary partitions.
See extended boot record for information on the structure of an extended partition.
Disk partitioning is the act of dividing a hard disk drive into multiple logical storage units referred to as partitions, to treat one physical disk drive as if it were multiple disks. Partitions are also termed "slices" for operating systems based on BSD, Solaris or GNU Hurd. A partition editor software program can be used to create, resize, delete, and manipulate these partitions on the hard disk.