Partition (disk)

from Wikipedia, the free encyclopedia

The contiguous, consecutive data blocks of a part of a volume are referred to as partitions ( Latin partitio , “division” ) . This can be all of the storage space or part of a suitable physical or logical data store . A partition is always a volume .

use

Most operating systems require partition tables , but they can also be operated with just one partition. A partition table and all partitions defined in it are always part of a volume , which is what physical data storage like e. As a hard disk , a NVMe - SSD or USB stick corresponds to or even already logically a RAID -Verbund or LVM . The use of only one partition is the simplest type of partitioning, in which the partition extends over the entire storage area of ​​the volume - such as the physical disk.

However, there are various reasons for using multiple partitions:

  • Multi-boot system : Partitions allow several operating systems to be installed on one hard disk.
  • Multiple file systems: Each partition has its own file system, so different file systems can be created on a physical data carrier by partitioning. That also increases that
  • Data security : If the file system of one partition shows errors, the other partitions are not affected. This is particularly advantageous when reinstalling the operating system, since only its partition can be formatted and data is retained on other partitions.
  • Organization: You can save your data in different partitions according to the purpose. For example, the system data, swapping data, application programs and user data can be located on different partitions, which makes data backups easier , for example .
  • System security: Under many Unix-like systems it is possible to define properties for individual partitions, for example prohibiting executable files ( noexec).
  • Recovery volume (mostly as a hidden partition): Examples are the Windows recovery environment or the macOS recovery volume

On some types of disks, most operating systems use all of the physical storage as one physical drive without resorting to the concept of partitioning. From the operating system perspective, both a logical partition and a physical disk without a partition table correspond to a volume . A file system on it therefore always extends over the entire available memory of the volume . The waiver of partitioning can be found, for example, on floppy disks ; it is to be distinguished from a data carrier on which a single partition is set up, as is the case e.g. B. is normally common with USB sticks or external hard drives.

Partitioning concepts

Before there were hard disks of larger capacity, the limitation of storage space in physical units was so to speak natural - there was no further division into sub-units. For example, a magnetic tape in a tape drive had a certain storage capacity and large amounts of data had to be distributed over several magnetic tapes. For example, VTOC was used as the table of contents .

However, over time, the capacity of storage media has increased. In the developing personal computing area, for example, the IBM PC XT was first sold with internal hard drives in 1983. The Apple Macintosh XL from 1985 also had an optional hard drive ex works. Since hard disks have a much larger storage capacity than floppy disks, the possibility was created to divide them into partitions. The partition table thus represents one of the first concepts of non-physical division into partitions.

After IBM and Microsoft introduced the Master Boot Record (MBR) with PC DOS and MS-DOS 2.0 in 1983 , Apple followed suit in 1987 with the Apple Partition Map (APM) for Macintosh computers. Other operating systems and platforms also introduced the concept in the same way, such as BSD systems with Disklabels (1988) or Commodore with the Rigid Disk Block (RDB) for Amiga computers. Including those of Intel developed GUID partition table ( GPT, " G UID P artition T able" ), with the Extensible Firmware Interface introduced (EFI) by 2000 and with UEFI is being developed since 2005 as part of this open specification from several manufacturers, corresponds this concept.

Logical Volume Manager

Logical Volume Managers (LVM) also offer the option of dividing the available storage across storage media and partition boundaries . With this concept, the natural limits are also lifted, as z. For example, several hard disks can be combined into one large storage area, which in turn can be divided into individual partitions. In addition, the concept also offers the option of dynamically increasing the memory by adding additional storage media (or reducing it by removing media) - under Windows (since Windows 2000) this partitioning concept is therefore also called dynamic data storage media, and Windows 8.1 and newer also offer it Storage Spaces is a much more powerful tool for creating storage pools.

Another similar concept is how the file system divides memory. Some highly developed file systems offer both the possibility of managing a large composite memory as a file system across storage medium boundaries (such as LVM), as well as managing this entire storage area separately in the form of partitions ( English subvolumes ) or as snapshots . Examples include ZFS and btrfs .

