fdisk

from Wikipedia, the free encyclopedia

fdisk - original spelling FDISK in the usual DOS form (see 8.3 ) - designates several partitioning programs for block devices such as hard disks or floppy disks . The word comes from " f ixed disk " , one of IBM introduced English name for hard drive.

PC DOS 2.0 (1983) and the version MS-DOS 2.0 published by Microsoft for all IBM PC-compatible computers contained the very first version of IBM developed and which was further developed together with MS-DOS. As a program on the command line ( console program ), FDISK can be operated both via command line parameters and via a character-oriented user interface (dialog or menu-based). Other operating systems usually contain a clone based on MS-DOS-FDISK , also under the name , such as PC- Unix and PC-compatible DOS . FDISK.COMfdisk

FDISK can originally only process partitions of the Master Boot Record (MBR). The MBR was introduced in 1983 together with PC DOS 2.0 and the “ Fixed Disk Setup Program Version 1.0” ( FDISK.COMGerman translation “Hard Disk Setup Program ”). The master boot record is a boot sector and, in addition to the start program, also contains the actual partition table , which is limited to four primary partitions. As of MS-DOS 3.2, an extended partition is also possible, within which further partitions can be defined as logical drives.

There are also graphical versions of FDISK, such as FDISKPM.EXEfrom OS / 2 . Some further developments of fdisk, e.g. B. in util-linux variant contained, in addition to the MBR with GUID Partition Table (GPT, English GUID Partition Table ) deal - the GUID partition table is the successor to the master boot record on IBM PC compatible computers.

history

The IBM-PC XT (type 5160) from 1983 was the first representative of the systems later called IBM-PC-compatible computers , which was equipped with a hard disk. The PC DOS or MS-DOS 2.0 operating system supplied with this introduced a subdivision of the hard disk space , so-called partitions , which are defined in the " Master Boot Record " (MBR) partition table introduced for this purpose . For reasons of compatibility, the partition table was housed within the boot sector - this contains the start program on the IBM PC and compatible computers, which uses the chain loading principle to control the operating system, e.g. B. MS-DOS, starts from the partition marked as active.

Hard drives were many times larger than floppy disks. Expressed in the usual proportions at the time: a 20  MiB hard drive is 57 times larger than a 360 kB floppy disk that was common at the time. The file systems at that time were FAT12 for floppy disks and FAT16 for hard disks. However, the FAT16 file system initially had a size limit of 32 MiB, so larger hard drives (40 MiB and more at the time) had to be partitioned. DOS-FDISK follows this development: the limits have been successively increased both for the FAT file system and for MBR partitions. Accordingly, FDISK.COMMS-DOS / PC DOS 2.0 can only create partitions up to 16 MiB. From MS-DOS 3.2 (1985), partitions up to 32 MiB are possible and the extended partition was introduced. With MS-DOS 3.3 (1987) more than one logical drive was supported within the extended partitions, which now allows more than two drive letters per hard disk, as well as support for a second hard disk.

Because the number of (logical) drives is limited to 26 under PC-DOS / MS-DOS-compatible DOS operating systems - from A:to Z:(see drive letters ) - only 24 partitions are possible. The drive letters A:and B:are always reserved for floppy disk drives under MS-DOS . With a primary partition, a maximum of 23 logical drives are possible within the extended partition. While the initial limit of a maximum of four primary partitions could be an obstacle, the number of possible (logical) drives by adding an extended partition is absolutely sufficient, not only for the time.

MS-DOS and PC DOS

Start menu of FDISK 2.0 ( PC DOS 3.0).

The same FDISK is contained in PC DOS and IBM DOS as in MS-DOS of the same version, since IBM used the largely unmodified Microsoft operating system for its in-house IBM PC product line. The only difference was that MS-DOS could also be installed on clones - there were numerous OEM versions - while IBM DOS could only be used on the original IBM PC - up to IBM DOS 3.3 (1986), which was also specifically called Alternative for IBM PC compatible computers was marketed.

