Disk formatting

From Free net encyclopedia

(Redirected from Disk format)

Image:Formatting-c-drive.JPG

Disk formatting is the only process of preparing a hard disk or other storage medium for use with the file system (FAT, NTFS, UFS, etc.) of an operating 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 unfeasibly small sizes and compatibility issues of other disk types.

Formatting a drive (or partition) destroys the computer's records of the data it contains, effectively deleting it. It's vital to make back-ups of important data beforehand, although see below. A format can be used to revert a corrupted operating system to a fresh state by reformatting the disk and reinstalling the OS, and as a drastic way of combatting a software problem or a computer virus.

As with regular deletion, data from a format is not destroyed until overwritten and may be recoverable unless securely deleted ("shredded"). Low-level formatting, below, is frequently confused with "zero-writing" in which every bit of data on the disk is systematically overwritten with zeros returning the drive to a "factory-fresh" state.

A formatting of a disk involves two quite different processes known as "low-level formatting" and "high-level formatting." The former deals with formatting of disk surfaces required by the disk controller hardware; the latter with software-specific information written by a specific operating system.

Formatting programs ask for confirmation beforehand to prevent accidental removal of data. In several versions of MS-DOS, there is an undocumented parameter called /autotest which allows the FORMAT program to skip the confirmation message.

There is also the undocumented /u parameter (format drive letter /u) that performs an unconditional format which overwrites the partition with Hex F6 (zeros) [1]. No unformatting utility can recover data from a partition that was formatted by the /u parameter. This is not the most secure way of destroying the previous data, instead use something like DBAN to destroy old data, however no disk wiping software guarantees 100% destruction of stored data. Only physically destroying the hard drive itself along with the magnetic particles will guarantee complete security.

Never use quick format when formatting a NTFS Drive. There is a chance the drive could become corrupted. Maybe not a big chance, but it is there. Better safe than sorry.


Contents

Formatting a floppy disk

Low-level formatting

Warning: The below information on low-level formatting of floppy disks may be technically incorrect.

The process is most easily seen with a standard 1.44MB PC floppy disk. The 1.44MB naming is somewhat misleading, as it's made by calculating the capacity with both powers of two and powers of ten (1.44 * 1024 * 1000 = 1,474,560). Low-level formatting of the floppy normally writes 18 sectors of 512 bytes each on each of 160 tracks (80 on each side) of a floppy disk. That provides 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) Low-level formatting installs characteristics like sector numbers that are visible to, and used by, the hardware and disk controller. To further complicate the concept, 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. Linux supports a variety of sector sizes, and DOS and Windows support a large-record-size DMF-formatted floppy format.

High-level formatting

On the other hand, high-level formatting is unique to a file system. In the case of MS-DOS (FAT12), the writing of an initial "boot" record—which may just contain code to indicate the disk is not bootable—is required, as well as two copies of the file allocation table and an empty root directory.

In the case of floppy disks, both high- and low-level formatting are customarily done in one pass by user software—FORMAT.COM in the case of DOS. In recent years, most floppies have shipped preformatted from the factory as DOS FAT12 floppies. It is possible—if not always easy—to format them again to other formats.

Formatting in DOS

Later versions of the DOS FORMAT command had several options that were often misunderstood.

  • FORMAT /Q: the "quick format", which merely blanked the directory and FAT
  • FORMAT /U: the "unconditional format", which actually rewrote the low level formatting of the disk

If neither were specified, the default was to verify and blank as in quick format, if already formatted, otherwise to perform a format equivalent to the unconditional format. Data on the disk was not erased unless an unconditional format was specified and the UNFORMAT command could often be used to recover data.

Formatting using other programs

Several freeware and shareware programs existed which allowed considerably more control over formatting, including the option to create formats similar to DMF, examples being a program called FDFORMAT, NFORMAT and 2M. A user could format high-density 3 1/2" disks with capacity up to 2 MB. Options included:

  • Change cluster size: While Microsoft defaulted to 2 sectors per cluster on low density media and 1 on high density, this could be altered by most alternative formatters, with no significant compatibility issues.
  • Head/track sector skew: By moving the sector numbering forward at side change and track stepping to allow for mechanical delay, sequential transfer could be optimized.
  • Interleave sectors: Not usually required, unless using a minimum sector gap when increasing the number of sectors per track.
  • Sectors per track: While a normal 1.44MB format uses 18 sectors per track, it was possible to increase this to a maximum of 21
  • Extra tracks: Most drives could tolerate extension to 82 tracks, though while some could handle more, there was a risk of jamming others.

Another popular alternative format, was the application of a 720k format to 5 1/4" low density media in a 1.2MB drive.

Formatting a hard disk drive

Low-level formatting

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
  • use different numbers of sectors per track on longer outer tracks.
  • encode track numbers into the disk surface to simplify hardware and increase the speed of head motion, etc.

Rather than face ever-escalating difficulties with BIOS versioning, disk vendors started doing low-level formatting at the factory. High level formatting is done on a per-partition basis, and it formats the partition to work with a specific file format.

Today, an end-user, in most cases, should never perform a low-level formatting of an IDE or ATA hard drive; disk reinitialization an IDE or ATA hard drive is much more common. The NOSPIN Group

References

  • The NOSPIN Group, Inc. (n.d.). Low level formatting an IDE hard drive. Retrieved December 24, 2003 from [2]

Low level is very easy

External links

es:Formato (disco) fr:Formatage it:Formattazione ja:フォーマット no:Formatering sv:Formatering