What storage is for

Memory forgets at power-off. Storage keeps your files.

POWER ONMemorythe report, openthe browser, openStoragereport.docxphotosthe operating systemPOWER OFFMemoryemptyStoragereport.docxphotosthe operating systemMemory forgets everything the moment the power goes off. Storage is the part that remembers.Your files, your programs and the operating system itself all live on storage between one session and the next.This lesson covers the kinds of drive, how they connect, how files are laid out on them, and how they fail.

Memory is emptied when the power goes off. Storage keeps files, programs and the operating system.

Hard disks and SSDs

One has to move to the data; the other does not

Hard disk (HDD)a platter turning 7,200 times a minutea head that must travel to the data:about 10 ms each time✓cheap per terabyte; 20 TB and more✗slow, and damaged by knocksSolid-state drive (SSD)cells of flash memory;nothing movesany cell reached inabout 0.1 ms✓fast, silent, survives being dropped✗dearer per terabyte; cells wear with writingA hard disk has to move to the data. An SSD does not.That movement is why hard disks are slow at many small files and why they fail mechanically. Hard disks comeat 5,400, 7,200, 10,000 and 15,000 rpm. Use SSDs to run systems and programs, and hard disks where a greatdeal of space matters more than speed: archives, backups and surveillance.

A hard disk is cheap, large and mechanical. An SSD is fast, silent and wears with writes.

How a drive connects

SATA uses a cable. NVMe plugs straight into the board.

ConnectionHow the drive joins the boardMegabytes read each second, typical, to scaleSATAthe older waydriveboardcableabout 550NVMethe newer wayboarddriveplugs straight in: no cableabout 7,000SATA is the older connection, by cable. NVMe is the newer one: the drive plugs into the board and is far faster.Hard disks and older SSDs use SATA. Almost every new computer starts from an NVMe SSD.A board can have both, so an old SATA drive can still be added to a new machine for extra space.

SATA is the older, cabled connection. NVMe plugs into the board and is many times faster.

How a drive connects · Going deeper · 1 of 3

Drive speed: the connection sets the ceiling

DriveConnected byMegabytes read each second, to scaleReads 50 GB inHard disk, 7,200 rpmSATA cable1605 min 13 sSATA SSDSATA: limit 6005501 min 31 sNVMe SSD, PCIe 3.0M.2, four lanes3,50014 sNVMe SSD, PCIe 4.0M.2, four lanes7,0007 sNVMe SSD, PCIe 5.0M.2, four lanes14,0004 sThe connection sets the ceiling. SATA stops at 600; NVMe uses PCIe lanes and does not.A SATA SSD is as fast as its cable allows, which is why moving from a hard disk to any SSD is the largestsingle improvement an old computer can have. NVMe drives talk to the processor directly over PCIe, andeach generation of PCIe doubles the limit.

A hard disk reads about 160 MB a second, a SATA SSD 550, an NVMe SSD thousands.

How a drive connects · Going deeper · 2 of 3

Shapes and connectors: whether it fits, and whether it works

3.5 inch101.6 × 1472.5 inch69.85 × 100M.2 228022 × 80M.2 223022 × 30M.2 is a shape, not a speedM keyNVMe: four PCIe lanesB keySATA, or two PCIe lanesB and M keySATA: fits either slotmSATAthe older small card; SATA onlyThe notch in the edge connector is the key.2280 means 22 mm wide, 80 mm long.An M.2 drive may be SATA or NVMe. The slot must support the kind you buy.The size tells you whether a drive fits the bay; the interface tells you whether it works and how fast. A 2.5 inchSSD drops into a laptop that had a hard disk. An M.2 slot wired only for SATA will not run an NVMe drive.

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

Capacity in gigabytes, to scaleCD0.7 GBDVD4.7 GBBlu-ray25 GBmicroSD card (typical)128 GBUSB flash drive (typical)256 GBRemovable storage is for carrying data, not for keeping the only copy.Optical discs survive in installers, archives and media. Flash drives and memory cards are cheap and easilylost: encrypt them if the data matters. Format them exFAT to move large files between different systems.

Removable storage carries data. It should not hold the only copy.

File systems

A new drive is blank. Formatting gives it an index.

A new drive12345678910111213141516Numbered blocks, all alike.Nothing says what is where.formatA formatted drive12345678910111213141516INDEXreport.docx4, 5, 6photo.jpg9 to 12The index says which blocks hold which file,and gives you names, folders, sizes and dates.A real drive has millions of blocks. Sixteen are drawn.A file system is the index that says which blocks hold which file. Formatting writes a new, empty index.Without one, a drive is only numbered blocks. The operating system reads the index every time you open a folder.A quick format replaces the index and leaves the old blocks as they were, which is why formatted data can sometimes be recovered.

A file system is the index of which blocks hold which file. Formatting writes a new, empty one.

File systems · Going deeper · 1 of 2

Choosing a file system: format for every machine that must read it

