Fdisk#IBM PC DOS
{{short description|Command line utility of DOS and Microsoft Windows operating systems}}
{{lowercase title|title=fdisk}}
{{Infobox software
| name = fdisk
| logo =
| screenshot = Fdisk.png
| screenshot size = 300px
| caption = Screenshot of FDISK on MS-DOS
| developer = Robert Baron, IBM, Microsoft, Digital Research, Datalight, Novell, Brian E. Reifsnyder
| released = {{Release year|1983|03|df=yes}}
| latest release version =
| latest release date =
| operating system = MS-DOS, PC DOS, FlexOS, SISNE plus, OS/2, eComStation, ArcaOS, Windows, DR DOS, ROM-DOS, FreeDOS, PTS-DOS, *BSD,{{cite web | url= http://mdoc.su/-/fdisk.8 | title= fdisk(8) — PC slice table (MBR) maintenance program | work= System Manager's Manual | publisher= FreeBSD, NetBSD, OpenBSD, DragonFly BSD }} SysV
| genre = Command
| license = MS-DOS, PC DOS, FlexOS, OS/2, Windows, DR DOS, ROM-DOS, PTS-DOS: Proprietary commercial software
FreeDOS: GNU GPLv2
| website =
}}
fdisk is a command-line utility for disk partitioning. It has been part of DOS, DR FlexOS, IBM OS/2, and early versions of Microsoft Windows, as well as certain ports of FreeBSD,{{r|f}} NetBSD,{{r|n}} OpenBSD,{{r|o}} DragonFly BSD{{r|d}} and macOS{{r|x}} for compatibility reasons. Windows 2000 and its successors have replaced fdisk with a more advanced tool called diskpart.
Implementations
=DOS=
IBM introduced the first version of fdisk (officially dubbed "Fixed Disk Setup Program") in March 1983, with the release of the IBM PC/XT computer (the first PC to store data on a hard disk) and the IBM PC DOS 2.0 operating system. fdisk version 1.0 can create one FAT12 partition, delete it, change the active partition, or display partition data. fdisk writes the master boot record, which supports up to four partitions. The other three were intended for other operating systems such as CP/M-86 and Xenix, which were expected to have their own partitioning utilities.
Microsoft first added fdisk to MS-DOS in version 3.2.{{Cite book|author-last=Wolverton|author-first=Van|title=Running MS-DOS Version 6.22 (20th Anniversary Edition), 6th Revised edition|date=2003|publisher=Microsoft Press|isbn=0-7356-1812-7}} MS-DOS versions 2.0 through 3.10 included OEM-specific partitioning tools, which may have been named fdisk.
PC DOS 3.0, released in August 1984, added support for FAT16 partitions to handle larger hard disks more efficiently. PC DOS 3.30, released in April 1987, added support for extended partitions. (These partitions do not store data directly but can contain up to 23 logical drives.) In both cases, fdisk was modified to work with FAT16 and extended partitions. Support for FAT16B was first added to Compaq's fdisk in MS-DOS 3.31. FAT16B later became available with MS-DOS and PC DOS 4.0.
The undocumented /mbr
switch in fdisk, which could repair the master boot record, soon became popular.
IBM PC DOS 7.10 shipped with the new fdisk32 utility.
ROM-DOS,{{cite web|url=https://www.datalight.com/assets/files/ROM-DOS_Users_Guide.pdf|title=Datalight ROM-DOS User's Guide|website=www.datalight.com}} DR DOS 6.0[https://www.4corn.co.uk/archive/docs/DR%20DOS%206.0%20User%20Guide-opt.pdf DR DOS 6.0 User Guide Optimisation and Configuration Tips] FlexOS,http://www.bitsavers.org/pdf/digitalResearch/flexos/1073-2003_FlexOS_Users_Guide_V1.3_Nov86.pdf {{Webarchive|url=https://web.archive.org/web/20190925131719/http://bitsavers.org/pdf/digitalResearch/flexos/1073-2003_FlexOS_Users_Guide_V1.3_Nov86.pdf |date=2019-09-25 }} {{Bare URL PDF|date=March 2022}} PTS-DOS 2000 Pro,{{cite web |title=PTS-DOS 2000 Pro User Manual |publisher=Paragon Technology GmbH |location=Buggingen, Germany |date=1999 |url=http://download.paragon-software.com/doc/manual_dos_eng.pdf |access-date=2018-05-12 |url-status=live |archive-url=https://web.archive.org/web/20180512094512/http://download.paragon-software.com/doc/manual_dos_eng.pdf |archive-date=2018-05-12}} and FreeDOS,{{cite web|title=ibiblio.org FreeDOS Group -- FreeDOS Base|url=http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.2/repos/pkg-html/group-base.html|access-date=2020-06-03|website=www.ibiblio.org}} include an implementation of the fdisk command.
=Windows=
File:Microsoft Windows 95 Version 4.00.1111 fdisk command 492x259.png]]
Windows 95, Windows 98, and Windows ME shipped with a derivative of the MS-DOS fdisk. Windows 2000 and its successors, however, came with the more advanced{{according to whom|date=January 2025}} diskpart and the graphical Disk Management utilities.
Starting with Windows 95 OSR2, fdisk supports the FAT32 file system.{{cite web|url=https://support.microsoft.com/en-us/kb/255867|title=How to Use the Fdisk and Format Tools to Partition or Repartition a Hard Disk |work=Support |publisher=Microsoft |date=28 June 2012 |edition=6.0}}
The version of fdisk that ships with Windows 95 does not report the correct size of a hard disk that is larger than 64 GB. An updated fdisk is available from Microsoft to correct this issue.{{cite web |url=https://support.microsoft.com/en-us/kb/263044 |title=Fdisk Does Not Recognize Full Size of Hard Disks Larger than 64 GB |publisher=Microsoft |date=24 August 2012 |edition=4.0 |website=Support}} In addition, fdisk cannot create partitions larger than 512 GB, even though FAT32 supports partitions as big as 2 TB. This limitation applies to all versions of fdisk supplied with Windows 95 OSR 2.1, Windows 98 and Windows ME.
=IBM OS/2=
Before version 4.0, OS/2 shipped with two partition table managers. These were the text mode fdisk{{cite web |url=http://www.jatomes.com/Help/Os2Cmd.php#FDISK |title=JaTomes Help - OS/2 Commands |access-date=2019-06-20 |archive-date=2019-04-14 |archive-url=https://web.archive.org/web/20190414130029/http://www.jatomes.com/Help/Os2Cmd.php#FDISK |url-status=dead }} and the graphical fdiskpm.{{cite web |url=http://www.jatomes.com/Help/Os2Cmd.php#FDISKPM |title=JaTomes Help - OS/2 Commands |access-date=2019-06-20 |archive-date=2019-04-14 |archive-url=https://web.archive.org/web/20190414130029/http://www.jatomes.com/Help/Os2Cmd.php#FDISKPM |url-status=dead }} The two have identical functionality, and can manipulate both FAT partitions and the more advanced HPFS partitions.
OS/2 4.5 and higher (including eComStation and ArcaOS) can use the JFS file system, as well as FAT and HPFS. They replaced fdisk with the Logical Volume Manager (LVM).
=Mach and 386BSD=
{{Anchor|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD|DragonFly BSD|OS X|macOS}}
fdisk for Mach Operating System was written by Robert Baron. It was ported to 386BSD by Julian Elischer,{{cite web|url=https://www.freebsd.org/cgi/man.cgi?fdisk|title = Fdisk}} and the implementation is being used by FreeBSD,{{cite web |url= http://bxr.su/f/sbin/fdisk/ |title= fdisk — PC slice table maintenance utility |website= BSD Cross Reference |publisher= FreeBSD}}
- {{cite book |section=fdisk -- PC slice table maintenance utility |title=FreeBSD Manual Pages |url=http://mdoc.su/f/fdisk.8}} NetBSD{{cite web |url= http://bxr.su/n/sbin/fdisk/ |title= fdisk — MS-DOS partition maintenance program |website= BSD Cross Reference |publisher= NetBSD}} and DragonFly BSD,{{cite web |url= http://bxr.su/d/sbin/fdisk/ |title= fdisk — PC slice table (MBR) maintenance program |website= BSD Cross Reference |publisher= DragonFly BSD}}
- {{cite book |section=fdisk - PC slice table (MBR) maintenance program |title=DragonFly On-Line Manual Pages |url=http://mdoc.su/d/fdisk.8}} all as of 2019, as well as the early versions of OpenBSD between 1995 and 1997 before OpenBSD 2.2.{{r|*bsd}}
Tobias Weingartner re-wrote fdisk in 1997 before OpenBSD 2.2,{{cite web |url= http://bxr.su/o/sbin/fdisk/ |title= fdisk — partition table maintenance program |website= BSD Cross Reference |publisher= OpenBSD}}
- {{cite book |section=fdisk — partition table maintenance program |title=OpenBSD manual page server |url=http://mdoc.su/o/fdisk.8}} which has subsequently been forked by Apple Computer, Inc in 2002, and is still used as the basis for fdisk on macOS as of 2019.{{citation |section-url= https://opensource.apple.com/source/diskdev_cmds/diskdev_cmds-593.221.1/fdisk.tproj/fdisk.8 |section= fdisk.tproj/fdisk.8 |url= https://opensource.apple.com/release/macos-10141.html |title= macOS 10.14.1 |publisher= Apple |access-date= 2019-04-11 |archive-date= 2019-04-11 |archive-url= https://web.archive.org/web/20190411071119/https://opensource.apple.com/release/macos-10141.html |url-status= dead }}
For native partitions, BSD systems traditionally use BSD disklabel, and fdisk partitioning is supported only on certain architectures (for compatibility reasons) and only in addition to the BSD disklabel (which is mandatory).
=Linux=
In Linux, fdisk is a part of a standard package distributed by the Linux Kernel organization, util-linux. The original program was written by Andries E. Brouwer and A. V. Le Blanc and was later rewritten by Karel Zak and Davidlohr Bueso when they forked the util-linux package in 2006. An alternative, ncurses-based program, cfdisk, allows users to create partition layouts via a text-based user interface (TUI).{{Cite web |last=Sharma |first=Deepesh |date=2021-02-22 |title=How to Create, Resize and Delete Linux Partitions With Cfdisk |url=https://www.makeuseof.com/how-to-create-resize-and-delete-linux-partitions-with-cfdisk/ |access-date=2023-05-15 |website=MUO |language=en}}
See also
References
{{Reflist}}
Further reading
- {{Cite book|author-last=Wolverton|author-first=Van|title=MS-DOS Commands: Microsoft Quick Reference, 4th Revised edition|date=1990|publisher=Microsoft Press|isbn=978-1556152894}}
- {{Cite book|author1=Kathy Ivens|author2=Brian Proffit|year=1993|title=OS/2 Inside & Out|publisher=Osborne McGraw-Hill|isbn=978-0078818714}}
- {{Cite book|author1=Tim O'Reilly|author2=Troy Mott|author3=Walter Glenn|year=1999|title=Windows 98 in a Nutshell: A Desktop Quick Reference|publisher=O'Reilly|isbn=978-1565924864|url-access=registration|url=https://archive.org/details/windows98innutsh00orei}}
External links
{{Wikibooks|Guide to Windows Commands}}
- [http://tldp.org/HOWTO/Partition/fdisk_partitioning.html Linux Partition HOWTO. Partitioning with fdisk]
- [https://www.die.net/doc/linux/man/man8/fdisk.8.html Linux Programmer's Manual, fdisk(8)]
- [https://git.kernel.org/cgit/utils/util-linux/util-linux.git/ fdisk from utils-linux-ng]
- [http://linux.die.net/man/8/blkid blkid - command-line utility to locate/print block device attributes ]
- [http://docs.fedoraproject.org/en-US/Fedora/17/html/System_Administrators_Guide/s2-sysinfo-filesystems-blkid.html Using the blkid Command] {{Webarchive|url=https://web.archive.org/web/20160913013722/http://docs.fedoraproject.org/en-US/Fedora/17/html/System_Administrators_Guide/s2-sysinfo-filesystems-blkid.html |date=2016-09-13 }} .
- [http://www.freebsd.org/cgi/man.cgi?fdisk FreeBSD System Manager's Manual, FDISK(8)]
{{Windows commands}}
Category:External DOS commands
Category:Unix file system-related software