Hard Disks and
Storage

It may be hard to believe, but the first Macs didn't
have a hard disk drive inside. All the software they
needed fit on a single floppy disk! My, how times have
changed. Today it takes dozens of disk drives, CD-ROMs,
and removable disks to store the instructions our
computers need, and all the data files we create. How do
these devices work? That's the subject of this page.
The Basics: In many ways, the technology used
by computer storage devices is quite similar to your VCR
at home: A motorized mechanism moves a storage "media"
past one or more "read/write heads," which interpret that
data and forward it to the screen.
The big difference is that video tape (the "media")
stores data in a "linear" stream from beginning to end.
This means you need to move forward or backward through
ALL of the stored data to reach the specific information
you want. That was fine years ago, but modern computers
require more speed. So, almost all modern storage devices
have replaced fixed-position heads and linear media with
spinning disk "media" and "floating" (moving) heads which
provide faster "Random Access" to data stored anywhere on
the disk surface

Magnetic Media Devices: Hard disk drives,
floppy disks and most removable disks (ZIP, JAZ, Syquest)
are magnetic media devices, in which the spinning disk
"media" is coated with tiny magnetic particles (metal
oxides). As each section of the disk spins past the
heads, the heads read the positive or negative charge of
each magnetic particle to determine if it represents a
"One" or "Zero" digital data bit.
The overall advantages of magnetic storage devices are
low cost and fast speeds. But, one major disadvantage is
that magnetic media doesn't last forever. Outside
influences can damage the magnetic signals, or the
signals can just "wear out" (lose their charge) over
time.
The simplest of all magnetic media devices is the
Floppy Disk. Inside that rigid 3.5" square of protective
plastic is a flexible disk coated with magnetic
particles. (You can see the disk if you slide the
floppy's metal shutter to one side.) When you load the
diskette into your computer, the drive mechanism pushes
the shutter aside, spins the disk at a constant speed
(about 300 rpm), and positions the read/write heads just
above the surface of the disk to read the charge of each
magnetic particle.
Original floppy disks could store only 400 Kilobytes
(K) of data on one side of the flexible disk. Eventually,
these were replaced by "double-sided" drives that used
TWO read/write heads, one above and one below the
spinning disk, and stored a total of 800 K of data. (400
K on each side.) Today's disks are "Double-Sided,
High-Density," which means they store even more data on
each side, for a total of 1.4 MB per disk.
The only real difference between a floppy disk and all
other types of magnetic media are the spinning disks
themselves. That's the "hard" part of a hard disk drive.
Instead of a flexible disk, hard disk drives and
removables use solid metal disks (usually aluminum) that
spin much faster and are coated with even smaller
magnetic particles, so they can store more data. In
addition, modern hard drives may contain a stack of
individual disks inside, to increase the total storage
capacity even more.

Optical Media Devices: Although CD-ROM and
Magneto Optical (MO) drives both use a spinning disk and
floating read/write heads, these two "optical media"
devices don't use magnetic media. However, since MO
drives are becoming rare, due to the growing popularity
of recordable CDs, we'll only look at how a CD-ROM drive
works.
CDs (Compact Disks) consist of a thin aluminum disk
covered with a plastic coating. Each single-sided disk
(the label is on the other side) can hold about 640 MB of
data. During the process of creating a CD, a laser beam
melts tiny holes or "divots" into the aluminum disk
(That's why it's called "burning a CD.") When you insert
the CD into the drive in your machine, the drive's laser
beam can "see" these holes and knows that each represents
a "One" data bit. If there is no hole, the drive knows
that represents a "Zero" bit. (NOTE: You can't see the
holes with your naked eye. They are only a few microns -
millionths of a meter - deep.)
The major advantage of CDs (and also MO drives) is
security. Once you write a CD, your data should be safe
for 10,000 years or more. They "never" wear out. The
drawback is that CDs transfer data slower than magnetic
media drives.
Of course, CD-ROM speeds are getting faster every day.
That's why you'll always see a CD-ROM drive labeled as
4x, 8x, 24x and so on. This doesn't represent the speed
of disk rotation. It measures the amount of data the
drive can transfer compared to the very first CD-ROM
drives (1x speed - the same as audio CDs in your home
stereo). Today's fastest drives are 32x, meaning they can
transfer data 32 times faster than the original audio
CDs. But, that's still slower than the data transfer
speed of a hard disk drive!

How Disks Store Data: Except for the "optical"
differences noted above, all random access storage
devices work the same way. For the sake of understanding,
let's look at the typical hard disk drive.
A hard disk drive consists of five major components:
The recording media (disks), the read/write heads and
armature mechanism, the motor, the controller, and the
protective case.
Inside the sealed protective hard drive case are a
stack of disks mounted on a central spindle (like a
phonograph with a stack of albums). Each disk is coated
on both sides with magnetic particles, and there is a
small space between the individual disks to allow the
heads to fit in between them. Depending on the device,
the motor mechanism turns the spindle at a consistent
speed, ranging from 3600 to 7200 rpm. Faster speeds allow
faster data access. (NOTE: Removable storage devices
have only ONE metal disk inside a plastic casing called a
"cartridge." When the cartridge is inserted into the
drive, a spindle is pushed up through a hole in the case
to turn the disk, and a metal shutter is pushed aside so
the heads can access the disk surfaces. Rotation speeds
for removable disks are 1200 - 2400 rpms.)
The read/write heads are attached to an "armature"
assembly that moves all the heads in towards the center
of the disk(s) and back out to the edges again in a
straight line. The combination of "in and out" head
movement and constant disk rotation provides quick access
to any position on the surface of the disk. (NOTE:
There is one head assembly for each data surface (top and
bottom) on each disk (one or a stack). All heads are
moved together as a single unit by the armature
assembly.)
The heads "read" the magnetic charge of the particles
as they pass by on the spinning disk(s), and send this
information to the drive's "controller" (a printed
circuit board mounted inside the drive). The controller
analyzes the magnetic fluctuations, interprets these as a
string of digital "Ones" and "Zeros," and forwards the
data to the CPU. When data is received back from the CPU,
the controller tells the heads to assign a new charge to
each magnetic particle passing by on the spinning disk,
and the data is "written" to the disk.
Important things to remember about magnetic storage
devices:
- The read/write heads never touch the disks.
Instead, the rotation of the disk creates a cushion of
air that keeps the heads floating just a few microns
above the disk surface. That's why a sudden power loss
can cause severe damage. If the armature doesn't pull
the heads completely away from the disk surfaces (as
it does during shutdown) a power loss can cause the
heads to drop onto the disk surfaces - where they
gouge their way through the magnetic particle
coating.
- Disk drives hate dust. When you consider that the
heads are only a few microns from the disk surfaces,
even a dust speck we can barely see is an obstacle as
big as a mountain for the drive. That's why all hard
disk drive mechanisms are sealed inside a protective,
dust-free case. You should NEVER open this case.
Removables and CD-ROM's are slightly more tolerant of
dust, but you should still make every effort to keep
dust away from the disk cartridges and drive
mechanisms.
- Drives are the only "mechanical" devices inside
your computer, and the moving parts can suffer from
mechanical failures. For example, rough handling can
damage the loading mechanisms or misalign the
read/write heads. Motors can also fail from old age,
and dust buildup can cause spindle or armature
mechanisms to stick or "freeze" in place.

