Disk formatting
|
Formatting a hard drive using MS-DOS |
Disk formatting is the process of preparing a
hard disk or other
storage medium for use, including setting up an empty
file system. A variety of utilities and programs exist for this task; pictured to the right is the iconic
FORMAT.COM of
MS-DOS and
PC-DOS.
Large disks can be
partitioned, divided into
logical sections that are formatted with their own file systems. This is normally only done on hard disks because of the small sizes of other disk types, as well as compatibility issues.
A corrupted
operating system can be reverted to a clean state by reformatting the disk and reinstalling the OS, as a drastic way of combatting a
software problem or
malware infection. Obviously, all files must be backed up first.
Formatting a disk involves two quite different
processes known as low-level and high-level formatting. The former deals with the formatting of disk surfaces and installing characteristics like sector numbers that are visible to, and used by, the
disk controller hardware, while the latter deals with
file system specific information written by the
operating system.
Low-level formatting of floppy disks
The low-level format of floppy disks (and early hard disks) is performed by the disk drive hardware.
The process is most easily described with a standard
1.44 MB floppy disk in mind. Low-level formatting of the floppy normally writes 18
sectors of 512
bytes each on each of 160
tracks (80 on each side) of the floppy disk, providing 1,474,560 bytes of storage on the floppy.
Sectors are actually physically larger than 512 bytes as they include sector numbers,
CRC bytes, and other information required in order to identify and verify the sector during reading and writing. These additional bytes do not add to the overall storage capacity of the disk.
To complicate matters, different low-level formats can be used on the same
media; for example, large records can be used to cut down on interrecord gap size.
Several
freeware and
shareware programs (e.g.
FDFORMAT, NFORMAT and
2M) allowed considerably more control over formatting, allowing the formatting of high-density 3 1/2" disks with a capacity up to 2 MB.
Techniques used include
* head/track sector skew (moving the sector numbering forward at side change and track stepping to reduce mechanical delay),
* interleaving sectors (to minimize sector gap and thereby allowing the number of sectors per track to be increased),
* increasing the number of sectors per track (while a normal 1.44 MB format uses 18 sectors per track, it's possible to increase this to a maximum of 21), and
* increasing the number of tracks (most drives could tolerate extension to 82 tracks â€" though some could handle more, others jammed).
Linux supports a variety of sector sizes, and
DOS and
Windows support a large-record-size
DMF-formatted floppy format.
Low-level formatting of hard disk drives
User instigated low-level formatting of
hard disks was common in the
1980s. Typically this involved setting up the
MFM pattern on the disk, so that sectors of bytes could be successfully written to it. With the advent of
RLL encoding, low-level formatting grew increasingly uncommon, and most modern hard disks are
embedded systems, which are low-level formatted at the factory and thus not subject to user intervention.
Early hard disks were quite similar to floppies, but the low-level formatting was generally done by the
BIOS, rather than by the operating system. This was a fairly bizarre process that involved using the MS-DOS
debug program to transfer control to a routine hidden at different addresses in different BIOSs.
Starting in the early
1990s, the low-level formatting of hard drives became more complex as technology improved to
*use
RLL encoding,
*store a higher number of sectors on the longer outer tracks (traditionally, all tracks had the same number of sectors, as is still the case with floppy disks),
*encode track numbers into the disk surface to simplify hardware, and
*increase the mechanical speeds of the drive.
Rather than face ever-escalating difficulties with BIOS versioning, disk vendors started doing low-level formatting at the factory. Today, an
end-user, in most cases, should never perform a low-level formatting of an IDE or ATA hard drive; disk reinitialization of an IDE or ATA hard drive is much more common.
[The NOSPIN Group, Inc. (n.d.). Low level formatting an IDE hard drive. Retrieved December 24, 2003.]High-level formatting
High-level formatting is the process of setting up an empty file system on the disk, and installing a
boot sector. This alone takes little time, and is sometimes referred to as a "quick format".
In addition, the entire disk may optionally be scanned for defects, which takes considerably longer, up to several hours on larger harddisks.
In the case of floppy disks, both high- and low-level formatting are customarily done in one pass by the software. In recent years, most floppies have shipped preformatted from the factory as DOS
FAT12 floppies. It is possible to format them again to other formats, if necessary.
Under
MS-DOS and
PC-DOS, disk formatting is performed by the
FORMAT program. FORMATusually ask for confirmation beforehand to prevent accidental removal of data, but some versions of DOS had an uncodumented
/AUTOTEST option; if used, the usual confirmation is skipped and the format begins right away. The WM/FormatC
macro virus uses this command to format the C: drive as soon as a document is opened.
There is also the undocumented
/U parameter that performs an
unconditional format which overwrites the entire partition [
1], preventing the recovery of data through software (but see below).
As with regular deletion, data on a disk is not fully destroyed during a high-level format. Instead, the areas on the disk containing the data is merely marked as available, and retains the old data until it's overwritten by new files.
To prevent the recovery of sensitive data through software, the data must either be overwritten with garbage before the format, the format program must perform this overwriting, or even better, a low-level format must be performed.
The data can still be recovered through physical means (by consulting
data recovery specialists); to prevent this, the drive must be
securely wiped, although even this is not a perfect guarantee. Only physically destroying the hard drive itself along with the magnetic plates will guarantee that the data is truly gone.
*
Data remanence*
File wiping*
Secure Deletion of Data from Magnetic and Solid-State Memory by Peter Gutmann
*
Differences between a Quick format and a regular format during a "clean" installation of Windows XP from Microsoft Help and Support. Useful for anyone setting up their own computer and needing advice on the subject!