Home > Commands A-M > Commands F

FORMAT


Description | Syntax | Parameters | Switches | Related | Notes | Examples | Errorlevels | Availability

Formats a disk for use with the operating system.

The FORMAT command creates a new root directory and file allocation table for the disk. It can also check for bad areas on the disk, and it can delete all data on the disk. In order for the operating system to be able to use a new disk, you must first use this command to format the disk.


Syntax

FORMAT /?

FORMAT drive: [/V[:label]] [[/Q] | [/AUTOTEST]] [/FS:file-system] [[/1] [/4] [/8]] | [/A:size] | [/F:size] | [/T:tracks /N:sectors] [/B | /S] [/C] [/BACKUP] [/FORCE] [[/SELECT | /U]] [/X] [/Z:nn]

Warning: Do not format a floppy disk at a size higher than it was designed for. For more information, see Formatting a floppy disk.


Parameters
drive: (v1.0 Win95 NT3.1)
Specifies the drive containing the disk you want to format. You must specify a drive parameter. If you do not specify any of the switches, FORMAT uses the drive type to determine the default format for the disk.
If the disk was previously formatted and you do not use the /U switch, the old file allocation table and root directory are saved to allow unformatting of the disk if necessary. If you realize that you formatted the wrong disk, use the UNFORMAT command as soon as possible.

Switches
/? (NTXP)
Display help.
/1 (v1.0 Win95 NT3.1 through NT2000)
Formats a single side of a floppy disk.
/4 (v1.0 Win95 NT3.1 through NT2000)
Formats a 5.25-inch, 360K, double-sided, double-density floppy disk on a 1.2-MB disk drive. Some 360K drives cannot reliably read disks formatted with this switch. When used with the /1 switch, this switch formats a 5.25-inch, 180K, single-sided floppy disk.
/8 (v1.0 Win95 NT3.1 through NT2000)
Formats a 5.25-inch disk with 8 sectors per track. This switch formats a floppy disk to be compatible with DOS versions earlier than v2.0.
/AUTOTEST (v4.0)
UNDOCUMENTED. Do NOT prompt for input or show warning messages. Can be used in conjunction with the /U, /S, and /F switches. It is not compatible with /Q (causes error message) and /V is ignored.
/A:size (NT3.1)
Allocation unit size.
Default settings (via /F) are strongly recommended for general use.
FAT supports 8192, 16K, 32K, 64K, (128K, 256K for sector size > 512 bytes) Number of clusters <= 65526.
FAT32 supports 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K, (128K, 256K for sector size > 512 bytes) 65526 < Number of clusters < 268435446.
NTFS supports 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K (compression is not supported for allocation unit sizes > 4096).
/B (v1.0 Win95 through Win98)
Reserves space for the system files IO.SYS and MSDOS.SYS (as hidden files) on a newly formatted disk. In previous versions of DOS, it was necessary to reserve this space before using the SYS command to copy the system files to the disk. This switch is maintained in DOS v6.0 for compatibility reasons only.
/BACKUP (v4.0)
UNDOCUMENTED. Similar to /AUTOTEST. Asks for Volume label and displays number of bytes available.
/C (v6.2 Win95)
Retests bad clusters. By default, if a drive contains clusters that have been marked as "bad", FORMAT does not retest the clusters; it simply leaves them marked "bad". Use the /C switch if you want FORMAT to retest all bad clusters on the drive. (In previous versions of DOS, FORMAT always retested any bad clusters.)
(NT4)
Compression - files added to the new disk will be compressed. NTFS compression is not supported for allocation units above 4096.
/F:size (v4.0 Win95 NT3.1)
Specifies the size of the floppy disk to format. When possible, use this switch instead of the /T and /N switches. Use one of the values for size:
     SIZE          size   sides     density  3.5 / 5.25
     160[K[B]]    160KB, single,     double, 5.25
     180[K[B]]    180KB, single,     double, 5.25
     320[K[B]]    320KB, double,     double, 5.25
     360[K[B]]    360KB, double,     double, 5.25
     640  NT2000
     720[K[B]]    720KB, double,     double, 3.5

     1200[K[B]]
     1.2[M[B]]    1.2MB, double,  quadruple, 5.25
     1.23 NT2000
     1440[K[B]]
     1.44[M[B]]  1.44MB, double,  quadruple, 3.5
     2880[K[B]]
     2.88[M[B]]  2.88MB, double, extra-high, 3.5
     20.8[M[B]]  20.8MB, floptical (mag-op), 3.5
     SIZE          size   sides     density  3.5 / 5.25
