format (command)

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 to0x00
  2. clearing the FAT root directory by changing any values found to0x00
  3. 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. 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

FORMAT.COM, among several other commands, in IBM PC DOS 1.0.
FORMAT.CMD in CP/M-86

The command is also available in Intel ISIS-II, iRMX 86, MetaComCo TRIPOS, AmigaDOS, Zilog Z80-RIO, Microware OS-9, DR FlexOS, TSL PC-MOS, SpartaDOS X, Datalight ROM-DOS, IBM/Toshiba 4690 OS, PTS-DOS, SISNE plus, and in the DEC RT-11 operating system.

Microsoft DOS and Windows

On MS-DOS, the command is available in versions 1 and later.

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. 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".

DR/Novell DOS

DR DOS 6.0 includes an implementation of the format command.

FreeDOS

The FreeDOS version was developed by Brian E. Reifsnyder and is licensed under the GPL.

ReactOS

The format command on ReactOS

The ReactOS implementation is based on a free clone developed by Mark Russinovich for Sysinternals in 1998. It is licensed under the GPL. It was adapted to ReactOS by Emanuele Aliberti in 1999 and supports FAT, FAT32, FATX, EXT2, and BtrFS filesystems.

See also

Notes

References

Further reading

Uses material from the Wikipedia article format (command), released under the CC BY-SA 4.0 license.