For the latter concepts, a multi-level model has been established in which more than one partitioning concept is used. All LVM implementations offer the possibility of relying on underlying partitions (i.e. the concept of partition tables). A combination with other storage concepts such as redundancy ( RAID ) is also possible with LVM and modern file systems. The level at which the RAID array is implemented, for example, can also be varied: Both the individual data carriers or individual partitions can be mapped as RAID and the volume group configured as LVM itself. Although it would also be possible to use the entire storage area of a data storage device without a partition table within a specific LVM configuration and only providing a division into storage areas via LVM, this variant is usually not used in practice.

Compatibility and Interoperability

Most computer architectures only support a certain partition table for starting operating systems. On the one hand, this is due to the fact that almost all computers are developed and sold as a platform , i.e. as a computer system including an operating system. Another technical reason is how the firmware of a computer starts the bootloader . The process known as bootstrapping begins with loading the first program that a computer executes when it is switched on: the firmware , such as the BIOS on the IBM PC , its successor UEFI , Open Firmware or Kickstart . This first firmware initializes at least the existing hardware required for starting (whereby it may read and execute further firmware from this hardware) and then transfers it to a boot loader - also often referred to as the initial program load or "Stage 1", whose task it is to subsequently to start an operating system. In order to be able to start the bootloader , it may be necessary to first read in and evaluate the partition table. Therefore, the firmware must also know the format of the partition table. Since it would be too much effort to implement support for multiple partition tables in the firmware , most of them can only evaluate a single partition table and consequently only start the required boot loader from a storage medium that contains this partition table .

One exception that was widespread and well-known until the 2000s is the BIOS in IBM PC-compatible computers , as introduced by IBM in 1981 for the 5150 model. The BIOS reads a boot loader from the first data block of a medium, assuming a fixed data block size of 512 bytes - it therefore basically knows no partitions or partition tables. The 1983 introduced the Master Boot Record (MBR) takes this concept are taken by not only contains a partition table, but also a program (referred to as English master boot code ), which has the task of reading this partition table and one of the listed partitions Chainloading principle to start another bootloader . The IBM PC and compatible computers can therefore contain any partition table as long as there is a boot loader in the first data block on the storage medium that can evaluate this partition table and start another boot loader for the operating system from one of the partitions. In practice, very little use has been made of this option, but among other things it enables a bootloader on BIOS-based PCs that evaluates a GUID partition table and can start an operating system from one of the partitions. The prerequisite is that the started operating system can then also cope with this configuration. This is the case with Linux, for example, while Windows reports an unsupported system configuration. From around 2010, the BIOS was largely replaced by UEFI.

Other systems such as the Power Macintosh series from Apple use a fixed partition table because the Open Firmware first loads the boot loader as a file directly from one of the partitions. However, the firmware has to go one step further, because for this purpose it not only has to know the partition table, but also the file system: In Apple systems from the PowerPC era (1994-2006), the bootloader must therefore be on an APM - Partition with hierarchical file system (HFS) must be saved. Servers from Sun Microsystems and IBM also use Open Firmware , but use different file systems.

The GUID partition table (GPT) specified by Intel in EFI since 2000 sees itself as the successor to the Master Boot Record (MBR) and has therefore implemented a number of compatibility and protection functions. There is always an MBR in the first data block, which has the task of protecting the following GUID partition table and the storage space managed with it from access by older programs. Therefore, this MBR is also Protective MBR ( English Protective MBR ) - Old programs and computer systems are thus not the embarrassment of having the storage medium as a supposedly empty and uninitialized be seen as a valid partition table, including partition exists with the Protective MBR. In the end, every storage medium with GPT is protected against accidental deletion on old systems that only know the MBR. Unlike the BIOS, when bootstrapping, its successor UEFI loads the bootloader from a special partition that must be formatted in the FAT32 file system. UEFI must therefore read out the GUID partition table and also be able to access the FAT32 file system in order to then start the boot loader directly. The boot loader must be executable for the same processor architecture as the UEFI from which it was started (e.g. x86_64 ).