(By an arrangement concluded with IBM joint development agreement English joint development agreement , JDA ), the DOS programs contain from MS-DOS 3.3, written by IBM in the published Microsoft operating system version.

With MS-DOS 4.0 FDISK was an EXE file , FDISK.EXE. From this version on, partitions can be up to 2.1 GiB in size, which is also the limit of FAT16B (“BigDOS”).

As of MS-DOS 6.0 (and the FDISK it contains), up to eight hard disks are supported; two IDE hard disks and up to six SCSI hard disks, which can only be accessed via a driver in the operating system.

As of PC DOS 6.1, the operating system was developed by IBM independently and without Microsoft.

MS-DOS 7.0 to 8.0 are no longer independent operating systems, but part of the Windows 9x operating system series ( Windows 95 to Windows Me ).

OS / 2

Up to version 4.0 OS / 2 is equipped with two partition managers, the text-based FDISK.EXEand the graphical program FDISKPM.EXE. Both have the same functionality and can create FAT and HPFS partitions. OS / 2-FDISK can be completely controlled from the command line, including deleting partitions, and can install the OS / 2 boot manager. OS / 2 versions 4.5 or higher support the JFS file system and have replaced FDISK with a Logical Volume Manager (LVM).

Because of the shared history of OS / 2 and Windows NT, NTFS has the same partition type as HPFS.

Windows

MS-DOS-based Windows versions, also known as Windows 9x called, included a nearly full MS-DOS, and a FDISK, which (from MS-DOS 7.10 95b Windows , Windows 98 ) to 8.00 ( Windows Me ) FAT32 create partitions can. For hard drives larger than 32 GiB, MS-DOS 7.10 requires a patch that is only available for Windows 98. The FDISK programs from Windows 98 to Windows Me can manage hard disks of up to 128 GiB - more if the BIOS supports 48-bit addressing LBA-48 . However, these versions of FDISK have a limit of 64 GiB for the display of hard disk capacity, which can also be fixed by a patch from Microsoft.

In Windows NT is FDISK.EXEnot included. From Windows NT 3.1 , the graphical Disk Management (instead English Disk Administrator ) is used and from Windows 2000 is also the console program diskpart available.

FDISK clones

Screenshot of cfdiskon Linux

Alternative operating systems use on PCs usually the existing partition scheme  - on IBM PC compatible computers with BIOS (for " b asic i nput / o utput s ystem ") Thus the partition table in the Master Boot Record (MBR). There are therefore numerous programs with the fdisksame name - or similar file names or program names - which are used to manage partitions on the respective operating systems and are more or less based on IBM's PC-DOS-FDISK in terms of function and behavior.

Because alternative operating systems support the partition table of the respective computer platform and can manage it with the included FDISK clone, they enable multi-boot systems . As a result, support for the MBR partition table is common to all FDISK clones on IBM PCs with BIOS. However, since around 2010 the BIOS has been increasingly replaced by UEFI and thus the partition table in the MBR has been replaced by the GUID partition table (GPT), so that PC operating systems can (must) use GPT now.

DR DOS

One of the main competitors of PC DOS and MS-DOS on the IBM PC was CP / M from Digital Research . Later, PC-DOS-compatible versions such as Concurrent DOS, DOS Plus and DR DOS were developed from the CP / M-86 . This variant also contains an FDISK clone developed by Digital Research, which is closely based on IBM's FDISK.

As with PC DOS and MS-DOS, DR-DOS-FDISK was not further developed and cannot handle the GUID partition table.

Unix

Since its widespread use, various Unix derivatives have also become alternative operating systems for the PC . In addition to operating systems such as DOS and Windows , various Unices , initially also called “PC Unix”, such as BSD derivatives or Linux, run on IBM-compatible PCs and their successors . This also applies to Macs , on which a Unix has usually been preinstalled with macOS since 2001 . For the purpose of dual or multi-boot, PC-Unix must therefore already be able to manage MBR and GPT partitions during installation and thus provides a corresponding partitioning program , which is often another variant of fdisk. macOS (originally “Mac OS X”), which offers a FreeBSD user, contains a variant of for manipulating “PC partition tables” of the MBR type, although PowerPC-based Macs APM and Intel-based Macs ( x86 architecture) GPT use. Hard disk management programs contained in the respective operating system can usually also handle this. fdisk

