Disk partitioning
Encyclopedia
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
Slice (disk)
In Sun Microsystems' Solaris computer operating system, disk partitions are sometimes known as slices. This is a conceptual reference to the slicing of a cake into several pieces...

" for operating systems based on BSD, Solaris or GNU Hurd
GNU Hurd
GNU Hurd is a free software Unix-like replacement for the Unix kernel, released under the GNU General Public License. It has been under development since 1990 by the GNU Project of the Free Software Foundation...

. A partition editor
Partition editor
A partition editor is a kind of utility software designed to view, create, alter and delete disk partitions on a computer storage device, most commonly a hard disk, but often a USB flash drive or other storage medium.A partition is a section or segment of the storage space on a storage device...

 software program can be used to create, resize, delete, and manipulate these partitions on the hard disk.

Benefits of multiple partitions

Creating more than one partition has the following advantages:
  • Separation of the operating system
    Operating system
    An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...

     (OS) and program files from user files. This allows image
    Disk image
    A disk image is a single file or storage device containing the complete contents and structure representing a data storage medium or device, such as a hard drive, tape drive, floppy disk, CD/DVD/BD, or USB flash drive, although an image of an optical disc may be referred to as an optical disc image...

     backup
    Backup
    In information technology, a backup or the process of backing up is making copies of data which may be used to restore the original after a data loss event. The verb form is back up in two words, whereas the noun is backup....

    s (or clones
    Disk cloning
    Disk cloning is the process of copying the contents of one computer hard disk to another disk or to an "image" file. Often, the contents of the first disk are written to an image file as an intermediate step, and the second disk is loaded with the contents of the image...

    ) to be made of only the operating system and installed software.
  • Having a separate area for operating system virtual memory
    Virtual memory
    In computing, virtual memory is a memory management technique developed for multitasking kernels. This technique virtualizes a computer architecture's various forms of computer data storage , allowing a program to be designed as though there is only one kind of memory, "virtual" memory, which...

     swapping/paging
    Paging
    In computer operating systems, paging is one of the memory-management schemes by which a computer can store and retrieve data from secondary storage for use in main memory. In the paging memory-management scheme, the operating system retrieves data from secondary storage in same-size blocks called...

    .
  • Keeping frequently used programs and data near each other.
  • Having cache and log files separate from other files. These can change size dynamically and rapidly, potentially making a file system full.
  • Use of multi-boot setups, which allow users to have more than one operating system on a single computer. For example, one could install Linux
    Linux
    Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

    , BSD, Mac OS X, Microsoft Windows or other operating systems on different partitions of the same hard disk and have a choice of booting into any compatible operating system at power-up.
  • Protecting or isolating files, to make it easier to recover a corrupted file system or operating system installation. If one partition is corrupted, other file systems may not be affected.


  • Raising overall computer performance on systems where smaller file systems are more efficient. For instance, large hard drives with only one NTFS
    NTFS
    NTFS is the standard file system of Windows NT, including its later versions Windows 2000, Windows XP, Windows Server 2003, Windows Server 2008, Windows Vista, and Windows 7....

     file system typically have a very large sequentially accessed
    Sequential access
    In computer science, sequential access means that a group of elements is accessed in a predetermined, ordered sequence. Sequential access is sometimes the only way of accessing the data, for example if it is on a tape...

     Master File Table (MFT) and it generally takes more time to read this MFT than the smaller MFTs of smaller partitions.
  • "Short Stroking", which aims to minimize performance-eating head repositioning delays by reducing the number of tracks used per hard drive. The basic idea is that you make one partition approx. 20-25% of the total size of the drive. This partition is expected to: occupy the outer tracks of the hard drive, and offer more than double the throughput — less than half the access time. If you limit capacity with short stroking, the minimum throughput stays much closer to the maximum. This technique, however, is not related to creating multiple partitions, but generally just creating a partition lesser size than available on the disk.
  • For example a 1 TB disk might have an access time of 12 ms at 200 IOPS
    IOPS
    IOPS is a common performance measurement used to benchmark computer storage devices like hard disk drives , solid state drives , and storage area networks...

     (at a limited queue depth) with an average throughput of 100 MB/s. When it is partitioned to 100 GB (and the rest left unallocated) you might end up with an access time of 6 ms at 300 IOPS (with a bigger queue depth) with an average throughput of 200 MB/s.

