# Fdisk

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Fdisk
> Markdown URL: https://mediated.wiki/source/Fdisk.md
> Source: https://en.wikipedia.org/wiki/Fdisk
> Source revision: 1321269966
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

{{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](/source/MS-DOS)
| developer = Robert Baron, [IBM](/source/IBM), [Microsoft](/source/Microsoft), [Digital Research](/source/Digital_Research), [Datalight](/source/Datalight), [Novell](/source/Novell), Brian E. Reifsnyder
| released = {{Release year|1983|03|df=yes}}
| latest release version = 
| latest release date = 
| operating system = [MS-DOS](/source/MS-DOS), [PC DOS](/source/IBM_PC_DOS), [FlexOS](/source/FlexOS), [SISNE plus](/source/SISNE_plus), [OS/2](/source/OS%2F2), [eComStation](/source/eComStation), [ArcaOS](/source/ArcaOS), [Windows](/source/Microsoft_Windows), [DR DOS](/source/DR_DOS), [ROM-DOS](/source/ROM-DOS), [FreeDOS](/source/FreeDOS), [PTS-DOS](/source/PTS-DOS), *[BSD](/source/BSD),<ref name=*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](/source/FreeBSD), [NetBSD](/source/NetBSD), [OpenBSD](/source/OpenBSD), [DragonFly BSD](/source/DragonFly_BSD) }}</ref> [SysV](/source/SysV)
| genre = [Command](/source/Command_(computing))
| license = MS-DOS, PC DOS, FlexOS, OS/2, Windows, DR DOS, ROM-DOS, PTS-DOS: [Proprietary](/source/Proprietary_software) [commercial software](/source/commercial_software)<br />
FreeDOS: [GNU GPLv2](/source/GNU_GPLv2)
| website = 
}}

'''fdisk''' is a [command-line utility](/source/command-line_utility) for [disk partitioning](/source/disk_partitioning). It has been part of [DOS](/source/DOS), [DR](/source/Digital_Research) [FlexOS](/source/FlexOS), [IBM](/source/IBM) [OS/2](/source/OS%2F2), and early versions of [Microsoft Windows](/source/Microsoft_Windows), as well as certain ports of [FreeBSD](/source/FreeBSD),{{r|f}} [NetBSD](/source/NetBSD),{{r|n}} [OpenBSD](/source/OpenBSD),{{r|o}} [DragonFly BSD](/source/DragonFly_BSD){{r|d}} and [macOS](/source/macOS){{r|x}} for compatibility reasons. [Windows 2000](/source/Windows_2000) and its successors have replaced fdisk with a more advanced tool called [diskpart](/source/diskpart).

==Implementations==

===DOS===
[IBM](/source/IBM) introduced the first version of fdisk (officially dubbed "Fixed Disk Setup Program") in March 1983, with the release of the [IBM PC/XT](/source/IBM_PC%2FXT) computer (the first PC to store data on a [hard disk](/source/hard_disk)) and the [IBM PC DOS](/source/IBM_PC_DOS) 2.0 operating system. fdisk version 1.0 can create one [FAT12](/source/FAT12) partition, delete it, change the [active partition](/source/active_partition), or display partition data. fdisk writes the [master boot record](/source/master_boot_record), which supports up to four partitions. The other three were intended for other operating systems such as [CP/M-86](/source/CP%2FM-86) and [Xenix](/source/Xenix), which were expected to have their own partitioning utilities.

Microsoft first added fdisk to [MS-DOS](/source/MS-DOS) in version 3.2.<ref name="RUNNINGMSDOS">{{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](/source/Microsoft_Press)|isbn=0-7356-1812-7}}</ref> 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](/source/FAT16) partitions to handle larger hard disks more efficiently. PC DOS 3.30, released in April 1987, added support for [extended partitions](/source/Disk_partitioning). (These partitions do not store data directly but can contain up to 23 [logical drive](/source/logical_drive)s.) In both cases, fdisk was modified to work with FAT16 and extended partitions. Support for [FAT16B](/source/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 <code>/mbr</code> switch in fdisk, which could repair the [master boot record](/source/master_boot_record), soon became popular.

IBM PC DOS 7.10 shipped with the new fdisk32 utility.

[ROM-DOS](/source/ROM-DOS),<ref>{{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}}</ref> [DR DOS 6.0](/source/DR_DOS_6.0)<ref name="drdos6userguide">[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]</ref> [FlexOS](/source/FlexOS),<ref>{{Cite web |title=FlexOS User's Guide Version 1.3 |url=http://www.bitsavers.org/pdf/digitalResearch/flexos/1073-2003_FlexOS_Users_Guide_V1.3_Nov86.pdf |date=1986-11-01 |url-status=dead |archive-url=https://web.archive.org/web/20211120134812/http://www.bitsavers.org/pdf/digitalResearch/flexos/1073-2003_FlexOS_Users_Guide_V1.3_Nov86.pdf |archive-date=2021-11-20 |website=Bitsavers.og |publisher=[Digital Research](/source/Digital_Research)}}</ref> [PTS-DOS](/source/PTS-DOS) 2000 Pro,<ref>{{cite web |title=PTS-DOS 2000 Pro User Manual |publisher=[Paragon Technology GmbH](/source/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}}</ref> and [FreeDOS](/source/FreeDOS),<ref>{{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}}</ref> include an implementation of the fdisk command.

===Windows===
[[File:Microsoft Windows 95 Version 4.00.1111 fdisk command 492x259.png|thumb|300px|The fdisk command on [Microsoft Windows 95](/source/Microsoft_Windows_95)]]

[Windows 95](/source/Windows_95), [Windows 98](/source/Windows_98), and  [Windows ME](/source/Windows_ME) shipped with a derivative of the MS-DOS fdisk. [Windows 2000](/source/Windows_2000) and its successors, however, came with the more advanced{{according to whom|date=January 2025}} [diskpart](/source/diskpart) and the graphical [Disk Management](/source/Disk_Management) utilities.

Starting with Windows 95 OSR2, fdisk supports the [FAT32](/source/FAT32) file system.<ref>{{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](/source/Microsoft) |date=28 June 2012 |edition=6.0}}</ref> 

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.<ref>{{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](/source/Microsoft) |date=24 August 2012 |edition=4.0 |website=Support}}</ref> 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](/source/OS%2F2) shipped with two partition table managers. These were the [text mode](/source/text_mode) fdisk<ref>{{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 }}</ref> and the [graphical](/source/GUI) fdiskpm.<ref>{{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 }}</ref> The two have identical functionality, and can manipulate both FAT partitions and the more advanced [HPFS](/source/High_Performance_File_System) partitions.

