# RAID calculator (RAID 0, 1, 5, 6 and 10)

> Calculate usable RAID capacity, parity or mirror overhead and how many drive failures RAID 0, 1, 5, 6 and 10 survive, in TB and the TiB Windows shows.

Интерактивная версия: https://www.calcopenly.com/ru/programming/raid-storage-calculator
Тема: Калькуляторы программирования и технологий

Usable capacity is the drive size times the number of drives' worth of space that holds data: n for RAID 0 striping, 1 for a RAID 1 mirror, n − 1 for RAID 5 single parity, n − 2 for RAID 6 double parity and n ÷ 2 for RAID 10 striped mirrors. The rest of the raw space holds copies or parity, which is what lets the array keep running after a drive fails.

People use it to size a NAS or server before buying drives. The default, four 8 TB drives in RAID 5, gives 24 TB usable out of 32 TB raw, 75% efficiency, and survives one failed drive. In Windows the same space appears as 21.83 TB, because Windows divides by 2^40 (the binary TiB) but prints "TB".

The results assume identical drives; with mixed sizes, each drive counts as the smallest one. File-system metadata, hot spares and reserved space are not subtracted, so the room left for files is slightly lower.

## Входные данные

- **RAID level** (варианты: RAID 0, RAID 1, RAID 5, RAID 6, RAID 10)
- **Number of drives**
- **Size of each drive**: Drive makers label sizes in decimal TB (10¹² bytes).

## Результаты

- Usable capacity (TB) — основной результат
- Usable in binary units (as Windows and df -h show it) (TiB)
- Raw capacity (TB)
- Used for redundancy (TB)
- Space efficiency
- Drive failures always survived
- Fault tolerance
- Disk I/Os per small random write
- One drive in binary units (TiB)

## Формула

$$
\text{usable} = s \times \begin{cases} n & \text{RAID 0} \\ 1 & \text{RAID 1} \\ n-1 & \text{RAID 5} \\ n-2 & \text{RAID 6} \\ n/2 & \text{RAID 10}\end{cases}
$$

## Примеры с решением

### RAID 5 with 4 × 8 TB

- RAID level: RAID 5
- Number of drives: 4
- Size of each drive: 8 TB
- **Usable capacity: 24 TB**
- **Usable in binary units (as Windows and df -h show it): 21.83 TiB**
- **Space efficiency: 75.00%**
- **Drive failures always survived: 1**
- **One drive in binary units: 7.28 TiB**
- Источник проверки: Python 3.8 decimal: (4 − 1) × 8 = 24 TB; 24e12 / 2**40 = 21.8279 TiB; 8e12 / 2**40 = 7.2760 TiB

### RAID 6 with 6 × 4 TB

- RAID level: RAID 6
- Number of drives: 6
- Size of each drive: 4 TB
- **Usable capacity: 16 TB**
- **Used for redundancy: 8 TB**
- **Space efficiency: 66.67%**
- **Drive failures always survived: 2**
- **Disk I/Os per small random write: 6**
- Источник проверки: Python 3.8: (6 − 2) × 4 = 16; 16/24 = 66.67%

### RAID 10 with 4 × 2 TB

- RAID level: RAID 10
- Number of drives: 4
- Size of each drive: 2 TB
- **Usable capacity: 4 TB**
- **Space efficiency: 50.00%**
- **Drive failures always survived: 1**
- **Fault tolerance: 1 drive guaranteed; up to 2 if each failure is in a different mirror pair**
- Источник проверки: Python 3.8: 4 / 2 × 2 = 4 TB; with 2 mirror pairs one failure per pair is survivable, but two in the same pair are not

### Two-drive mirror

- RAID level: RAID 1
- Number of drives: 2
- Size of each drive: 1 TB
- **Usable capacity: 1 TB**
- **Space efficiency: 50.00%**
- **Drive failures always survived: 1**
- Источник проверки: Definition: every member holds a full copy

### RAID 0 has no redundancy (edge)

- RAID level: RAID 0
- Number of drives: 3
- Size of each drive: 500 GB
- **Usable capacity: 1.5 TB**
- **Used for redundancy: 0 TB**
- **Space efficiency: 100.00%**
- **Drive failures always survived: 0**
- Источник проверки: Python 3.8: 3 × 500 GB = 1.5 TB

### RAID 5 at its 3-drive minimum (edge)

- RAID level: RAID 5
- Number of drives: 3
- Size of each drive: 4 TiB
- **Usable in binary units (as Windows and df -h show it): 8.00 TiB**
- **Usable capacity: 8.796 TB**
- **Space efficiency: 66.67%**
- Источник проверки: Python 3.8: 2 × 4 × 2**40 / 1e12 = 8.796093 TB

## Вопросы

### How much usable space does RAID 5 give?

RAID 5 gives (n − 1) × drive size, because one drive's worth of space holds parity. Four 8 TB drives give 24 TB (75%) and eight give 56 TB (87.5%). It needs at least 3 drives and survives exactly one failure. Efficiency rises as you add drives, but so does the amount of data a rebuild must read without hitting a second failure.

### What is the difference between RAID 5 and RAID 6?

RAID 6 stores two independent parities (P and Q) instead of one, so it survives any 2 failed drives at the cost of a second drive's capacity. With six 4 TB drives, RAID 5 gives 20 TB and RAID 6 gives 16 TB. A small random write costs 4 disk I/Os on RAID 5 and 6 on RAID 6, so RAID 6 writes are slower.

### Is RAID 10 better than RAID 5?

RAID 10 is faster and rebuilds more safely, while RAID 5 stores more. RAID 10 always keeps 50% of raw space, so 4 × 8 TB gives 16 TB against 24 TB for RAID 5. A small random write costs 2 disk I/Os instead of 4, and a rebuild copies one mirror partner instead of reading every drive. RAID 10 survives 1 failure for certain and up to half its drives if each is in a different pair.

### Why does an 8 TB drive show as 7.28 TB in Windows?

Drive makers use decimal units, 1 TB = 10^12 bytes, while Windows divides by 2^40 = 1,099,511,627,776 bytes and still labels the result TB. 8 × 10^12 ÷ 2^40 = 7.28, so no space is missing; the gap is about 9% at terabyte scale. IEC 80000-13 names the binary unit the tebibyte (TiB). Macs have reported decimal units since OS X Snow Leopard.

### Is RAID a backup?

No. RAID keeps an array running through drive failures, but deletions, ransomware encryption and file-system corruption reach every drive at once, and RAID 0 has no redundancy at all. Keep separate backups: CISA recommends the 3-2-1 rule, which means 3 copies of important files, on 2 different media types, with 1 copy stored off-site.

### Насколько точен «RAID calculator (RAID 0, 1, 5, 6 and 10)»?

Точность зависит от введённых данных и допущений метода. Десятичная арифметика использует 50 значащих цифр, но оценки, численные методы и исходные данные могут быть менее точными; округление на экране не устраняет эти ограничения. Решённые примеры, проверенные по независимым источникам: 6. Например, «RAID 5 with 4 × 8 TB» проверяется по источнику Python 3.8 decimal: (4 − 1) × 8 = 24 TB; 24e12 / 2**40 = 21.8279 TiB; 8e12 / 2**40 = 7.2760 TiB.

### Откуда взята методика?

SNIA Common RAID Disk Data Format (DDF) Specification, rev. 2.0 — RAID level definitions; Patterson, Gibson & Katz (1988), A Case for Redundant Arrays of Inexpensive Disks (RAID), SIGMOD; IEC 80000-13:2008 — binary prefixes (1 TiB = 2⁴⁰ bytes).

## Источники

- [SNIA Common RAID Disk Data Format (DDF) Specification, rev. 2.0 — RAID level definitions](https://www.snia.org/tech_activities/standards/curr_standards/ddf)
- [Patterson, Gibson & Katz (1988), A Case for Redundant Arrays of Inexpensive Disks (RAID), SIGMOD](https://doi.org/10.1145/50202.50214)
- IEC 80000-13:2008 — binary prefixes (1 TiB = 2⁴⁰ bytes)