/FORCE (NTXP)
UNDOCUMENTED. ?
Thanks to Menachem Shapiro!
/FS:file-system (NT3.1)
The file system (FAT, FAT32 or NTFS). The NTFS file system does not function on floppy disks.
/N:sectors (v3.30 Win95 NT3.1)
Specifies the number of sectors per track. When possible, use the /F switch instead of this switch. You must also use the /T switch. These two switches provide an alternative method of specifying the size of the disk being formatted. You cannot use with /F.
/Q (v4.0 OR? v5.0 Win95 NT3.1)
Specifies a quick format of a disk. With this switch, FORMAT deletes the file allocation table (FAT) and the root directory of a previously formatted disk, but does not scan the disk for bad areas. Use to format only previously formatted disks that you know are in good condition.
/S (v1.0 Win95 through Win98)
Copies the operating system files IO.SYS, MSDOS.SYS, and COMMAND.COM from your system's startup drive to a newly formatted disk that you can use as a system disk. If FORMAT cannot find the operating system files, it prompts you to insert a system disk.
/SELECT (v4.0)
UNDOCUMENTED. Removes the format from a formatted disk; press Y then Enter at the pause. No messages displayed. DOS 4.0x's Setup program used this switch to remove a 12-bit FAT format from a hard disk before reformatting it with a 16-bit FAT, which allowed use of hard drives bigger than 32 Mb.
Do not use with /U switch, it will fill sector 0 with F6h, making the disk unreadable.
/T:tracks (v3.30 Win95 NT3.1)
Specifies the number of tracks on the disk. When possible, use the /F switch instead of this switch. You must also use the /N switch. These two switches provide an alternative method of specifying the size of the disk being formatted. You cannot use with /F.
/U (v4.0 OR? v5.0 Win95)
Specifies an unconditional format of a disk. Unconditional formatting destroys all existing data on a disk and prevents you from later "unformatting" the disk. You should use /U if you have received read and write errors during use of a disk. For information about unformatting a disk, see the UNFORMAT command.
Beginning with v7.00 and Win95 ALL formats are unconditional. For BATCH purposes, the switch is still supported, it just doesn't DO anything.
/V:[label] (v1.0 Win95 NT3.1)
Specifies the volume label. A volume label identifies the disk and can be a maximum of 11 characters. If you omit the /V switch or use it without specifying a volume label, the operating system prompts you for the volume label after the formatting is completed. If you format more than one disk by using one FORMAT command, all of the disks will be given the same volume label. Not compatible with the /8 switch. For more information about disk volume labels, see the DIR, LABEL, and VOL commands.
/X (NT2000)
Forces the volume to dismount first if necessary. All opened handles to the volume would no longer be valid.
/Z:nn (v7.00)
UNDOCUMENTED. Specifies the cluster size in multiples of 512 bytes. Valid values on nn are:

Related

For information about restoring disks after using the FORMAT command, see the UNFORMAT command.

Disk Administrator - %SYSTEMROOT%\system32\windisk.exe.
GDISK - Ghost Disk, a popular 3rd party tool.
WINNT /O - Create a set of boot floppies (NT 4.0).
Equivalent Linux BASH commands:
fdformat - Low-level format a floppy disk.
fdisk - Partition table manipulator for Linux.


Notes
Formatting a floppy disk

Do not format a floppy disk at a size higher than it was designed for. For example, do not format a 360K floppy disk at 1.2MB.

Attempting to format a 720K floppy as 1.4 Mb may give the rather unhelpful error:

"The type of the file system is RAW. Invalid media or Track 0 bad - disk unusable."

Also, if you use the FORMAT command without specifying the size of the floppy disk, the operating system will format the floppy disk at the disk capacity of the disk drive. Thus, if you format a floppy disk without specifying the size, be careful not to use a floppy disk smaller than the capacity of the disk drive.


Typing a volume label

After formatting a floppy disk, FORMAT displays the message:

    Volume label (11 characters, ENTER for none)?

The volume label can be a maximum of 11 characters (including spaces). If you do not want your disk to have a volume label, press ENTER. For information about volume labels, see the LABEL command.


Formatting a hard disk

When you use the FORMAT command to format a hard disk, the operating system displays a message, before attempting to format the hard disk:

    WARNING, ALL DATA ON NON-REMOVABLE DISK
    DRIVE x: WILL BE LOST!
    Proceed with Format (Y/N)?_

To format the hard disk, press Y; if you do not want to format the disk, press N.

Beginning with v4.0, you will be prompted for a volume label before formatting your hard disk.


FORMAT messages

When formatting is complete, the operating system displays messages showing the total disk space, any space marked as defective, the total space used by the operating system (if you used the /S or /B switch), and the space available for your files.


Safe formatting

If you do not specify the /U switch or a switch that reformats the disk to a different size, FORMAT performs a "safe" format. It clears the file allocation table and root directory of the disk but does not delete any data. You can then use the UNFORMAT command to recover the disk if you did not intend to format the disk. FORMAT also checks each sector on the disk to ensure that the sector can properly store data. If it locates a sector that cannot store data, FORMAT marks that sector to prevent the operating system from using it.

If you specify the /U switch or any switch that changes the size of the disk, FORMAT performs an unconditional format by deleting all data on the disk.


Quick formatting

You can speed up the formatting process by using the /Q switch. Use this switch only if you have not received read or write errors on your disk. You can speed up the process even more by using both the /Q and /U switches. If you use the /U switch, FORMAT does not save the information necessary to later unformat the disk.


Formatting a new disk

When you use FORMAT to format a disk that has never been formatted, you can specify the switches /U /C to reduce formatting time.

If you are using DriveSpace and don't often use compressed floppies, you might also want to disable the AutoMount feature to further reduce formatting time. To do this, use the DRVSPACE /AUTOMOUNT command, or turn off the Automount option in the Options dialog (start DriveSpace, and then choose Options from the Tools menu).


Using format with a SUBST drive or a network drive

You should not use the FORMAT command on a drive prepared by using the SUBST command. You cannot format disks over a network or an Interlnk drive.


Examples

To format a new floppy disk in drive A using the default size, type:

    FORMAT A:

To perform a quick format on a previously formatted disk in drive A, type:

    FORMAT A: /Q

To format a floppy disk in drive A, completely deleting all data on the disk, type:

    FORMAT A: /U

To format a 360K floppy disk in drive A and copy the operating system files to the disk to make it a system disk, type:

    FORMAT A: /F:360 /S

To format a floppy disk in drive A and assign to it the volume label "DATA", type:

    FORMAT A: /V:DATA

Errorlevels
Availability
External
DOS
v1.0 v1.05 v1.1 v1.11 v1.24 v1.25 v1.85 v2.0 v2.01 v2.05 v2.10 v2.11 v2.11R v2.12 v2.2 v2.25 v3.0 v3.20 v3.05 v3.1 v3.21 v3.25 v3.30 v3.3A v3.3R v3.3T v3.31 v3.40 v4.0 v4.01 v4.01A v5.0 v5.0A v5.00.02 v5.001A v5.01 v5.02 v6.0 v6.10 v6.2 v6.21 v6.22 v6.23 v7.00 v7.0R1 v7.10 v8.00
Windows
Win95 Win98 WinME
Windows NT
NT3.1 NT3.5 NT3.51 NT4 NT2000 NTXP NT2003

Last Updated: 2006/12/01
Direct corrections or suggestions to: Rick Lively