DOS Days

How to Format a Floppy Disk

All flavours of DOS (MS-DOS, PC-DOS, DR-DOS, etc) have all had the external command FORMAT since version 1.0. Most floppy disks come out of the box 'unformatted'. This is because there are different encoding methods that were used by the various computers available at the time - Apple used a different encoding method to Commodore (GCR), and both were different to what the IBM PC and its compatibles used (MFM). In order to prepare the floppy disk to be readable on a PC, it must be formatted. Formatting puts crucial information (see FAT Explained) onto the disk so that the host operating system can read and understand it.

In DOS, the first floppy drive is [by default] A:, the second is B:, and the first hard disk drive is C: (if present).

The syntax of the FORMAT command is:

FORMAT a:[/1][/4][/8][/F:(size)] [/N:(sectors)] [/T:(tracks)] [/B|/S][/C] [/V:(label)] [/Q][/U][/V]

Here each of these arguments is explained:

Argument Meaning
/l Format for single-sided use, regardless of the drive type.
/4 Formats a double-density diskette in a high-density type disk drive. WARNING: Files written to a 360 KB disk using a 1.2 MB floppy drive have been proven to not be reliable.
/8 Formats at 8 sectors per track. If /8 is not specified, FORMAT defaults to 9 or 15 sectors per track, depending upon the disk drive type. The /V option cannot be used with the /8 option.
/F:(size) Formats the disk to a size other than for what the drive was designed. You can specify the target disk to be a size value from 160Kb to 2.88Mb, e.g. 360, 720, 1.2, 1.44, 2.88, etc. Do not format a floppy disk at a size higher than it was designed for.
/N:(sectors) Specifies the number of sectors per track on the disk. Used to format a 3½" disk with the number of sectors per track specified using this option. For 720 KB disks, this value should be entered as N:9.
/T:(tracks) Specifies the number of tracks on the disk. Used to format a 3½" disk with the number of tracks specified using this option. For both 720 KB disks and 1.44 MB disks, this value should be entered as T:80.
/B Formats a disk reserving room on the disk to later copy the DOS system files.
/S Copies the operating system files to the disk after formatting. These system files are hidden files and will not appear in a directory listing. Using some versions of DOS, this must be the last option entered.
/C Causes FORMAT to re-test bad clusters, otherwise FORMAT will mark the clusters as bad but will not re-test them. (In DOS versions before v6, FORMAT always re-tested any bad clusters.)
/V:(label) Causes FORMAT to prompt for a volume label after the disk is formatted. The label can be of 1 to 11 characters. The same characters acceptable in filenames are acceptable in the volume label (however, you cannot add a filename extension). The /8 option cannot be used with the /V option. DOS v5 automatically assigns Label as the disk label and creates a unique serial number in the boot sector of the disk. The serial number is displayed at the end of the formatting process. If you simply specify /V without a label, you will be prompted for the volume label after the format is completed.
/Q (From DOS 5.0 onwards) - Provides a quick way to format a disk . This option erases the file allocation table (FAT) and the root directory, but does not identify bad sectors.
/U (From DOS 5.0 onwards) - Unconditional format. Completely erases all data on the target disk making it impossible to perform an UNFORMAT later. Without this flag, DOS 5.0's FORMAT command creates a "safe" format by saving additional data on the disk. This takes a bit longer but allows the disk to be unformatted.

Examples

Here are a few common examples of how to format a floppy disk on a PC:

Command What will happen
format a: The disk in floppy drive A: will be formatted (erased). It will not be bootable.
format a: /s The disk in floppy drive A: will be formatted and the operating system files will be copied onto the disk, allowing it to be used as a boot disk.
format a: /4 The floppy disk in drive A: will be formatted to double-density capacity in this high-density drive.
format b: /T:80 /N:9 The disk in drive B: will be formatted to 720 KB (80 tracks, 9 sectors per track)

Exit Codes

Most external DOS commands generate an exit code which can be read by a batch file to then take further steps. For the FORMAT command, here are the valid exit codes:

Exit Code Meaning
0 The format operation was successful.
3 FORMAT was terminated by Ctrl-C before completion.
4 A fatal error occurred (any error other than 0, 3 or 5)
5 The user pressed N in response to a prompt "Proceed with Format (Y/N)?" to stop the process.

 

Argh! I need to create a DOS Boot disk in Windows 10!

It came to light that from Windows 10 build 10240, Microsoft removed the feature to be able to create a boot disk (as well as enabling compression). Apparently, they removed the floppy disk driver as well as the diskcopy.dll file early on in the Windows 10 development cycle, but re-added it as people became aware of it being missing.

So you have two options:

1) Use a third-party disk manager tool to create the boot disk. Bootdisk.com have downloadable utilities to format floppy disks and transfer a version of DOS onto them. I tested this running in Windows 10, and it created a bootable DOS 6.22 floppy disk without issue.

2) Don't use Windows 10 - use an older OS that still has support for boot floppies. Windows versions up to 8.1 support the creation of a DOS boot floppy.

Other DOS Formatting Utilities

There's an excellent DOS utility called NFormat, written by Nathan Lineback. It's free to use and distribute, as long as no changes are made to it or its documentation. NFormat adds a lot of further low-level options when formatting a floppy disk in DOS, such as increasing the number of tracks on a disk, number of heads, sectors per track, the interleave and much more. It will also do a deeper verification process to detect bad sectors than the standard DOS FORMAT utility. It will not copy system files after formatting as different versions of DOS have their own way of placing system files - use SYS.COM from your DOS system disk after using NFormat if you want your newly-formatted floppy disk to be bootable.