Command: format
FORMAT formats a hard drive or floppy disk. This prepares the
medium for the use with FreeDOS.
Syntax:
FORMAT drive [/V[:label]] [/Q] [/U] [/F:size] [/S] [/D]
FORMAT drive [/V[:label]] [/Q] [/U] [/T:tracks /N:sectors] [/S] [/D]
FORMAT drive [/V[:label]] [/Q] [/U] [/4] [/S] [/D]
FORMAT [/?]
drive The drive letter, e.g. C:
Options:
/1 Format a single-sided disk (160k/180k).
/4 Format a 160k/360k floppy disk in a 1.2 MB floppy drive.
/8 Format a 5-1/4 inch disk with 8 sectors per track
(160k/320k, DOS 1.x).
/A Forces 4k alignment for FAT32 formatting.
/B Reserve space to make a bootable disk (is dummy and cannot
be combined with /s (sys)).
/D Be very verbose and show debugging output. For bug reports.
/F:size Specifies the size of the floppy disk to format. Normal
sizes are: 360, 720, 1200, 1440, or 2880 (unit: kiloBytes).
160,180,320 should also work. /F:0 shows a list of allowed
sizes.
/N:sectors Specifies the number of sectors per track on a floppy disk.
/Q Quick formats the disk. If not combined with /U, can be
UNFORMATed and preserves bad cluster marks (/Q /U does not)
/S Calls SYS to make the disk bootable and to add system files
/T:tracks Specifies the number of tracks on a floppy disk.
/U Unconditionally formats the disk. Lowlevel format if
floppy disk.
NOTE: This option may last VERY VERY long! Press ESC and
wait to exit /U.
/V:label Specifies a volume LABEL for the disk, stores date and
time of it (is not for 160k/320k disks).
/Y Skip confirmation request.
/Z:longhelp: Gives detailed, technical usage information.
/Z:mirror Saves the UNFORMAT "MIRROR data", without formatting the
disk.
/Z:seriously Suppresses the confirmation request when you use format
with a hard disk.
/Z:unformat Unformats the disk, if the MIRROR data is fresh.
/? Shows the help.
Comments:
Warning: while format supports FAT32, running under Win9x to create FAT32
does not work well.
Modes for FLOPPY are: Tries to use quick safe format. Use lowlevel format
only when needed. Quick safe format saves mirror data for UNFORMAT.
Modes for HARDDISK are: Tries to use quick safe format. Use quick full
format only when needed. Quick full format only resets the filesystem.
If you want to force lowlevel format (floppy) or want to have the whole
disk surface scanned and all contents wiped (harddisk), use /U.
FORMAT /Q /U is quick full format (no lowlevel format / scan / wipe!)
FORMAT /Q is quick save format (save mirror data if possible)
The mirror data will always overwrite the end of the data area!
FORMAT autoselects a mode (see above) if you select neither /Q nor /U.
Supported FAT types are: FAT12, FAT16, FAT32, all with mirror / unformat.
Supported floppy sizes are: 160k, 180k, 320k, 360k and 1200k for 5,25
inch and 720k and 1440k (2880k never tested so far) for 3,5 inch drives.
Supported overformats are: 400k, 800k, 1680k (and 3660k) with more
sectors and 1494k (instead of 1200k) and 1743k (and 3486k) with more
tracks, too. More tracks will not work on all drives, use at your own
risk.
Warning: older DOS versions can only use overformats with a driver.
720k in 1440k needs 720k media. Use a 360k drive to format 360k.
For FAT32 formatting, you can use the /A switch to force 4k alignment.
FORMAT has the following EXITCODES (ERRORLEVEL):
0 Okay,
1 Bad sectors detected (only if /d or /y or
/z:seriously option active)
2 Help screen shown or syntax error,
3 User abort,
4 Format error,
5 User did not confirm.
Errorlevels 1 and 2 are extensions beyond MS FORMAT style.
If you use the /D flag, errorlevels will be different.
They will be specific to the particular FORMAT version.
In 0.91t, for example:
0 Okay,
1 Bad sectors detected,
2 Help displayed or syntax error,
10..13 Userint error (not confirmed / syntax error)
20..22 Createfs error (filesystem creation),
25..29 dDrive I/O error,
30..31 Recordbc error (existing filesystem analysis),
35..36 Uformat error (unconditional format),
38..39 Savefs error (SafeFormat / Mirror)
40..52 Floppy error,
55..59 Hdisk error,
60..62 Main error: unsuitable drive type, e.g. CD-ROM,
128..255 Critical error (userint: (DOS or BIOS error code) | 128)
Examples:
format a: /f:1440 formats a 1,4 MB diskette
format c: /v:my_hd formats a harddisk, label: my_hd
See also:
fdisk
label
mirror
sys
undelete
unformat
File:
Please read this command's lsm file also.
You will find the updated version (internet) here and
the version described in this manual page here.
The lsm file contains information about the name of the programmer,
the download site, and some other command related information.
Copyright © 1998 Jim Hall, updated 2008 by W. Spiegl.
This file is derived from the FreeDOS Spec Command HOWTO.
See the file H2Cpying for copying conditions.