How Data is Organized On the Disk
Before you can use a storage device, you have to
"format" it to access and record information in a way
your computer will understand. The process of formatting
first erases the entire drive by resetting ALL magnetic
particles to the "Zero" value, then defines small areas
on the surface(s) of each disk as "sectors," and further
breaks each sector into "blocks" of data storage space.
These steps together are referred to as "physical
formatting."
When the physical formatting is completed, the
"logical formatting" (initializing) of each volume
begins. The Initialization process performs the following
actions, in the order listed below. (NOTE: When you
run a disk-repair utility, you will see it check each of
these areas of the disk.)
- Creates "Boot Blocks" containing the data which
defines the space as a Macintosh volume, and stores
the device's "driver" software.
- Creates the "Volume Information Block" which keeps
track of the volume name and the total number of files
stored on the disk.
- Creates the "Volume Bitmap," which keeps track of
which blocks are used or unused on the disk.
- Creates the "Extents Directory" which remembers
which blocks on the disk are "contiguous" (next to
each other), so your computer knows where to find a
large enough storage space for each file.
- Creates the "Catalog Tree" which stores the
physical location of each file on the disk
- Defines the remainder of the disk space as
potential storage space for files and folders, and
creates the Desktop Directory and Desktop Database.
(NOTE: These information files are loaded into RAM
when the volume is "mounted" to tell the CPU where to
find files and empty spaces on the disk.)

About HFS+: Beginning with MacOS 8, Apple
introduced a new type of formatting called HFS+, which
changes how a disk's data blocks are "addressed." Apple's
original HFS (Hierarchal File System) defined each block
address using only 16 bits of data. This allowed for no
more than 65,000 different addresses on any one
volume.
As hard disk capacity grew, this limitation required
the individual blocks to be larger, too. (The total
volume size must be divided into no more than 65,000
equal-sized blocks.) Instead of the optimum block size of
512 bytes, larger drives had to set the block size at
1024 Bytes (1K) or more. Since the computer only cares if
a block is "Used" or "Unused," any space inside a block
that is not completely filled with data is wasted. For
example: If a file measures 3.1 K in size, it is big
enough to fill three and one tenth blocks. The remaining
space in the fourth block is wasted.
To use space on large drives more efficiently, Apple
introduced HFS+ addressing which defines each block
address using 32 bits (4 Bytes) of information. This can
potentially define billions of block addresses, so each
block can be smaller and wasted space is dramatically
reduced. The Windows 98 operating system has introduced
the same change for PC drives using a new addressing
scheme called "Fat32."
About Partitions: "Partitioning" breaks the
total space available on a device into two or more
independent "volumes" (partitions), each with their own
boot blocks, directories and data file addresses. The
Finder mounts each partition independently, so you "see"
two drives on your desktop, even though they both exist
on one "device."
Before the introduction of HFS+, power users often
partitioned larger drives into smaller, independent
volumes. This allowed each volume to use space more
efficiently within the 65,000 address limit.
Even after the introduction of HFS+, however, many
users continue to partition their larger drives for
organizational purposes, and to reduce wear and tear on
the drive mechanisms. (The head armature moves less often
on a partitioned drive.) In addition, removable drives
can't use HFS+ formatting, and older software titles had
problems understanding data stored on HFS+ volumes. As a
result, partitioning drives using standard HFS addressing
is still widely used on many Mac systems.