At Acorn each used -Rechnern SCSI - expansion card one in their firmware implemented proprietary partition table type. This principle leaves it up to the used combination of controller card and storage medium (mostly a hard drive) which partition table type is used, which, however, led to its own (incompatible) implementations. The disadvantage was therefore that the operating system could no longer access the data on a hard drive that was used on a certain controller with another SCSI controller card via the normal file system driver path.

The partition table on Amiga computers from Commodore, the Rigid Disk Block (RDB), must be in the area of ​​one of the first 16 data blocks. The advantage of this approach is that partition tables can coexist in different formats - for example an MBR on data block 0 and an RDB in one of the subsequent data blocks.

What all computer architectures have in common is that an operating system that has already been started can use a large number of partition tables on other storage media, because partition tables can be initialized in software by the respective operating system. A good example of this is Linux, which supports partition tables on a wide variety of systems and platforms. But also z. B. Windows can use partitions from both MBR and GPT partitioned media. Likewise, Mac OS X / OS X / macOS next GPT also use APM and MBR partitions. It should be noted, however, that the file system used on a partition must also be supported by the operating system in order to ultimately have access to the files it contains.

The most common combination of partition table and file system compatible with almost all operating systems is likely to be an MBR partition - regardless of whether it is a primary partition or a logical partition - with the FAT32 file system. On older operating systems (mid-1980s to late 1990s) at least the FAT16 file system still works, although it only allows partitions to be limited to just under 4 GiB. Hard disks with a storage capacity of 3 TiB and more have been available since around 2010; however, the combination of master boot record and FAT32 partition is not suitable for data storage devices larger than 2  TiB (= 2048 GiB, ≈ 2199 GB) . This is why the GUID partition table is also increasingly establishing itself as the new standard on almost all common operating systems that have appeared since around 2010. Because of its widespread use, modern operating systems can often handle the NTFS file system developed by Microsoft for its Windows operating systems , possibly using an additional driver from a third-party manufacturer for write access. Alternatively, Microsoft offers a successor with the patented file system exFAT , which is intended to remove some of the restrictions of FAT32, but is not supported equally well by all operating systems and devices.

Names and types of different partitions

Primary, extended and logical partitions

This distinction only applies to the master boot record partition table as it is e.g. B. fdiskcan be created with. A maximum of four partitions can be entered in it, either up to four primary or up to three primary and one extended partitions.

The definition of whether a partition is a primary or an extended partition is made using a partitioning program in the partition table, which is part of the master boot record .

An extended partition serves as a framework for any number of additional logical partitions.

Logical partitions lie within the memory area of ​​the extended partition. There can only be a single extended partition (which is defined as one of the four possible partitions in the MBR), but it can contain an unlimited number of further logical partitions. Logical partitions are therefore not defined in the primary partition table, since both the table entry of the logical partition lies within the memory area of ​​the extended partition and the memory area of ​​the logical partition itself.

Logical drive or volume

With modern operating systems, direct access to hardware is only possible in kernel mode. Application software in user mode cannot access partitions directly. Instead, their operating system the data store as volume or logical drive by hooking (mount) on a mount point ( English mount point ) in the directory structure ready. In Unix-like systems, any empty subfolder can be used as a mount point. In Windows, so-called drive letters are primarily used as mount points, but any empty sub-folders can also be used.

Virtual drive

The term “virtual drive” can be understood on the one hand to mean that a physically (currently) non-existent drive still receives an administration entry in the drive list; This is mainly done for removable media, the reader of which can therefore also be addressed when no media is inserted (CD / DVD / BluRay drives, memory card readers, etc.). On the other hand, a “virtual drive” is also referred to when a drive of a certain type is emulated; this can include:

  • a RAM disk that integrates part of the main memory as a logical drive in the system. The memory area must be formatted before use so that a file system is available (this is usually done automatically by the RAM disk driver). Data stored on it is lost with every restart and when the system is switched off, unless the type of implementation creates a backup copy when the operating system is shut down, which is restored when the RAM disk is re-initialized.
  • a virtual drive , which in most cases exists as a file on an already integrated file system and is integrated in the system like a physical storage medium. Under Linux you can do this with a loop device with on-board resources. The DMG files in Mac OS X and VHD files in Windows (since Windows 7) also function like virtual drives. Another example is the integration of ISO images that emulate an optical drive (CD-ROM, DVD-ROM).

Access and use

use

If a partition is made available as a logical drive or volume in the operating system, one speaks of the drive being “mounted”, “integrated”, “activated” or “ mounted ” (from English to mount ).

Such a device is mounted on a mount point . Either a so-called drive letter (CP / M, DOS, Windows, OS / 2 ) or any empty subdirectory (Unix and similar) is used for this.

The corresponding driver is always a prerequisite for using file systems . Which file systems can be integrated and used by which operating system is therefore not a question of the operating system itself. In a Windows standard installation, there are only drivers for MS's own file systems FAT and NTFS, but after installing the respective drivers, external file systems such as ext3 can also be used.

However, not every partition is deliberately made accessible as a volume. The swap partition , for example, should not be used by the user to store files because the operating system uses this partition only to swap out memory areas.

Under DOS / Windows

Under DOS (and Windows up to and including version 4.0), logical drives are always represented by drive letters (A:-Z:). The drive lettersA: and B:are, however, permanently reserved for floppy drives and cannot be used for any other logical drive; even if there is no floppy disk drive. In addition, a maximum of 24 additional logical drives can be used.

With MS-DOS and Windows 9x , only one primary DOS partition can be set up and mounted per hard disk. Typically this is given the drive letterC:.

Under Windows NT

From Windows NT version 5.0, Windows 2000 and newer, Drive letters may be omitted, as mounting in any empty directory within an NTFS file system is supported. The mounted file system does not have to be NTFS. Also areA: and B: no longer limited to floppy drives.

Starting with Windows 10 version 1703, all partitions can be accessed on external, removable removable media. More than one primary partition can also be set up using on-board tools. Assuming a supported file system, these partitions can now also be used, which did not work in earlier Windows versions.

With Windows NT, Microsoft distinguishes between system partitions and start-up partitions , depending on their purpose . Up to Windows 7, the same partition can be used for both purposes.

  • The system partition ( English system partition ) must only contain the hardware-related files needed to start Windows, so the boot loader along with specific configuration. These are either the NT loader or the Bootmgr with BCD and all associated configuration files. A drive letter is usually not assigned to it.
  • The boot partition ( English boot partition ) contains the Windows installation, usually in the directory \WINDOWS, and usually gets the drive letterC:. The environment variable %SystemDrive% contains the value for your drive letter

Under Unix and similar systems

Under Unix , Linux and most similar operating systems partitions on the directory structure as a device node ( english device node ) and device file ( english device file represents).

Each partition has a file name with a combination of letters which should indicate something about the type of data carrier. So is called z. B. Under Linux the first partition on a SCSI and SATA hard drive /dev/sda1. The following partitions are numbered accordingly. If the partition table is a master boot record , the first logical partition (within an extended partition) on this hard disk always has the device name /dev/sda5- even if there are fewer than four primary partitions.

A partition is mounted in any subdirectory in the directory structure, e.g. B. , and thus becomes available to the system. A boot partition is usually mounted under , the system partition of the active system is always mounted as the root directory . /mnt/Beispiel/boot/

By assigning fixed block device minor numbers, the maximum number of addressable partitions via device files is limited in Linux prior to kernel version 2.6.20 . For IDE / ATA plates characterized is the highest number and SCSI and SATA (this is for each of the letters , , etc., etc., for the first, second, third data store). As of February 2007 kernel 2.6.20, the SCSI limit of 15 partitions is set for all hard disks. For example, ( ) could handle a larger number of logical partitions in MBR partition tables, but an unchanged kernel could not use them. Starting with Kernel 2.6.28 from January 2009, dynamic block device numbers are used which are assigned to the individual device files with the help of the user space program udev , so that this limit no longer exists. /dev/hd…63 /dev/sd…15abccfdisk

Shared access example

In the following example partitioning based on the master boot record , several partitions were created on a hard drive on which both Windows and Linux are operated. The first partition is a primary partition with NTFS file system for the Windows operating system, the second partition is an extended partition that contains four logical partitions. The first two logical partitions of the extended partition are an NTFS and a FAT32 partition and are intended for storing files, the other two partitions are an ext3 and a swap partition for the Linux operating system.

