Hard Disk
Formatting and Capacity
Most PC
users are familiar with the concept that a hard disk--in fact, all storage
media--must be formatted before it can be used. There is usually some
confusion, however, regarding exactly what formatting means and what it
does. This is exacerbated by the fact that modern hard disks are not
formatted in the same way that older ones were, and also the fact that the
utilities used for formatting behave differently when acting on hard disks
than when used for floppy disks.www.tartoos.com
This section takes a look at issues
surrounding disk formatting and capacity, discusses unformatted and
formatted hard disk capacity, and looks briefly at formatting utilities.
Two Formatting Steps
Many PC users don't realize that formatting a hard disk isn't done in a
single step. In fact, three steps are involved:
-
Low-Level Formatting:
This is the "true" formatting process for the disk. It creates the
physical structures (tracks, sectors, control information) on the hard
disk. Normally, this step begins with the hard disk platters "clean",
containing no information.
-
Partitioning: This process divides the disk into logical "pieces" that become
different hard disk volumes (drive letters).
-
High-Level Formatting:
This final step is also an operating-system-level command. It defines the
logical structures on the partition and places at the start of the disk
any necessary operating system files.
www.tartoos.com
-
As you can see, two of the three steps are
"formatting", and this dual use of the word is a big part of what leads to
a lot of confusion when the term "formatting" is used. Another strange
artifact of history is that the DOS "FORMAT" command behaves differently
when it is used on a hard disk than when it is used on a floppy disk.
Floppy disks have simple, standard geometry and cannot be partitioned, so
the FORMAT command is programmed to automatically both low-level and
high-level format a floppy disk, if necessary. For hard disks, however,
FORMAT will only do a high-level format. Low-level formatting is performed
by the controller for older drives, and at the factory for newer drives.
Low-Level
Formatting
Low-level formatting
is the process of outlining the positions of the tracks and sectors on the
hard disk, and writing the control structures that define where the tracks
and sectors are. This is often called a "true" formatting operation, because
it really creates the physical format that defines where the data is stored
on the disk. The first time that a low-level format ("LLF") is performed on
a hard disk, the disk's platters start out empty. That's the last time the
platters will be empty for the life of the drive. If an LLF is done on a
disk with data on it already, the data is permanently erased (save heroic
data recovery measures which are sometimes possible).
www.tartoos.com
If you've explored other areas of this
material describing hard disks, you have learned that modern hard disks are
much more precisely designed and built, and much more complicated than older
disks. Older disks had the same number of sectors per track, and did not use
dedicated controllers. It was necessary for the external controller to do
the low-level format, and quite easy to describe the geometry of the drive
to the controller so it could do the LLF. Newer disks use many complex
internal structures, including zoned bit recording to put more sectors on
the outer tracks than the inner ones, and embedded servo data to control the
head actuator. They also transparently map out bad sectors. Due to this
complexity, all modern hard disks are low-level formatted at the factory for
the life of the drive. There's no way for the PC to do an LLF on a modern
IDE/ATA or SCSI hard disk, and there's no reason to try to do so.
www.tartoos.com
Older drives needed to be
re-low-level-formatted occasionally because of the thermal expansion
problems associated with using stepper motor actuators. Over time, the
tracks on the platters would move relative to where the heads expected them
to be, and errors would result. These could be corrected by doing a
low-level format, rewriting the tracks in the new positions that the stepper
motor moved the heads to. This is totally unnecessary with modern
voice-coil-actuated hard disks.
Warning:
You should never attempt to do a low-level format on an IDE/ATA or SCSI
hard disk. Do not try to use BIOS-based low-level formatting tools on
these newer drives. It's unlikely that you will damage anything if you try
to do this (since the drive controller is programmed to ignore any such
LLF attempts), but at best you will be wasting your time. A modern disk
can usually be restored to "like-new" condition by using a zero-fill
utility.
High-Level Formatting
After low-level formatting is complete,
we have a disk with tracks and sectors--but nothing written on them.
High-level formatting is the process of writing the file system
structures on the disk that let the disk be used for storing programs and
data. If you are using DOS, for example, the DOS FORMAT command performs
this work, writing such structures as the master boot record and file
allocation tables to the disk. High-level formatting is done after the hard
disk has been partitioned, even if only one partition is to be used. See
here for a full description of DOS structures, also used for Windows 3.x and
Windows 9x systems.
The distinction between high-level
formatting and low-level formatting is important. It is not necessary to
low-level format a disk to erase it: a high-level format will suffice for
most purposes; by wiping out the control structures and writing new ones,
the old information is lost and the disk appears as new. (Much of the old
data is still on the disk, but the access paths to it have been wiped out.)
Under some circumstances a high-level format won't fix problems with the
hard disk and a zero-fill utility may be necessary.www.tartoos.com
Different operating
systems use different high-level format programs, because they use different
file systems. However, the low-level format, which is the real place where
tracks and sectors are recorded, is the same.
Defect
Mapping and Spare Sectoring
Despite the precision manufacturing
processes used to create hard disks, it is virtually impossible to create a
disk with tens of millions of sectors and not have some errors show up.
Imperfections in the media coating on the platter or other problems can make
a sector inoperable. A problem with a sector, if uncorrected, would normally
manifest as an error when attempting to read or write the sector, but can
appear in other ways as well. Most of us have experienced these errors on
occasion when using floppy disk drives.
Modern disks use ECC to help identify
when errors occur and in some cases correct them, however, there will still
be physical flaws that ECC cannot overcome, and that therefore prevent parts
of a disk from being used. Usually these are individual sectors that don't
work, and they are appropriately enough called bad sectors. Tracks
where there are bad sectors are sometimes called
bad tracks.
If you've ever used a disk information
utility on a floppy disk (or on a very old hard disk), you've likely at some
point seen a report showing a few kilobytes worth of bad sectors. However,
if you run such a utility on a modern hard disk, you will normally never see
any reports of bad sectors on the disk. Why is this?
Sectors that are bad cannot be used to
store data, for obvious reasons: they are bad because they cannot be trusted
to reliably write and/or reproduce the data at a later time. It is therefore
necessary for some part of the system to keep track of where they
are, and not use them. The best way for this to be done is for the drive to
detect and avoid them. If the drive does not do this, the operating system
must do it. If any bad sectors are not detected until after they have been
used, data loss will probably result.www.tartoos.com
To allow for maximum reliability then,
each disk drive is thoroughly tested for any areas that might have errors at
the time it is manufactured. All the sectors that have problems or are
thought to be unreliable, are recorded in a special table. This is called
defect mapping. Some drives go even further than this, mapping out not
only the sectors that are questionable, but the ones surrounding them as
well. Some drives will map out entire tracks as a safety precaution.
On older hard disks, these problem areas
were actually recorded right on the top cover of the disk, usually in
hand-writing by the technician testing the drive! This process was necessary
because low-level formatting was done by the company assembling the PC--or
even the end-user--and this information was used to tell the controller
which areas of the disk to avoid when formatting the disk. Part of the
low-level format process was to have the person doing the LLF tell the
controller which sectors were bad, so it would avoid them, and also tell any
high-level format program not to try to use that part of the disk. These
markings are what cause "bad sectors" reports to show up when examining
older hard disks: these are the areas the disk has been told not to use.
Since floppy disks are low-level formatted and high-level formatted at the
same time, the same situation applies, even today. If any sectors cannot be
reliably formatted, they are marked as "bad" and the operating system will
stay away from them.www
.tartoos.com
While early PC users accepted that a few
bad sectors on a drive was normal, there was something distasteful about
plopping down $1,000 for a new hard disk and having it report "bad sectors"
as soon as you turned it on. There is no way to produce 100% perfect hard
disks without them costing a small fortune, so hard disk manufacturers
devised an interesting compromise.
On modern hard disks, a small number of
sectors are reserved as substitutes for any bad sectors discovered
in the main data storage area. During testing, any bad sectors that are
found on the disk are programmed into the controller. When the controller
receives a read or write for one of these sectors, it uses its designated
substitute instead, taken from the pool of extra reserves. This is called
spare sectoring. In fact, some drives have entire spare tracks
available, if they are needed. This is all done completely transparently to
the user, and the net effect is that all of the drives of a given model have
the exact same capacity and there are no visible errors. This means that the
operating system never sees the bad areas, and therefore never reports "bad
sectors". They are still there though, just cleverly hidden.
Really, when you think about it, the hard
disk companies are sacrificing a small amount of storage for "good looks".
It would be more efficient to use all of the sectors on the disk and just
map out the few bad ones. However, sometimes marketing wins out over
engineering, and it seems that more people want the warm feeling of thinking
they have a perfect drive, even if it costs them theoretical storage in the
process. Today's drives are so enormous that few people would even care much
anyway about a few extra megabytes, but that wasn't always the case!
Due to spare sectoring, a brand new disk
should not have any bad sectors. It is possible, however, for a modern
IDE/ATA or SCSI hard disk to develop new bad sectors over time. These will
normally be detected either during a routine scan of the hard disk for
errors (the easy way) or when a read error is encountered trying access a
program or data file (the hard way). When this happens, it is possible to
tell the system to avoid using that bad area of the disk. Again, this can be
done two ways. At the high level, the operating system can be told to mark
the area as bad and avoid it (creating "bad sector" reports at the operating
system level.). Alternately, the disk itself can be told at a low level to
remap the bad area and use one of its spares instead. This is
normally done by using a zero-fill or diagnostic utility, which will scan
the entire disk surface for errors and tell the controller to map out any
problem areas.www.tartoos.com
Warning:
Bad sectors on a modern hard disk are almost always an indication of a
greater problem with the disk. A new hard disk should
never have
bad sectors on it; if you buy one that does have bad sectors, immediately
return it to the vendor for exchange (and don't let them tell you "it's
normal", because it isn't.) For existing hard disks, the vast majority of
time, a single bad sector that appears will soon be accompanied by friends.
While you can map out and ignore bad sectors, you should make sure to
contact the vendor if you see bad sectors appearing during scans, and make
sure the data is backed up as well. Personally, I will not use any hard disk
that is developing bad sectors. The risk of data loss is too high, and hard
drives today are inexpensive compared to the cost of even an hour or two of
recovering lost data (which takes a lot more than an hour or two!).www.tartoos.com
On some disks, remapped sectors cause a
performance penalty. The drive first seeks and reads the sector header of
the data, thinking it will be there; then, it sees that the sector has
been remapped, and has to do another seek for the new sector. Newer drives
using the No-ID sector format eliminate this problem by storing a format
map, including sector remaps, in the memory of the drive's controller.
|