Disadvantages of multiple partitions

Creating more than one partition has the following disadvantages, as compared to having a single partition spanning the same disk area:
  • Reduces the total space available for user storage on the disk, as it forces the operating system to duplicate certain file system administration areas on the disk for each partition.
  • Reduces overall disk performance on systems where data is accessed regularly and in parallel on multiple partitions, because it forces the disk's read/write head to move back and forth on the disk to access data on each partition and to maintain and update file system administration areas on each partition. It also prevents disk optimizers from moving all frequently accessed files closer to each other on the disk, which could reduce the number and distance of required head movements. Files can still be moved closer to each other on each partition, but those areas themselves will still be far apart on the disk. (See "short stroking" considerations above.) This issue does not apply to SSD drive
    Solid-state drive
    A solid-state drive , sometimes called a solid-state disk or electronic disk, is a data storage device that uses solid-state memory to store persistent data with the intention of providing access in the same manner of a traditional block i/o hard disk drive...

    s as access times on those are neither affected by nor dependant upon relative sector positions.
  • Increases disk fragmentation because it lowers the average size of continuous free blocks on each partition - as compared to a single partition of the same overall size - after the same amount of data has been written to them.
  • May prevent using the whole disk capacity, because it may break free capacities apart. For example, if you have a disk with two partitions, each with 3 GBs free (hence 6GBs in total), you can't copy a 4GB DVD image file on that disk, because none of the partitions will actually provide enough space for that - even though you have more than enough free capacity in total on the disk. If the same files on those two partitions would have been stored on a single partition spanning the whole disk, then the 4GB file could be easily stored in the 6GB of free space.
  • Slows down moving data between different parts of the same physical disk. When moving data from one partition to other, the operating system actually has to copy the contents of the data file, even though it still remains on the same device in a single copy/instance. When using a single partition, moving data between directories will only require altering the file system administration areas, and the actual contents of the file will not be copied or moved inside the disk/device, thus resulting in a significantly faster completion of the operation.
  • Hurts portability and might impose constraints on how entities might be linked together inside the file system. For example: the NTFS file system allows hard links
    Hard link
    In computing, a hard link is a directory entry that associates a name with a file on a file system. . The term is used in file systems which allow multiple hard links to be created for the same file. This has the effect of creating multiple names for the same file, causing an aliasing effect: e.g...

     to be created only as long as both the link and the referenced file reside inside the same volume/partition. Also under Windows if you're referencing a file on another partition, you can do that only by specifying the partition's assigned drive letter - which, however, might change with time and depending on the drives installed. This renders references invalid and dependent on actual drive letter assignment, which is not an issue if you have to reference files/directories only on the same partition, as in this case you can use directory-relative or root-relative references, without including the drive/partition letter.

PC partition types

This section describes the master boot record
Master boot record
A master boot record is a type of boot sector popularized by the IBM Personal Computer. It consists of a sequence of 512 bytes located at the first sector of a data storage device such as a hard disk...

 (MBR) partitioning scheme, as used in DOS
DOS
DOS, short for "Disk Operating System", is an acronym for several closely related operating systems that dominated the IBM PC compatible market between 1981 and 1995, or until about 2000 if one includes the partially DOS-based Microsoft Windows versions 95, 98, and Millennium Edition.Related...

, Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

 and Linux
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

 among others on PC compatible computer systems. For examples of partitioning schemes used in other operating systems, see the general article on partition tables
