What storage is for
Memory forgets at power-off. Storage keeps your files.
Memory is emptied when the power goes off. Storage keeps files, programs and the operating system.
In the last lesson, memory was the desk: fast, and cleared when the power goes off. So where is your report the next morning? While the power is on, the open report is in memory, and a copy of it is on storage. Switch off, and memory is empty. Storage still holds everything. This lesson is about that part.
Hard disks and SSDs
One has to move to the data; the other does not
A hard disk is cheap, large and mechanical. An SSD is fast, silent and wears with writes.
The two kinds of drive work in completely different ways. A hard disk stores data on a spinning platter, and a head must travel to the right place, about ten milliseconds each time. It is cheap and large, and slow and fragile. A solid-state drive is a grid of flash memory cells. Nothing moves, so any cell is reached in a tenth of a millisecond.
How a drive connects
SATA uses a cable. NVMe plugs straight into the board.
SATA is the older, cabled connection. NVMe plugs into the board and is many times faster.
A drive has to be joined to the motherboard, and there are two ways you will meet. SATA is the older one. A cable runs from the drive to the board, and it carries about five hundred and fifty megabytes a second. Hard disks and older SSDs use it. NVMe is the newer one. The drive is a small stick that plugs straight into the board, with no cable, and it reads about seven thousand megabytes a second.
How a drive connects · Going deeper · 1 of 3
Drive speed: the connection sets the ceiling
A hard disk reads about 160 MB a second, a SATA SSD 550, an NVMe SSD thousands.
How fast a drive reads depends first on how it is connected. A hard disk manages about a hundred and sixty megabytes a second. A SATA SSD reaches five hundred and fifty, close to the limit of the SATA cable. An NVMe SSD on PCIe generation three reads three and a half thousand. Generation four doubles that. And generation five doubles it again. Fifty gigabytes takes five minutes on the hard disk and four seconds on the last.
How a drive connects · Going deeper · 2 of 3
Shapes and connectors: whether it fits, and whether it works
M.2 is a shape. The drive on it is either SATA or NVMe, shown by its key.
How a drive connects · Going deeper · 3 of 3
Discs, cards and flash drives
Removable storage carries data. It should not hold the only copy.
File systems
A new drive is blank. Formatting gives it an index.
A file system is the index of which blocks hold which file. Formatting writes a new, empty one.
How does a drive know where your report is? By itself, it does not. A new drive is only numbered blocks, all alike. Formatting it writes a file system. Now there is an index. It says the report is in blocks four, five and six, and the photo in blocks nine to twelve. That index is what gives you names, folders and dates.
File systems · Going deeper · 1 of 2
Choosing a file system: format for every machine that must read it
NTFS for Windows, ext4 for Linux, APFS for Mac, exFAT to share between them.
File systems · Going deeper · 2 of 2
MBR and GPT
GPT is the current partition scheme. MBR stops at about 2 TB and four partitions.
When a drive fails
Two disks holding the same data survive one failure
A mirror keeps the same data on two disks, so either can fail. It is not a backup.
Every drive fails eventually. What then? With one disk, everything on it is gone. With two disks that hold exactly the same data, one can die and the computer carries on from the other. That is a mirror. It guards against a dead disk, and nothing else.
When a drive fails · Going deeper · 1 of 2
RAID: disks spent to survive a disk failing
RAID 1 mirrors, RAID 5 survives one failure, RAID 6 two, RAID 0 none.
RAID joins several disks into one, and each level makes a different trade. RAID zero stripes data across two disks. It is fast, and if either disk fails everything is lost. RAID one mirrors: two identical copies, half the space. RAID five needs three disks and gives one disk's worth to parity, so it survives one failure. RAID six gives two disks to parity and survives two. RAID ten mirrors pairs and then stripes them: fast and safe, at half the space.
When a drive fails · Going deeper · 2 of 2
Spares, rebuilds, and why RAID is not a backup
RAID covers a dead disk. Only a backup covers lost data.
Drive health
A drive counts its own faults
Read the SMART counts. Rising reallocated or pending sectors mean the drive is failing.
A drive rarely dies without warning, if you know where to look. Reallocated sectors: places already replaced with spares. It should be zero. Power-on hours: this drive has run for three and a half years. Pending sectors: places it could not read. That is failure in progress. Temperature: normal. And notice the verdict at the top still says passed. Read the counts, not the verdict.
What comes next
Next: how everything outside the case plugs in
The parts inside the case are done. Next: ports, cables and displays.
Lesson complete
You finished “Storage”
Nicely done.