LINFO

The fdformat Command



The fdformat command is used to perform the low-level formatting of floppy disks.

Floppy disks usually come from the factory already formatted with a FAT (File Allocation Table) filesystem for use on MS-DOS and the Microsoft Windows operating systems. However, it can be useful to reformat them prior to use with other operating systems so that they will contain a filesystem more compatible with those operating systems (e.g., ext2 or ext3 for Linux).

A low level format, also called a physical format, is the first step in formatting a disk. It consists of dividing the disk's tracks (80 per side for a standard 3.5-inch floppy) into a specified number of sectors and filling the data area of each sector with dummy byte values or with a pattern of test values. This results in the destruction of any existing data on the disk.

High level formatting, also referred to as logical formatting, is the creation of a filesystem, including a table of contents, for the disk. It does not destroy data already on the disk.

The syntax of fdformat is

fdformat [-n] device

device is the location of the floppy disk drive unit. It is usually /dev/fd0 on a system with a single floppy drive and would be /dev/fd1 for the second floppy drive on a system with two such drives.

In most cases all that is necessary to perform a low level format on a floppy disk is to issue the following command, press the ENTER key and wait a few minutes:

fdformat /dev/fd0

The disk must be unmounted, i.e., inserted into the drive but not logically attached to the main filesystem, for this operation to succeed. A floppy in /dev/fd0 that has been mounted can be unmounted by using the umount command, i.e.,

umount /dev/fd0

The default formatting for a 3.5 inch double sided floppy disk is 80 tracks per side, 18 sectors per track and a total capacity of 1.440 megabytes.

The size of the disk in bytes can be specified in the command following the device name, although it is usually not necessary. For example, to the following would specify a 1.44MB disk (which is the default):

fdformat /dev/fd0H1440

Likewise, to specify nine sectors per track and a total disk capacity of 720MB the following would be used:

fdformat /dev/fd0h720

A listing of the standard formats is included in the man built-in manual page for fdformat. The generic floppy devices, /dev/fd0 and /dev/fd1, will fail to work with fdformat when a non-standard format is being used or if the format has not been automatically detected by the system. In such case, the setfdprm command should be used to load the disk parameters.

fdformat has only one option, -n (i.e., no verify), which disables the verification process that is performed by default after the formatting.

Once the low level formatting has been completed, the disk is ready for high level formatting with a command such as mkfs (i.e., make filesystem) or mke2fs. This will make the disk mountable (with the mount command) and ready to use.

Low level and high level formatting are generally performed with the single command FORMAT on MS-DOS and the Microsoft Windows operating systems.






Created June 4, 2005.
Copyright © 2005 The Linux Information Project. All Rights Reserved.