Partition table
The term partition table is most commonly associated with partition table but it may be used generically to refer to other "formats" that divide a disk drive into partitions, such as: GUID Partition Table, Apple partition map, or BSD disklabel.An alternative term to generically refer to partition...

.

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.

Primary partition

A primary partition contains one file system. In DOS
DOS
DOS, short for "Disk Operating System", is an acronym for several closely related operating systems that dominated the IBM PC compatible market between 1981 and 1995, or until about 2000 if one includes the partially DOS-based Microsoft Windows versions 95, 98, and Millennium Edition.Related...

 and earlier versions of Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

 systems, the system partition was required to be the first partition. More recent Windows operating systems (Win7, XP, etc.) can be located on any partition, but the boot files (bootmgr, ntldr, etc.) must be on a primary partition. However, other factors, such as a PC's BIOS
BIOS
In IBM PC compatible computers, the basic input/output system , also known as the System BIOS or ROM BIOS , is a de facto standard defining a firmware interface....

 (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
NTFS
NTFS is the standard file system of Windows NT, including its later versions Windows 2000, Windows XP, Windows Server 2003, Windows Server 2008, Windows Vista, and Windows 7....

 or an OS/2 HPFS
HPFS
HPFS or High Performance File System is a file system created specifically for the OS/2 operating system to improve upon the limitations of the FAT file system...

 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 Allocation Table
File Allocation Table is a computer file system architecture now widely used on many computer systems and most memory cards, such as those used with digital cameras. FAT file systems are commonly found on floppy disks, flash memory cards, digital cameras, and many other portable devices because of...

 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
Ext4
The ext4 or fourth extended filesystem is a journaling file system for Linux, developed as the successor to ext3.It was born as a series of backward compatible extensions to ext3, many of them originally developed by Cluster File Systems for the Lustre file system between 2003 and 2006, meant to...

, ext3
Ext3
The ext3 or third extended filesystem is a journaled file system that is commonly used by the Linux kernel. It is the default file system for many popular Linux distributions, including Debian...

, ext2
Ext2
The ext2 or second extended filesystem is a file system for the Linux kernel. It was initially designed by Rémy Card as a replacement for the extended file system ....

, ReiserFS
ReiserFS
ReiserFS is a general-purpose, journaled computer file system designed and implemented by a team at Namesys led by Hans Reiser. ReiserFS is currently supported on Linux . Introduced in version 2.4.1 of the Linux kernel, it was the first journaling file system to be included in the standard kernel...

, etc.), they have all consistently used the same partition type code: 0x83 (Linux native file system).

Extended partition

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.

DOS, Windows, and OS/2

With DOS
DOS
DOS, short for "Disk Operating System", is an acronym for several closely related operating systems that dominated the IBM PC compatible market between 1981 and 1995, or until about 2000 if one includes the partially DOS-based Microsoft Windows versions 95, 98, and Millennium Edition.Related...

, Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

, and OS/2
OS/2
OS/2 is a computer operating system, initially created by Microsoft and IBM, then later developed by IBM exclusively. The name stands for "Operating System/2," because it was introduced as part of the same generation change release as IBM's "Personal System/2 " line of second-generation personal...

, a common practice is to use one primary partition for the active file system
File system
A file system is a means to organize data expected to be retained after a program terminates by providing procedures to store, retrieve and update data, as well as manage the available space on the device which contain it. A file system organizes data in an efficient manner and is tuned to the...

 that will contain the operating system, the page/swap file, all utilities, applications, and user data. On most Windows consumer computers, the drive letter
Drive letter assignment
Drive letter assignment is the process of assigning alphabetical identifiers to physical or logical disk drives or partitions in the root filesystem namespace; this usage is now mostly found in Microsoft operating systems...

 C: is routinely assigned to this primary partition. Other partitions may exist on the hard disk that may or may not be visible as drives, such as recovery partitions or partitions with diagnostic tools or data. (Microsoft drive letters do not correspond to partitions in a one-to-one fashion, so there may be more or fewer drive letters than partitions.)

