PartsPrices › Blog › How RAID works

How RAID works

RAID lets several drives act as one bigger, faster or safer drive. Your computer sees a single disk; behind it, the data is split, copied or protected with a little extra maths across all of them.

This guide has four parts: the basics on this page, each RAID level with a drive array you can break, a comparison to help you choose, and a calculator for how many drives to buy.

One drive is a single point of failure

A hard drive is a precise machine: platters spinning 5,400 to 7,200 times a minute with a read head floating a few nanometres above them. Solid-state drives have no moving parts, but their memory cells still wear out and their controllers can fail. Large studies of tens of thousands of drives find that about 1 to 2 in every 100 fail each year.

If all your files live on one drive, that drive's bad day is your bad day. RAID, short for Redundant Array of Independent Disks, spreads data over several drives so the system can keep running when one of them dies, and so the drives can share the work.

The trade-off in one line: every RAID level gives up some combination of capacity, speed and safety to gain another. No level wins at all three.

Inside a hard drive

1234
  1. Platter. A glass or aluminium disc coated in magnetic material. Your data lives here as tiny magnetised regions.
  2. Spindle motor. Spins the platters at constant speed, day and night.
  3. Actuator arm and head. Swings across the platter to read and write. Most mechanical failures start here or at the motor.
  4. Pivot and voice coil. Moves the arm thousands of times a second.

Three ideas build every RAID level

RAID first cuts data into equal pieces called blocks (or chunks, typically 64 KB to 1 MB). Then it places them using one or more of three techniques.

Striping

Blocks are dealt out across drives like cards: one to each drive in turn. Two drives can each read half of a file at the same time, so large transfers get faster. On its own, striping adds no protection at all.

Mirroring

Every block is written to two (or more) drives. If one drive dies, the twin has a complete copy. Simple and fast to recover, but you only get the capacity of one drive out of every two.

Parity

Instead of a full copy, the array stores a small checksum, called parity, calculated from the other blocks. From it, any one missing block can be worked out again. Protection for the cost of one drive's space.

Parity is just clever addition

Parity uses an operation called XOR (exclusive or). For each bit position, it asks: is the number of 1s odd? If yes, the parity bit is 1; if no, it is 0.

The useful trick is that XOR works backwards. If you lose any one row, XOR the survivors together and the missing row reappears. That is what a RAID 5 array does, billions of times, while it rebuilds a failed drive.

Try it: click a bit on a data drive to change it, and watch parity update. Then click a drive's name to make it fail.

RAID 6 adds a second, differently calculated parity (often called Q, based on Reed–Solomon codes), which is what lets it survive two failures at once.

When a drive fails, the array keeps going

With a protected level (anything except RAID 0), losing a drive is an inconvenience, not a disaster, as long as you act before a second one goes.

1. Degraded

A drive stops responding. The box beeps or emails you. Files are still there: the missing pieces are recalculated on the fly from parity or read from the mirror copy. It is slower and has no safety margin left.

2. Replace

You slide in a new drive of the same size or larger. Many boxes accept this while running (hot-swap). A hot spare, a blank drive already installed, lets the array start this step on its own.

3. Rebuild

The array reads every surviving drive from start to end and writes the missing data onto the new one. For today's large drives this takes many hours to a few days. Once done, protection is back.

The rebuild is the risky part. Every remaining drive is worked hard for hours, and drives bought together often wear out together. That is why big arrays use RAID 6 (two-drive protection). The comparison page shows how long rebuilds take.

RAID is not a backup

RAID protects against one thing: a drive breaking. It copies every change instantly to all drives, including the changes you did not want.

What goes wrongDoes RAID save you?
One drive dies (two with RAID 6)Yes
You delete or overwrite a file by mistakeNo, the deletion is mirrored
Ransomware encrypts your filesNo, encrypted on every drive
Fire, flood, theft, power surgeNo, all drives are in one box
The RAID controller or box itself failsSometimes; you may need identical hardware to read the drives

The 3-2-1 rule

Keep 3 copies of anything important, on 2 different kinds of storage, with 1 copy somewhere else (a cloud service or a drive at another address). A RAID box counts as one copy, however many drives it holds.

Where you will meet RAID

TypeWhere it runsGood to know
NAS boxA small network storage computer (2 to 8 bays)Most home users meet RAID here. Often offers its own flexible modes (for example Synology SHR).
Software RAIDYour operating system: Windows Storage Spaces, Linux mdadm, ZFS, Apple Disk UtilityFree, portable between computers, uses a little CPU.
Motherboard RAIDA setting in the PC's firmware (Intel RST, AMD RAIDXpert)Convenient, but tied to that chipset if you move drives.
Hardware RAID cardA dedicated controller, mostly in serversFast, with battery-backed cache; drives readable only by a compatible card.

Figures for drive failure rates are rounded from published large-fleet studies. Drawings are illustrations, not specific products.