Computer Science › Section B · Data storage › Topic B.3
Mass storage
Main memory is fast but forgets everything when the power goes off. Mass storage keeps your files, apps and photos for years, and the way each technology stores bits explains why some devices feel instant and others make you wait.
Why main memory is not enough
Main memory has two weaknesses: it is volatile, and it is small compared with everything people want to keep. So computers add mass storage, also called secondary storage: hard disks, solid-state drives, flash drives, optical discs and magnetic tape. Compared with main memory, these devices are non-volatile, hold far more data, cost much less per byte, and in many cases can be removed and stored elsewhere as an archive. The price is speed. Data must be copied from mass storage into main memory before the processor can work on it; when memory fills up, the operating system moves data out to storage, which slows everything down. Devices with moving parts are slower still and can fail mechanically.
The storage hierarchy
Designers combine several technologies in a hierarchy. At the top are the processor's registers and caches: tiny, extremely fast and expensive per byte. Next comes main memory. Below that sit solid-state drives, then hard disks, and at the bottom archival media such as tape: huge, slow and cheap. As rough orders of magnitude, a DRAM access takes around 100 nanoseconds, an SSD read tens of microseconds, and a hard-disk access around 10 milliseconds, about 100,000 times longer than DRAM. Each faster level keeps copies of the data from the level below that is most likely to be needed next.
Inside a hard disk drive
A hard disk drive (HDD) stores bits as tiny magnetised regions on spinning platters coated with magnetic material. A read/write head on a moving arm sits just above each surface. As the platter turns, the head passes over a circle called a track; moving the arm reaches a different track. Most drives stack several platters on one spindle and use both surfaces, with all the heads moving together. The set of tracks under the heads at one arm position is a cylinder. Each track is divided into arcs called sectors, the smallest unit the drive reads or writes, traditionally 512 bytes and on most newer drives 4,096 bytes.
Zoned-bit recording
Outer tracks are longer than inner ones. If every track held the same number of sectors, bits near the rim would be spread out and space would be wasted. High-capacity drives therefore use zoned-bit recording: neighbouring tracks are grouped into zones, every track in a zone has the same number of sectors, and outer zones have more sectors per track than inner ones. Because the platter spins at a constant speed, more data passes under the head per turn on the outer zones, so a drive transfers data faster near its rim than near its centre.
Measuring disk performance
Four measures describe a disk. Seek time is the time to move the heads to the right track. Rotational delay, or rotational latency, is the time for the wanted sector to spin round to the head; on average it is half of one full rotation. Access time is seek time plus rotational delay. Transfer rate is how fast data flows once reading begins. Two general terms apply to all storage and networks: bandwidth is the amount of data moved per unit of time, such as megabytes per second, and latency is the delay between a request and the start of its answer. The heads float just above the platter, so a speck of dust can cause a head crash; drives are sealed at the factory.
Worked example: access time
A hard disk spins at 7,200 revolutions per minute (rpm) and has an average seek time of 9 ms. What is its average access time? 1. Revolutions per second: 7,200 ÷ 60 = 120. 2. Time for one full rotation: 1 ÷ 120 s = 8.33 ms. 3. Average rotational delay is half a rotation: 8.33 ÷ 2 ≈ 4.17 ms. 4. Access time = seek time + rotational delay = 9 + 4.17 ≈ 13.2 ms. 5. Compare with main memory: 13.2 ms is 13,200,000 ns, over 100,000 times longer than a DRAM access of about 100 ns. That gap is why operating systems try hard to keep needed data in memory.
Tape and optical discs
Magnetic tape records data along a long plastic strip. Reaching a particular file may mean winding through much of the reel, so latency is very high, but tape is cheap per byte and still used for large archival backups that are written and read in long runs. Optical discs store bits as patterns in a reflective layer read by a laser. A CD, 12 cm across, holds about 700 MB on a single spiral track that runs from the centre outwards. DVDs pack data more tightly, about 4.7 GB per layer, and Blu-ray discs use a shorter-wavelength blue-violet laser to reach about 25 GB per layer. A spiral suits long continuous reads, such as films, better than jumping between scattered items.
Flash memory and SSDs
Flash memory has no moving parts. Each bit, or on modern chips a few bits, is stored as electric charge trapped in an insulated cell, where it stays for years without power. Data can be read in small units, but cells must be erased in large blocks before they are rewritten, and each cell survives only a limited number of erase cycles. A solid-state drive (SSD) is a flash device built to replace a hard disk. It is far faster to access, silent and resistant to shock, which is why laptops and phones use flash. Its controller spreads writes evenly across the cells, a technique called wear levelling. USB flash drives and SD cards use the same technology.
Worked example: the missing gigabytes
A new drive is sold as 2 TB, but the computer reports about 1.82 TB. Is space missing? 1. Drive makers use decimal prefixes: 2 TB = 2 × 10¹² = 2,000,000,000,000 bytes. 2. Some operating systems divide by binary units, \(2^{30}\) bytes for each GiB, but still label the result GB. 3. Divide: \(2 \times 10^{12} \div 2^{30} \approx 1{,}862.6\) GiB. 4. In TiB: \(2 \times 10^{12} \div 2^{40} \approx 1.82\) TiB. 5. Conclusion: no space is missing; the same number of bytes is being counted in different units. (A little real space is also used by the file system, a separate effect.)
Common mistakes to avoid
First, calling rotational delay the time for a full rotation; on average it is half. Second, forgetting to add seek time when finding access time. Third, assuming SSDs are just faster hard disks; flash has no moving parts and wears with repeated erasing. Fourth, thinking optical discs are best for data that changes constantly; their spiral layout and write limits suit long, stable recordings. Fifth, mixing up bandwidth, how much data per second, with latency, how long before the first data arrives.
Key takeaways
Mass storage is non-volatile, large, cheap and often removable, but slower than main memory. Storage forms a hierarchy from registers and caches through RAM and SSDs to hard disks and tape. A hard disk has platters, tracks, cylinders and sectors; zoned-bit recording puts more sectors on outer tracks. Access time is seek time plus rotational delay, which averages half a rotation. Tape has very high latency but suits archives. CDs, DVDs and Blu-ray store data on a spiral track. Flash stores trapped charge, erases in blocks and wears out, so SSDs use wear levelling. Bandwidth measures data per second; latency measures waiting time.
Flashcards
Flashcard
Non-volatile, large-capacity secondary storage
Test your understanding
Question 1 of 5
A hard disk spins at 6,000 rpm and has an average seek time of 7 ms. What is its average access time?
Question 2 of 5
Why does a hard disk using zoned-bit recording transfer data faster on its outer tracks?
Question 3 of 5
Which property of flash memory explains why SSDs use wear levelling?
Question 4 of 5
A company must keep 50 years of records that are rarely read and are always written in long runs. Which medium suits this best, and why?
Question 5 of 5
A drive sold as 500 GB is reported by a computer that uses binary units. About what figure will it show?