Microsoft Windows 2000
Windows 2000
Windows 2000 is a line of operating systems produced by Microsoft for use on personal computers, business desktops, laptops, and servers. Windows 2000 was released to manufacturing on 15 December 1999 and launched to retail on 17 February 2000. It is the successor to Windows NT 4.0, and is the...

, XP
Windows XP
Windows XP is an operating system produced by Microsoft for use on personal computers, including home and business desktops, laptops and media centers. First released to computer manufacturers on August 24, 2001, it is the second most popular version of Windows, based on installed user base...

, Vista
Windows Vista
Windows Vista is an operating system released in several variations developed by Microsoft for use on personal computers, including home and business desktops, laptops, tablet PCs, and media center PCs...

, and Windows 7 include a 'Disk Management
Logical Disk Manager
The Logical Disk Manager is an implementation of a logical volume manager for Microsoft Windows NT, developed by Microsoft and Veritas Software. It was introduced with the Windows 2000 operating system, and is supported in Windows XP, Windows Server 2003, Windows Vista and Windows 7...

' program which allows for the creation, deletion and resizing of FAT and NTFS partitions. The Windows 7/Vista Disk Manager is not compatible with Windows 2000, XP and many other non-Microsoft operating systems.

Unix, Linux, and Mac OS X

On Unix
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...

-based and Unix-like
Unix-like
A Unix-like operating system is one that behaves in a manner similar to a Unix system, while not necessarily conforming to or being certified to any version of the Single UNIX Specification....

 operating systems such as Linux
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

 or Mac OS X
Mac OS X
Mac OS X is a series of Unix-based operating systems and graphical user interfaces developed, marketed, and sold by Apple Inc. Since 2002, has been included with all new Macintosh computer systems...

, it is possible to use multiple partitions on a disk device. Each partition can be formatted with a file system
File system
A file system is a means to organize data expected to be retained after a program terminates by providing procedures to store, retrieve and update data, as well as manage the available space on the device which contain it. A file system organizes data in an efficient manner and is tuned to the...

 or as a swap partition.

Multiple partitions allow directories such as /tmp, /usr, /var, or /home to be allocated their own filesystems. Such a scheme has a number of advantages:
  • If one file system gets corrupted, the data outside that filesystem/partition may stay intact, minimizing data loss.
  • Specific file systems can be mounted with different parameters e.g. read-only
    Read-only
    In computing, read-only can mean:* Read-only memory , a type of storage media* Read-only access to files or directories in file system permissions...

    , or with the execution of setuid
    Setuid
    setuid and setgid are Unix access rights flags that allow users to run an executable with the permissions of the executable's owner or group...

     files disabled.
  • A runaway program may use up all available space on a non-system filesystem does not fill up critical filesystems.


A common default for Linux desktop systems is to use two partitions: one holding a file system mounted on "/" (the root directory
Root directory
In computer file systems, the root directory is the first or top-most directory in a hierarchy. It can be likened to the root of a tree — the starting point where all branches originate.-Metaphor:...

) and a swap partition.

By default, Mac OS X systems also use a single partition for the entire filesystem and use a swap file inside the file system (like Windows) rather than a swap partition.

Multi-boot and mixed-boot systems

Multi-boot systems are computers where the user can boot into one of two or more distinct operating systems (OS) stored in separate storage devices or in separate partitions of the same storage device. In such systems a menu at startup
Booting
In computing, booting is a process that begins when a user turns on a computer system and prepares the computer to perform its normal operations. On modern computers, this typically involves loading and starting an operating system. The boot sequence is the initial set of operations that the...

 gives a choice of which OS to boot/start (and only one OS at a time is loaded).

This is distinct from virtual operating systems
Virtual machine
A virtual machine is a "completely isolated guest operating system installation within a normal host operating system". Modern virtual machines are implemented with either software emulation or hardware virtualization or both together.-VM Definitions:A virtual machine is a software...