File systemWhere you meet itWhat to rememberNTFSWindows system drivespermissions, encryption, compressionReFSWindows Server data volumesdetects and repairs corruptionFAT32old cards and sticks; the UEFI boot partitionno file larger than 4 GBexFATflash drives shared between systemslarge files; read by Windows, macOS, Linuxext4Linuxthe default on most distributionsXFSLinux serversvery large volumes and filesAPFSmacOS and iOSsnapshots and encryption built inFormat a drive for every machine that must read it.A file system is the index that says where each file lies on the drive. FAT32 counts file sizes in 32 bits, so afile stops at 4,294,967,296 bytes: 4 GB. For a stick that moves between Windows and a Mac, use exFAT.Windows cannot read ext4 or APFS without extra software.

NTFS for Windows, ext4 for Linux, APFS for Mac, exFAT to share between them.

File systems · Going deeper · 2 of 2

MBR and GPT

MBRGPTLargest disk2.2 TB (2³² sectors of 512 bytes)far beyond any disk madePartitions4 primary128 on WindowsStarts withlegacy BIOSUEFICopies of the tableone, at the starttwo: start and end of the diskUse it forold machines onlyeverything currentThe partition table divides a disk; the file system organises each partition.GPT is required to start Windows 11 and to use a disk larger than about 2 TB in full. A new disk that showsonly 2 TB of its space was initialised as MBR.

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

ONE DISKthe disk fails✗everything on it is goneTWO DISKS HOLDING THE SAME DATAone failsthe other has it all=✓the computer carries onEvery drive fails in the end. Two disks that hold the same data survive the loss of either one.This is called a mirror, or RAID 1. It costs a whole extra disk and gives no extra space.It protects against a dead disk only. A deleted file is deleted on both disks, so a mirror is not a backup.

A mirror keeps the same data on two disks, so either can fail. It is not a backup.

When a drive fails · Going deeper · 1 of 2

RAID: disks spent to survive a disk failing

LevelFewest disksHowUsable space from 4 TB disksSurvives the loss ofRAID 0striped: speed, no safety8 of 8 TB0 disksRAID 1mirrored: two identical copies4 of 8 TB1 diskRAID 5striped, one disk of parity8 of 12 TB1 diskRAID 6striped, two disks of parity8 of 16 TB2 disksRAID 10mirrored pairs, then striped8 of 16 TB1 in each pairpurple disks hold copies or parity, not extra spaceRAID spends disks to survive a disk failing. RAID 0 spends none and survives nothing.Parity is arithmetic that lets the array rebuild any one missing disk from the rest. RAID keeps a server runningthrough a hardware failure. It does not protect against deletion, ransomware or fire, so it is never a backup.

RAID 1 mirrors, RAID 5 survives one failure, RAID 6 two, RAID 0 none.

When a drive fails · Going deeper · 2 of 2

Spares, rebuilds, and why RAID is not a backup

Hot sparean idle disk the array rebuilds onto automatically when one failsRebuildrecreating the lost disk; slow, and the array is at risk until it endsHardware RAIDa controller card does the work; the operating system sees one diskSoftware RAIDthe operating system does it: Storage Spaces on Windows, mdadm on LinuxDegradedstill running with a disk missing: replace it nowRAID answers "a disk died". A backup answers "the data is gone".A deleted file is deleted on every disk of the array at the same instant. Keep backups as well, on otherequipment and in another place: lesson 9 covers the 3-2-1 rule.

RAID covers a dead disk. Only a backup covers lost data.

Drive health

A drive counts its own faults

SMART overall-health: PASSED ID Attribute Raw 5 Reallocated_Sector_Ct 184sectors already replaced with spares: should be 0 9 Power_On_Hours 31204hours of use: 3.6 years switched on197 Current_Pending_Sector 16sectors that could not be read: failing now194 Temperature_Celsius 41normalthe verdict changes last: read the countsA drive counts its own faults. Rising counts mean copy the data off today.Every drive keeps these SMART figures; read them with the maker's tool, CrystalDiskInfo or smartctl. A harddisk also warns by clicking, grinding or taking minutes to open a folder. An SSD reports the percentage ofits write life used. The overall verdict often still says PASSED when the counts have begun to climb.

Read the SMART counts. Rising reallocated or pending sectors mean the drive is failing.

What comes next

Next: how everything outside the case plugs in

THIS LESSON✓Storage keeps what memory forgets✓A hard disk moves to the data; an SSD does not✓SATA uses a cable; NVMe plugs into the board✓A file system is the index of the drive✓A second disk survives a failureNEXTLesson 5: Ports, cables and displaysEverything so far is inside the case.Next: how the screen, the keyboard,the network and outside drives plug in.That completes the parts inside the case: the board, the power, the processor, memory and storage.One hardware lesson is left: the connections to everything outside.

The parts inside the case are done. Next: ports, cables and displays.

Lesson complete

You finished “Storage”

Nicely done.

Open in a new tab