Since the GUID partition table (GPT) is the successor to the MBR, fdisk can often recognize at least one existing GPT partitioning on EFI PCs, manage it itself or offer another separate partitioning program based on fdisk. Under macOS, this is the console program gptthat can also be found on many other Unix-like systems.

Linux distributions provide different flavors of fdisk. In addition to the traditional fdisk, this is also often pfdisk- both programs are command line and dialog based and offer numerous options. The program cfdiskoffers simple, menu-based handling. The program sfdiskis considered to be rather cumbersome and designed for experts, but is the only one with the parameter that offers --dumpthe option of saving the structure of a partitioning (i.e. without boot code ) for later repartitioning. fdisk, cfdiskand sfdiskare included in the util-linux package collection.

For Macs there is the console program developed by Apple pdiskfor managing APM partitions, which works on many Unix-like systems. It was originally included in the classic Mac OS and was adapted for Linux distributions that run on PowerPC Macs (1994–2006). A further development of this is mac-fdisk.

Just as OS / 2-FDISK also supports HPFS and Windows-9x-FDISK also supports FAT32, FDISK clones also know partition types (and file systems) of the respective operating system - in addition to the partition types introduced with MS-DOS. So z. For example, an fdisk written for Linux can also create swap (partition type 82) and ext2 partitions (partition type 83).

FDISK alternatives

That with FreeDOS delivered Free FDISK is a free and advanced partitioning program on other PC-compatible versions of DOS can be run. The extended partition manager XFDisk can also be used as a free replacement for MS-DOS / PC-DOS FDISK. XFDisk offers many options that are not included in the standard FDISK.

GUID partition table

The GUID partition table (GPT) is the partition scheme of the BIOS successor UEFI : Due to the design, each GPT also contains an MBR partition table that contains a single primary partition that extends over the entire available memory area. This partition table is a Protective MBR , English Protective MBR called because it seeks to protect those defined in GPT partitions and data from being accidentally erased by older operating systems and programs. For old software - with programs for the PC one can assume since 1983 that it recognizes an MBR partition table - the protection MBR marks the entire memory area as occupied. If this were not the case, the existing data would be at risk because old software would not recognize the GPT and would therefore recognize the memory as supposedly free.

In some variants of fdisk, support for the GUID partition table has therefore also been added: Newer versions of fdisk detect the presence of GPT data structures and issue a warning. Otherwise, fdisk would manipulate the protection MBR, but not the partitions defined in the GPT, which leads to data loss.

Other variants of fdisk have been expanded to include the ability to manage GUID partition tables (GPT) themselves. Still other partitioning programs based on MS-DOS-FDISK were rewritten purely for the GUID partition table, without the possibility of editing the MBR partition table.

Limits

For historical reasons, the limits for the operating system for which FDISK was written and FDISK itself are very close to each other. Therefore, the operating system limit is usually also the FDISK limit.