, in which one operating system is run as a self-contained virtual "program" within another already-running operating system. (An example is a Linux OS "virtual machine" running from within a Windows OS).

Partition recovery

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 being overwritten. Specialized recovery utilities
Undeletion
Undeletion is a feature for restoring computer files which have been removed from a file system by file deletion. Deleted data can be recovered on many file systems, but not all file systems provide an undeletion feature. Recovering data without an undeletion facility is usually called data...

, (such as TestDisk
TestDisk
TestDisk is a free data recovery utility. It was primarily designed to help recover lost data storage partitions and/or make non-booting disks bootable again when these symptoms are caused by faulty software, certain types of viruses or human error .TestDisk can be used to collect detailed...

 and gpart
Gpart
Gpart is a software utility which scans a storage device, examining the data in order to detect partitions which may exist but are absent from the disk's partition tables. Gpart was written by Michail Brzitwa of Germany. The release on the author's website is now older than the releases some...

), may be able to locate lost 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 a FAT32
File Allocation Table
File Allocation Table is a computer file system architecture now widely used on many computer systems and most memory cards, such as those used with digital cameras. FAT file systems are commonly found on floppy disks, flash memory cards, digital cameras, and many other portable devices because of...

 or NTFS
NTFS
NTFS is the standard file system of Windows NT, including its later versions Windows 2000, Windows XP, Windows Server 2003, Windows Server 2008, Windows Vista, and Windows 7....

 partition if a backup boot sector is available.

Compressed disks

Hard disks can be compressed to create additional space. In DOS and early Microsoft Windows, programs such as Stacker
Stac Electronics
Stac Electronics, originally incorporated as State of the Art Consulting and later shortened to Stac, Inc, was a technology company founded in 1983...

 (DR-DOS except 6), SuperStor (DR-DOS 6), DoubleSpace
DoubleSpace
DriveSpace is a disk compression utility supplied with MS-DOS starting from version 6.0. The purpose of DriveSpace is to increase the amount of data the user could store on disks, by transparently compressing and decompressing data on-the-fly. It is primarily intended for use with hard drives, but...

, or DriveSpace (Windows 95) 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 of Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

 using the NT kernel, including the most recent versions, XP and Vista, contain intrinsic disk compression capability. The use of separate disk compression utilities has declined sharply.

See also

  • GUID Partition Table
    GUID Partition Table
    In computer hardware, GUID Partition Table is a standard for the layout of the partition table on a physical hard disk. Although it forms a part of the Extensible Firmware Interface standard , it is also used on some BIOS systems because of the limitations of MBR partition tables, which restrict...

  • File System
    File system
    A file system is a means to organize data expected to be retained after a program terminates by providing procedures to store, retrieve and update data, as well as manage the available space on the device which contain it. A file system organizes data in an efficient manner and is tuned to the...

  • Slice (disk)
    Slice (disk)
    In Sun Microsystems' Solaris computer operating system, disk partitions are sometimes known as slices. This is a conceptual reference to the slicing of a cake into several pieces...

  • RAID
    RAID
    RAID is a storage technology that combines multiple disk drive components into a logical unit...

    , JBOD
  • Disk formatting
    Disk formatting
    Disk formatting is the process of preparing a hard disk drive or flexible disk medium for data storage. In some cases, the formatting operation may also create one or more new file systems...

  • Master boot record
    Master boot record
    A master boot record is a type of boot sector popularized by the IBM Personal Computer. It consists of a sequence of 512 bytes located at the first sector of a data storage device such as a hard disk...

     covers the partition table layout
  • Extended boot record covers a Linux
    Linux
    Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

     partition naming convention
  • Amiga Rigid Disk Block
    Amiga Rigid Disk Block
    In computing, a rigid disk block is the block on a hard disk where the Amiga series of computers store the disk's partition and filesystem information. The PC equivalent of the Amiga's RDB is the master boot record ....

  • List of disk partitioning software

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK