Mass Storage & Disk Scheduling

disk formatting

Imagine buying a giant empty warehouse. Before anyone can store goods, you must first paint grid lines on the floor to mark out numbered bays (so you can find things), then set up a front-desk ledger that records what is stored where and which bays are empty. A raw disk is that empty warehouse, and formatting is both of those preparation steps: dividing the surface into addressable units, then laying down the bookkeeping that turns raw storage into a usable file system.

Concretely, there are two distinct stages people both call formatting. Low-level (physical) formatting divides the medium into sectors the controller can read and write, writing the sector headers, data areas, and error-correcting codes — on modern drives this is done at the factory and you rarely touch it. High-level (logical) formatting is what you usually mean: it writes an empty file system onto a partition — the initial data structures the file system needs, such as the free-space map, the root directory, and the superblock that describes the layout. Often the disk is first divided into partitions (separate regions that can each hold their own file system), and each partition is then high-level formatted.

Why it matters: formatting is the bridge from a meaningless expanse of blocks to an organised place the OS can actually store and find files. A common and dangerous misconception is that a quick format 'erases' your data — usually it does not wipe the bytes, it just rewrites the bookkeeping so the old files are no longer indexed and their space is marked free; the actual data often lingers physically until overwritten (which is why deleted files can sometimes be recovered, and why secure erasure is a separate, deliberate operation). On an SSD, the picture differs again because the flash translation layer and TRIM, not the file system, ultimately decide when old data is physically gone.

You insert a brand-new disk. You first partition it into two regions, then high-level format each: the OS writes a fresh superblock, an empty root directory, and a free-space bitmap marking every data block available. Only now can you create files — the disk has gone from raw blocks to a real file system.

Formatting writes the empty bookkeeping that makes storage usable.

A quick format usually does not erase data; it just resets the bookkeeping, so the old bytes may be recoverable until overwritten. If you need data truly gone, that requires a separate secure-erase, not an ordinary format.

Also called
formattinglow-level formathigh-level format格式化