operating system FDISK year limit
MS-DOS 2.0
PC DOS 2.0
1.0 1983 a hard drive
4 primary partitions, but only one primary partition can be used by MS-DOS
16 MiB per partition (partition type 01)
does not know any extended partitions
MS-DOS 3.2 1985 Extended partition (partition type 05), but only one logical drive supported by MS-DOS;
maximum 2 drives: C:(MS-DOS supports only one primary partition) and one logical drive D:(from the extended partition)
MS-DOS 3.3 1987 Support for two physical hard drives
Support for multiple logical drives
primary partitions and logical drives together: maximum 24, drive C:upZ:
32 MiB per partition (partition type 04)
Compaq MS-DOS 3.31 ( OEM ) 1987 512 MiB per partition (partition type 04, but with 32-bit sector addressing) - incompatible with other versions of MS-DOS!
MS-DOS 4.0 1988 Partitions up to 2.1 GiB (partition type 06)
NEC MS-DOS 3.30 (OEM) 1988 Support for 8 primary partitions in the MBR - incompatible with other versions of MS-DOS!
32-bit sector addressing like Compaq MS-DOS 3.31, but with problems with partitions> 256 MB - incompatible with other versions of MS-DOS!
MS-DOS 5.0 1991 supports up to 8 physical disks
Although FDISK can still only create one primary partition, the kernel can now use additional primary partitions (assign drive letters).
MS-DOS 7.0 ( Windows 95 ) 1995 if the BIOS supports the LBA access mode: new partition type 0Efor the primary partition and 0Ffor the extended partition
MS-DOS 7.1 ( Windows 95B and 98 ) 1996 Partitions up to 2 TiB (partition type 0Bfor the primary partition and 0Cfor the extended partition; LBA access is required for the latter)

Although up to four primary partitions would be possible in the master boot record , FDISK can only create a single primary partition. In order to be able to use a second hard disk or more than one logical drive, both the DOS kernel and FDISK must know extended partitions - a hard disk partitioned with the FDISK contained in MS-DOS 3.3 will therefore not work without further ado on an earlier version of PC DOS / MS-DOS because it cannot use the logical drives in the extended partition. Similarly, prior to version 5.0, MS-DOS can only use a single primary partition.

Exactly one primary partition can be defined as an extended partition. This can contain any number of logical drives, although MS-DOS can only use a maximum of 24 logical hard disk drives. If there is only one hard disk in the PC and exactly one primary partition (which is not an extended partition) on the hard disk, 23 logical MS-DOS drives can be used in the extended partition - with three primary partitions (from MS-DOS 5.0 ) there are only 21 logical drives. These must be defined within a contiguous memory area that is defined by the extended partitions. If there is more than one hard drive, the number of logical drives that can be used in the extended partition is reduced according to the total number of partitions and logical drives on all hard drives.

OS / 2, like MS-DOS (prior to version 5.0), only accepts one primary partition per hard disk.

MS-DOS (and PC DOS) can not of an extended partition start . OS / 2, on the other hand, does - but if a logical drive is added or deleted in the extended partition and the drive letters (which are assigned automatically) change, OS / 2 may no longer be able to start.

Like MS-DOS (or compatible DOS) and Windows, Unix is ​​also subject to BIOS-related restrictions when starting the operating system. Older BIOS versions could not access areas above 1024 cylinders. Therefore, many users created a smaller start partition for the Unix kernel so that it starts below the 1024 cylinder limit. The same applies to the 137 GiB limit if LBA was not implemented as a 48-bit number (LBA-48) by the BIOS. Is the Unix boot partition below the BIOS-related limit, is starting possible and the started operating system can then make use of the above lying area. In addition to the start partition, the installation programs usually set up at least one root partition for the root directory and one swap partition. Since many Unix boot loaders support extended partitions, all partitions relevant for Unix can be defined as logical drives, but it may be necessary to /bootcreate the start partition as a primary partition due to the BIOS limitation.

See also

Web links

Individual evidence

  1. Michal Necasek: DOS 2.0 FDISK. In: OS / 2 Museum. August 17, 2011, accessed June 15, 2017 .
  2. DOS 3.3. The Mature DOS. In: OS / 2 Museum. Retrieved June 15, 2017 .
  3. The Fdisk.exe utility may not be able to create a hard disk partition that is larger than 128 GB
  4. Daniel B. Sedory: Detailed Notes on Microsoft's ™ FDISK.EXE Program. In: The Starman's Realm. November 18, 2007, accessed June 15, 2017 .
  5. a b c Daniel B. Sedory: The Standard MBR Code and Notes on the Differences in one OEM version of the DOS 3.30 MBR (Master Boot Record). In: The Starman's Realm. May 18, 2007, accessed June 15, 2017 .