Disk partitioning ordisk slicing[1] is the creation of one or more regions onsecondary storage, so that each region can be managed separately.[2] These regions are called partitions. It is typically the first step of preparing a newly installed disk after a partitioning scheme is chosen for the new disk before anyfile system is created. The disk stores the information about the partitions' locations and sizes in an area known as the partition table that the operating system reads before any other part of the disk. Each partition then appears to the operating system as a distinct "logical" disk that uses part of the actual disk.System administrators use a program called apartition editor to create, resize, delete, and manipulate the partitions.[3] Partitioning allows the use of different filesystems to be installed for different kinds of files. Separating user data from system data can prevent the system partition from becoming full and rendering the system unusable. Partitioning can also make backing up easier. A disadvantage is that it can be difficult to properly size partitions, resulting in having one partition with too much free space and another nearly totally allocated.
One of the earliest such forms of segmentation of a disk drive was IBM's 1966[4] usage in itsCP-67 operating system ofminidisk as a separate segment of a hard disk drive.[5]
Data General'sRDOS operating system for theirNova computers used the termpartition for subregions of a disk. Each partition had its own directory.[6][7]
IBM in its 1983 release ofPC DOS version 2.0 also used the termpartition to describe dividing a block storage device such as anHDD into physical segments. The term's usage is now ubiquitous.[citation needed] Other terms used includelogical disk,[8]minidisk,[5]portions,[9]pseudo-disk,[9]section,[9]slice[10] andvirtual drive.[11]
WithDOS,Microsoft Windows, andOS/2, a common practice is to use one primary partition for the activefile system that will contain the operating system, the page/swap file, all utilities, applications, and user data. On most Windows consumer computers, thedrive letter C: is routinely assigned to this primary partition. Other partitions may exist on the HDD that may or may not be visible as drives, such as recovery partitions or partitions with diagnostic tools or data. (Windows drive letters do not correspond to partitions in a one-to-one fashion, so there may be more or fewer drive letters than partitions.)
MicrosoftWindows 2000 and later versions include a 'Disk Management' program which allows for the creation, deletion and resizing of FAT and NTFS partitions. The Windows Disk Manager in Windows Vista and Windows 7 utilizes a1 MB partition alignment scheme which is fundamentallyincompatible with Windows 2000, XP, OS/2, DOS as well as many other operating systems.
OnUnix-based andUnix-like operating systems such asLinux,macOS,BSD, andSolaris, it is possible to use multiple partitions on a disk device. Each partition can be formatted with afile system or as aswap partition.
Multiple partitions allow directories such as/boot,/tmp,/usr,/var, or/home to be allocated their own filesystems. Such a scheme has a number of advantages:
A common minimal configuration for Linux systems is to use three partitions: one holding the system files mounted on "/" (theroot directory), one holding user configuration files and data mounted on /home (home directory), and a swap partition.
By default, macOS systems also use a single partition for the entire filesystem and use aswap file inside the file system (like Windows) rather than a swap partition.
In Solaris, partitions are sometimes known asslices. This is a conceptual reference to the slicing of a cake into several pieces.
The term "slice" is used in theFreeBSD operating system to refer toMaster Boot Record partitions, to avoid confusion with FreeBSD's owndisklabel-based partitioning scheme. However,GUID Partition Table partitions are referred to as "partition" worldwide.
Multi-boot systems are computers where the user can boot into more than one distinct operating system (OS) stored in separate storage devices or in separate partitions of the same storage device. In such systems a menu atstartup gives a choice of which OS to boot/start (and only one OS at a time is loaded).
This is distinct fromvirtual operating systems, in which one operating system is run as a self-contained virtual "program" within another already-running operating system. (An example is a Windows OS "virtual machine" running from within a Linux OS.)
TheGUID Partition Table (GPT) (GUID is fromGloballyUniqueIDentifier) is a part of theUnified Extensible Firmware Interface (UEFI) standard for the layout of thepartition table on a physicalhard disk. Many operating systems now support this standard. However, Windows does not support this on BIOS based computers.[12]
When a partition is deleted, its entry is removed from a table and the data is no longer accessible. The data remains on the disk until it is overwritten.Specialized recovery utilities may be able to locatelost file systems and recreate a partition table which includes entries for these recovered file systems. Some disk utilities may overwrite a number of beginning sectors of a partition they delete. For example, if Windows Disk Management (Windows 2000/XP, etc.) is used to delete a partition, it will overwrite the first sector (relative sector 0) of the partition before removing it. It still may be possible to restore aFAT orNTFS partition if a backup boot sector is available.
HDDs can be compressed to create additional space. In DOS and early Microsoft Windows, programs such asStacker (DR-DOS except 6.0),SuperStor (DR DOS 6.0),DoubleSpace (MS-DOS 6.0–6.2), orDriveSpace (MS-DOS 6.22, Windows 9x) were used. This compression was done by creating a very large file on the partition, then storing the disk's data in this file. At startup, device drivers opened this file and assigned it a separate letter. Frequently, to avoid confusion, the original partition and the compressed drive had their letters swapped, so that the compressed disk is C:, and the uncompressed area (often containing system files) is given a higher name.
Versions ofWindows using the NT kernel, including the most recent version,Windows 10, contain intrinsic disk compression capability. The use of separate disk compression utilities has declined sharply.
Apartition table is a table maintained on a disk by the operating system that outlines and describes the partitions on that disk.[13] The termspartition table andpartition map are similar terms and can be used interchangeably. The term is most commonly associated with theMBR partition table of aMaster Boot Record (MBR) inPCs, but it may be used generically to refer to other formats that divide a disk drive into partitions, such as:GUID Partition Table (GPT),Apple partition map (APM),[14] orBSD disklabel.[15]
This section describes themaster boot record (MBR) partitioning scheme, as used historically inDOS,Microsoft Windows andLinux (among others) onPC-compatible computer systems. As of the mid-2010s, most new computers use theGUID Partition Table (GPT) partitioning scheme instead.[citation needed] For examples of other partitioning schemes, see the general article onpartition tables.
The total data storage space of a PC HDD on which MBR partitioning is implemented can contain at most fourprimary partitions, or alternatively three primary partitions and anextended partition. ThePartition Table, located in the master boot record, contains 16-byte entries, each of which describes a partition.
Thepartition type is identified by a 1-byte code found in its partition table entry. Some of these codes (such as0x05 and0x0F) may be used to indicate the presence of anextended 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 bemounted / accessed for reading or writing data.
A primary partition contains one file system. InDOS and all early versions ofMicrosoft Windows systems,Microsoft required what it called thesystem partition to be the first partition. All Windows operating systems from Windows 95 onwards can be located on (almost) any partition, but the boot files (io.sys
,bootmgr
,ntldr
, etc.) must reside on a primary partition. However, other factors, such as a PC'sBIOS (seeBoot sequence on standard PC) may also impose specific requirements as to which partition must contain the primary OS.
The partition typecode for a primary partition can either correspond to a file system contained within (e.g.,0x07 means either anNTFS or an OS/2HPFS file system) or indicate that the partition has a special use (e.g., code0x82 usually indicates a Linuxswap partition). TheFAT16 andFAT32 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).
An HDD may contain only one extended partition, but that extended partition can be subdivided into multiple logical partitions. DOS/Windows systems may thenassign a unique drive letter to each logical partition.GUID partition table (GPT) only has the primary partition, doesn't have the extended partition and the logical partition.
BIOS boot partition (BIOS BP) is a share of the storage device used to keep software that boots the operating system, abootloader. It may be an operating system kernel image or bootloader or a completely separate piece of software.[16][17]: 136
EFI system partition is the same as BIOS BP, but is loaded by EFI firmware instead of BIOS.[16][17]: 136
A minidisk is only part of a physical disk but appears to be a separate disk to the guest.
rp(4)
– Version 6 Unix Programmer'sManual - speaks of the disk being divided intoportions,pseudo-disks andsections.pdisk(8)
– Darwin andmacOS System Manager'sManual.