format (command)

{{short description|Command-line utility that carries out disk formatting}}

{{lowercase title}}

{{Infobox software

| name = format

| logo =

| screenshot = Ms-dosformat.png

| screenshot size =

| caption = The MS-DOS {{code|FORMAT}} command

| developer =

| released =

| latest release version =

| latest release date =

| programming language = MS-DOS: x86 assembly language
FreeDOS: C

| operating system = RT-11, 86-DOS, MS-DOS, PC DOS, OS/2, eComStation, ArcaOS, ISIS-II, iRMX 86, TRIPOS, AmigaDOS, Z80-RIO, OS-9, MSX-DOS, FlexOS, PC-MOS, SpartaDOS X, DR DOS, ROM-DOS, 4690 OS, FreeDOS, PTS-DOS, SISNE plus, Windows, ReactOS

| platform = Cross-platform

| genre = Command

| license = MS-DOS: MIT
PC-MOS: GPLv3
FreeDOS: GPLv2
ReactOS: LGPL-2.0-or-later

| website =

}}

In computing, format is a command-line utility that carries out disk formatting. It is a component of various operating systems, including 86-DOS, MS-DOS, IBM PC DOS and OS/2, Microsoft Windows and ReactOS.

Overview

The command performs the following actions by default on a floppy disk, hard disk drive, solid state (USB), or other magnetic medium (it will not perform these actions on optical media):

  1. clearing the FAT entries by changing them to {{mono|0x00}}
  2. clearing the FAT root directory by changing any values found to {{mono|0x00}}{{cite web

|first1=Tim

|last1=Paterson

|author-link1=Tim Paterson

|title=Microsoft DOS V1.1 and V2.0: /msdos/v20source/FORMAT.TXT

|url=http://www.computerhistory.org/atchm/microsoft-research-license-agreement-msdos-v1-1-v2-0/

|publisher=Computer History Museum, Microsoft

|date=2013-12-19

|orig-year=1983

|access-date=2014-03-25

|archive-date=2019-08-14

|archive-url=https://web.archive.org/web/20190814021325/https://www.computerhistory.org/atchm/microsoft-research-license-agreement-msdos-v1-1-v2-0/

|url-status=live

}} (NB. While the publishers claim this would be MS-DOS 1.1 and 2.0, it actually is SCP MS-DOS 1.25 and a mixture of Altos MS-DOS 2.11 and TeleVideo PC DOS 2.11.){{Cite web

|url=http://www.computerhistory.org/atchm/microsoft-ms-dos-early-source-code/

|title=Microsoft MS-DOS early source code

|series=Software Gems: The Computer History Museum Historical Source Code Series

|first=Len

|last=Shustek

|date=2014-03-24

|access-date=2014-03-29

|archive-date=2019-08-10

|archive-url=https://web.archive.org/web/20190810045508/https://www.computerhistory.org/atchm/microsoft-ms-dos-early-source-code/

|url-status=live

}} (NB. While the author claims this would be MS-DOS 1.1 and 2.0, it actually is SCP MS-DOS 1.25 and a mixture of Altos MS-DOS 2.11 and TeleVideo PC DOS 2.11.){{cite web

|url=http://blogs.technet.com/b/microsoft_blog/archive/2014/03/25/microsoft-makes-source-code-for-ms-dos-and-word-for-windows-available-to-public.aspx

|title=Microsoft makes source code for MS-DOS and Word for Windows available to public

|date=2014-03-25

|first=Roy

|last=Levin

|work=Official Microsoft Blog

|access-date=2014-03-29

|archive-url=https://web.archive.org/web/20140328094124/http://blogs.technet.com/b/microsoft_blog/archive/2014/03/25/microsoft-makes-source-code-for-ms-dos-and-word-for-windows-available-to-public.aspx

|archive-date=2014-03-28

|url-status=dead

}} (NB. While the author claims this would be MS-DOS 1.1 and 2.0, it actually is SCP MS-DOS 1.25 and a mixture of Altos MS-DOS 2.11 and TeleVideo PC DOS 2.11.)

  1. checking each cluster to see if it is good or bad and marking it as good or bad in the FAT

Any storage device must have its medium structured to be useful. This process is referred to as "creating a filesystem" in Unix, Linux, or BSD.{{man|8|newfs|FreeBSD|EXAMPLE section}} Under these systems different commands are used. The commands can create many kinds of file systems, including those used by DOS, Windows, and OS/2.