Partitioning programs can represent this partition scheme as follows, for example:

Primäre Partition (NTFS)
Erweiterte Partition
+ Logische Partition 1 (NTFS)
+ Logische Partition 2 (FAT32)
+ Logische Partition 3 (ext3)
+ Logische Partition 4 (Swap)

Windows assigns a logical drive or volume as a drive letter to these partitions and would typically display them as follows:

C: (Windows-Betriebssystem, NTFS)
D: (Daten 1, NTFS)
E: (Daten 2, FAT32)

Windows searches u. a. at startup the partition table according to partition types, which indicate the file systems that can be used by the operating system. Since Windows cannot use Linux file systems, the associated partitions are usually not displayed. If they were to point to file systems that can be read by the operating system, they would each be assigned a drive letter by default. It should be noted, however, that the association between the file system and partition type is not mandatory. For example, if you changed the partition type of the ext3 partition directly in the partition table to type 0x07 (NTFS) or 0x0B (FAT32), this would definitely be displayed under Windows. However, since the expected management structure of the file system ( file allocation table or master file table ) is missing on this, the partition would be claimed as "not formatted" the first time it was attempted to read or write and it would also be offered to assign the supposedly unformatted partition to a file system supported by Windows format. However, this would destroy the data stored in the Linux file system.

A current Linux operating system, on the other hand, could display the partitions as follows:

/dev/sda1 (Primäre Partition; Windows-Betriebssystem, NTFS)
/dev/sda2 (Erweiterte Partition)
/dev/sda5 (1. logische Partition auf der erweiterten Partition; Daten 1, NTFS)
/dev/sda6 (2. logische Partition auf der erweiterten Partition; Daten 2, FAT32)
/dev/sda7 (3. logische Partition auf der erweiterten Partition; Linux, ext3)
/dev/sda8 (4. logische Partition auf der erweiterten Partition; Linux-Swap)

/dev/sda1bis /dev/sda4here are the four possible MBR partitions, of which only the first two are used. The remaining logical partitions ab /dev/sda5are located in the extended partition. /dev/sda2As an extended partition, it does not contain a file system itself, but the logical partitions with their file systems.

Partitioning programs

There are a number of disk management programs that can make partitioning easier. Even simple console and DOS programs such as fdiskenable partitioning. Note: Although the command is also called under DOS, BSD-Unix (for example Mac OS X / OS X / macOS) and Linux fdisk, they are not the same program.

The installation programs for the operating systems, such as YaST2 for SuSE Linux, also offer partitioning options in order to accommodate the new operating system on the hard drive alongside an already installed operating system. However, this is usually just a front end for another program (for example fdiskor partedin the case of YaST2).