OS/2 4.5 and higher (including [eComStation](/source/eComStation) and [ArcaOS](/source/ArcaOS)) can use the [JFS](/source/IBM_Journaled_File_System_2_(JFS2)) file system, as well as FAT and HPFS. They replaced fdisk with the [Logical Volume Manager](/source/Logical_Volume_Manager_(Linux)) (LVM).

===Mach and 386BSD===
{{Anchor|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD|DragonFly BSD|OS X|macOS}}
fdisk for [Mach Operating System](/source/Mach_(kernel)) was written by Robert Baron. It was ported to [386BSD](/source/386BSD) by Julian Elischer,<ref>{{cite web|url=https://www.freebsd.org/cgi/man.cgi?fdisk|title = Fdisk}}</ref> and the implementation is being used by [FreeBSD](/source/FreeBSD),<ref name=f>{{cite web |url= http://bxr.su/f/sbin/fdisk/ |title= fdisk — PC slice table maintenance utility |website= BSD Cross Reference |publisher= [FreeBSD](/source/FreeBSD)}}
*{{cite book |section=fdisk -- PC slice table maintenance utility |title=FreeBSD Manual Pages |url=http://mdoc.su/f/fdisk.8}}</ref> [NetBSD](/source/NetBSD)<ref name=n>{{cite web |url= http://bxr.su/n/sbin/fdisk/ |title= fdisk — MS-DOS partition maintenance program |website= BSD Cross Reference |publisher= [NetBSD](/source/NetBSD)}}</ref> and [DragonFly BSD](/source/DragonFly_BSD),<ref name=d>{{cite web |url= http://bxr.su/d/sbin/fdisk/ |title= fdisk — PC slice table (MBR) maintenance program |website= BSD Cross Reference |publisher= [DragonFly BSD](/source/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}}</ref> all as of 2019, as well as the early versions of [OpenBSD](/source/OpenBSD) between 1995 and 1997 before OpenBSD 2.2.{{r|*bsd}}

Tobias Weingartner re-wrote fdisk in 1997 before OpenBSD 2.2,<ref name=o>{{cite web |url= http://bxr.su/o/sbin/fdisk/ |title= fdisk — partition table maintenance program |website= BSD Cross Reference |publisher= [OpenBSD](/source/OpenBSD)}}
*{{cite book |section=fdisk — partition table maintenance program |title=OpenBSD manual page server |url=http://mdoc.su/o/fdisk.8}}</ref> which has subsequently been forked by [Apple Computer, Inc](/source/Apple_Computer%2C_Inc) in 2002, and is still used as the basis for fdisk on macOS as of 2019.<ref name=x>{{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](/source/Apple_Inc.) |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 }}</ref>

For native partitions, BSD systems traditionally use [BSD disklabel](/source/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](/source/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](/source/ncurses)-based program, [cfdisk](/source/cfdisk), allows users to create partition layouts via a [text-based user interface](/source/text-based_user_interface) (TUI).<ref>{{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}}</ref>

==See also==
* [List of disk partitioning software](/source/List_of_disk_partitioning_software)
* [format (command)](/source/format_(command))
* [GUID Partition Table](/source/GUID_Partition_Table)

==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](/source/Microsoft_Press)|isbn=978-1556152894}}
*{{Cite book|author1=Kathy Ivens|author2=Brian Proffit|year=1993|title=OS/2 Inside & Out|publisher=[Osborne McGraw-Hill](/source/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](/source/O'Reilly_Media)|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:OS/2 commands
Category:Unix file system-related software
Category:Windows administration
Category:Disk partitioning software

---
Adapted from the Wikipedia article [Fdisk](https://en.wikipedia.org/wiki/Fdisk) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Fdisk?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