Implementations

File:IBM PC DOS 1.0 screenshot.png 1.0.]]

File:CPM-86.png]]

The command is also available in Intel ISIS-II,{{Cite web |url=http://bitsavers.org/pdf/intel/ISIS_II/9800306-06_ISIS-II_Users_Guide_May81.pdf |title=ISIS II Users Guide |access-date=2019-02-03 |archive-date=2019-01-26 |archive-url=https://web.archive.org/web/20190126011055/http://bitsavers.org/pdf/intel/ISIS_II/9800306-06_ISIS-II_Users_Guide_May81.pdf |url-status=live }} iRMX 86,{{Cite web|url=https://archive.org/details/bitsavers_inteliRMX1_19819263|title=intel :: iRMX :: 146194-001 irmxR6Intro|via=Internet Archive}} MetaComCo TRIPOS,https://www.pagetable.com/docs/amigados_tripos/tripos_manuals.pdf {{Webarchive|url=https://web.archive.org/web/20201021043218/https://www.pagetable.com/docs/amigados_tripos/tripos_manuals.pdf |date=2020-10-21 }} {{Bare URL PDF|date=March 2022}} AmigaDOS,{{cite book |url= https://archive.org/details/1988-rugheimer-spanik-amigados-quick-reference|title=Quick reference|via=archive.org|year=1988|isbn=9781557550491|access-date=2020-09-14|last1=Rugheimer|first1=Hannes|publisher=Abacus }} Zilog Z80-RIO,{{Cite web |url=https://www.z80cpu.eu/mirrors/oldcomputers.dyndns.org/public/pub/rechner/zilog/zds/z80-rio_os_userman.pdf |title=Z80-RIO OPERATING SYSTEM USER'S MANUAL |access-date=2020-02-14 |archive-date=2022-01-28 |archive-url=https://web.archive.org/web/20220128041146/https://www.z80cpu.eu/mirrors/oldcomputers.dyndns.org/public/pub/rechner/zilog/zds/z80-rio_os_userman.pdf |url-status=live }} Microware OS-9,{{cite book|author=Paul S. Dayan|year=1992|title=The OS-9 Guru - 1 : The Facts|publisher=Galactic Industrial Limited|isbn=0-9519228-0-7}} DR FlexOS,{{cite web |url=http://www.bitsavers.org/pdf/digitalResearch/flexos/1073-2003_FlexOS_Users_Guide_V1.3_Nov86.pdf |title=FlexOS User's Guide |date=1986 |website=www.bitsavers.org |access-date=2020-09-14 |archive-date=2019-09-25 |archive-url=https://web.archive.org/web/20190925131719/http://bitsavers.org/pdf/digitalResearch/flexos/1073-2003_FlexOS_Users_Guide_V1.3_Nov86.pdf |url-status=dead }} TSL PC-MOS,{{Cite web|url=https://github.com/roelandjansen/pcmos386v501|title=roelandjansen/pcmos386v501|website=GitHub|date=2 January 2022|access-date=28 July 2019|archive-date=4 May 2021|archive-url=https://web.archive.org/web/20210504053616/https://github.com/roelandjansen/pcmos386v501|url-status=live}} SpartaDOS X,{{Cite web |url=http://sdx.atari8.info/sdx_files/4.48/SDX448_User_Guide.pdf |title=SpartaDOS X 4.48 User Guide |access-date=2019-03-16 |archive-date=2021-10-10 |archive-url=https://web.archive.org/web/20211010113045/http://sdx.atari8.info/sdx_files/4.48/SDX448_User_Guide.pdf |url-status=live }} Datalight 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|access-date=2020-01-18|archive-date=2019-04-21|archive-url=https://web.archive.org/web/20190421143059/https://www.datalight.com/assets/files/ROM-DOS_Users_Guide.pdf|url-status=live}} IBM/Toshiba 4690 OS,{{cite web |url= https://archive.org/details/4690OSV6r2UsersGuide/page/n169|title=Users guide|website=archive.org|access-date=2020-09-14}} PTS-DOS,

{{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}} SISNE plus,{{Cite web|url=https://datassette.org/manuais/ibm-pc/sisne-plus-referencia-sumaria|title=SISNE plus - Referência Sumária|date=May 14, 2015|website=Datassette|access-date=September 28, 2019|archive-date=September 28, 2019|archive-url=https://web.archive.org/web/20190928211058/https://datassette.org/manuais/ibm-pc/sisne-plus-referencia-sumaria|url-status=live}} and in the DEC RT-11{{Cite web|url=http://paleoferrosaurus.com/beta/documents/rt11help.html#FORMAT|title=RT-11 HELP FILE|website=paleoferrosaurus.com|access-date=2018-07-16|archive-date=2018-07-17|archive-url=https://web.archive.org/web/20180717041552/http://paleoferrosaurus.com/beta/documents/rt11help.html#FORMAT|url-status=dead}} operating system.

=Microsoft DOS and Windows=

On MS-DOS, the command is available in versions 1 and later.{{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}}

Optionally (by adding the /S, for "system" switch), format can also install a Volume Boot Record. With this option, Format writes bootstrap code to the first sector of the volume (and possibly elsewhere as well). Format always writes a BIOS Parameter Block to the first sector, with or without the /S option.

Another option (/Q) allows for what Microsoft calls "Quick Format". With this option the command will not perform steps 2 and 3 above.{{Citation needed|date=April 2009}} Format /Q does not alter data previously written to the media.

Typing "format" with no parameters in MS-DOS 3.2 or earlier would automatically, without prompting the user, format the current drive; however in MS-DOS 3.3 and later it would simply produce the error: "required parameter missing".{{Citation needed|date=February 2020|reason=Original Research}}

=DR/Novell DOS=

DR DOS 6.0 includes an implementation of the {{code|format}} command.{{Cite web |url=https://www.4corn.co.uk/archive/docs/DR%20DOS%206.0%20User%20Guide-opt.pdf |title=DR DOS 6.0 User Guide Optimisation and Configuration Tips |access-date=2019-08-12 |archive-date=2019-09-30 |archive-url=https://web.archive.org/web/20190930135943/http://www.4corn.co.uk/archive/docs/DR%20DOS%206.0%20User%20Guide-opt.pdf |url-status=live }}

=FreeDOS=

The FreeDOS version was developed by Brian E. Reifsnyder and is licensed under the GPL.{{Cite web|url=http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.2/repos/pkg-html/format.html|title=ibiblio.org FreeDOS Package -- Format (FreeDOS Base)|website=www.ibiblio.org|access-date=2018-11-13|archive-date=2018-11-19|archive-url=https://web.archive.org/web/20181119030222/http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.2/repos/pkg-html/format.html|url-status=live}}

=ReactOS=

File:ReactOS-0.4.13 format command 667x514.png]]

The ReactOS implementation is based on a free clone developed by Mark Russinovich for Sysinternals in 1998. It is licensed under the GPL.{{Cite web|url=https://github.com/reactos/reactos|title=reactos/reactos|website=GitHub|date=3 January 2022|access-date=9 June 2019|archive-date=11 December 2017|archive-url=https://web.archive.org/web/20171211170155/https://github.com/reactos/reactos|url-status=live}}

It was adapted to ReactOS by Emanuele Aliberti in 1999 and supports FAT, FAT32, FATX, EXT2, and BtrFS filesystems.

See also

Notes

The directory entries get filled with 0x00 since MS-DOS 1.25 and PC DOS 2.0. If the Format command line option /O is provided, the first byte of each directory entry is set to 0xE5h to create a FAT format usable by PC DOS 1.0-1.1. However, not providing /O will significantly speed up directory searches under MS-DOS 1.25 and PC DOS 2.0 and higher. Older versions of MS-DOS, PC DOS, and 86-DOS only supported the 0xE5 marker.

References

{{Reflist}}

Further reading

  • {{Cite book|author-last=Cooper|author-first=Jim|title=Special Edition Using MS-DOS 6.22, Third Edition|date=2001|publisher=Que Publishing|isbn=978-0789725738}}
  • {{Cite book|author1=Kathy Ivens|author2=Brian Proffit|year=1993|title=OS/2 Inside & Out|publisher=Osborne McGraw-Hill|isbn=978-0078818714}}
  • {{Cite book|first=Æleen|last=Frisch|year=2001|title=Windows 2000 Commands Pocket Reference|publisher=O'Reilly|isbn=978-0-596-00148-3}}