There are a number of utilities , especially for Unices , to create and manage file systems. See Unix commands . macOS uses the "hard disk service program" or on the command line , the computers are delivered with a partition. Some partitioning tools allow you to reduce (if there is still free space in the partition) or to enlarge (if there is still free space on the data carrier) partitions without data loss, rarely even the system partition (the partition from which the operating system was started). diskutil

  • DOS (PC compatible)
    • fdiskCommand ( fdisk /?outputs help)
    • FIPS : Resizing partitions while preserving data
    • Norton Partition Magic from Symantec , originally PowerQuest (only as a data recovery system with partitioning tool under DOS)
    • eXtended FDisk ( xfdisk) Partition and Boot Manager (GPL): a very powerful boot manager and partitioning program that enables booting from multiple partitions and can also handle multiple connected hard drives.
  • DOS (not PC compatible)
    • most DOS operating systems have a variant of fdiskthat can be used to create the partitioning you need; Examples:
      • Atari SpartaDOS, MyDOS and RealDOS
  • macOS (from 1999 to 2012 "Mac OS X" or until 2016 "OS X")
    • Console program pdiskfor partitions of the type APM (integrated in the system)
    • Console program fdiskfor partitions of type MBR (integrated in the system)
    • Console program gptfor partitions of the type GPT (integrated in the system)
    • Console program diskutilwith the parameters eraseDisk and partitionDisk(integrated in the system)
    • Hard disk utility ( English Disk Utility ; integrated into the system) - up to Mac OS X Snow Leopard (Version 10.6, 2009) it was called “Disk Utility” ( through coupling ) and was written as a composite beginning with Mac OS X Lion (10.7, 2011)
    • iPartition from Coriolis Systems
  • OS / 2 and licensed successors ( eComStation , ArcaOS)
    • fdiskCommand up to OS / 2 Warp 4.0 (can be completely controlled via the command line, can install a boot manager on its own partition)
    • fdiskpm up to OS / 2 Warp 4.0 (the graphical version)
    • Logical Volume Manager from OS / 2 Warp 4.5
  • various Unixoid systems such as BSD , GNU / Linux , OpenSolaris and many more ...
  • Visopsys (standalone OS)
    • Partition Logic (GNU GPL)
  • Windows
    • Disk management ( integrated into the system in Windows NT series; diskmgmt.mscin the folder %SystemRoot%\system32, typically C:\Windows\system32\diskmgmt.msc)
    • Command line program diskpart( integrated into the system from Windows 2000 )
    • Commands fixmbrand fixbootthe recovery console
    • Command bootsectwith recovery console parameters
    • Acronis Partition Expert
    • Acronis Disk Director Suite (includes all Acronis disk tools)
    • MiniTool Partition Wizard (Home Edition is free)
    • Paragon Hard Disk Manager or Paragon Partition Manager Free Edition (English, free of charge for private use)
    • Easeus Partition Master (English; Home Edition, Professional Edition and Server Edition), free 30 days for 32- and 64-bit systems, usable for private use
    • O&O PartitionManager (Professional and Server Edition)
    • Partition Commander
  • ZETA 1.0 ( BeOS successor)
    • Paragon Partitioning Tool (integrated in the installer, can shrink NTFS and FAT partitions)

Individual evidence

  1. ^ Brian Carrier: File System Forensic Analysis . Addison-Wesley Professional, 2005, ISBN 978-0-13-443954-9 (English, full text in the Google book search): “One of the concepts in a volume system is to create partitions. A partition is a collection of consecutive sectors in a volume. By definition, a partition is also a volume, which is why the terms are frequently confused. "
  2. Frequently asked questions about architecture Disk partitioning GUID table. Further information. In: Help and Support. Microsoft , August 4, 2009, accessed on February 9, 2014 (English): " Removable media without either GUID Partition Table or MBR formatting is considered a 'superfloppy." "
  3. Booting from GPT by Rod Smith, updated December 11, 2012, accessed February 16, 2014.
  4. Axel Vahldiek: Windows 10: Thanks to Creators Update, several partitions on USB sticks. In: Heise online . April 21, 2017 . Retrieved March 15, 2020.
  5. Andrea Müller: Partition on USB stick inaccessible. In: c't 10/11 hotline. April 26, 2011, accessed on February 19, 2014 (also in issue 10/11 p. 164 ).
  6. Frequently asked questions about the GUID Partitioning Table disk architecture . microsoft.com, section “What about removable media?” and following; Retrieved July 30, 2014
  7. Windows Vista Business limited preview in Google Book Search
  8. MCSE Training Guide Windows XP Professional limited preview in Google Book Search
  9. How to run 126 Xp in a hard disk - with a bit of help from Linux (English), forum contribution by saikee from May 9, 2009, accessed on February 20, 2014
  10. ^ What is the maximum No. of hard disk partitions after kernel 2.6.28 (English), forum contribution by saikee from March 8, 2009, accessed on February 20, 2014
  11. APT Hard Disk Toolkit. atari8.co.uk, March 15, 2015, accessed May 20, 2018 .
  12. pdisk manpage , accessed on May 8, 2015
  13. fdisk manpage , accessed on May 8, 2015
  14. gpt manpage , accessed on May 8, 2015
  15. suchenil manpage , accessed on May 8, 2015
  16. OS / 2 FDISK and Installation. Technical Document # - 8262710. In: service5.boulder.ibm.com/pspsdocs.nsf. IBM, January 19, 1998, accessed March 14, 2014 .