RAID combines several drives into one logical array to absorb failures or increase performance. RAID 1 and 10 mirror, RAID 5 and 6 distribute parity data, RAID 0 offers no protection. RAID 10 and RAID 6 are common for servers. RAID does not replace a backup, because deleted or encrypted data is mirrored as well.
Key facts
- Meaning
- Redundant Array of Independent Disks
- Common for servers
- RAID 10 and RAID 6
- No protection
- RAID 0, one failure affects all data
- RAID 6 tolerance
- Two drives at the same time
- No substitute for
- Backup following the 3-2-1 rule
- At Realtoxmedia
- Ceph SSD in VDS, Ceph HDD in storage
How does a RAID array work?
A RAID controller, either a plug-in card or software in the operating system, combines several physical drives into one logical volume. The operating system only sees this one drive, and the controller handles how the data is distributed. There are three basic techniques. Striping distributes data block by block across several drives and increases throughput. Mirroring writes identical copies to several drives. Parity stores checksums from which the contents of a failed drive can be reconstructed. The RAID levels are combinations of these techniques and differ in usable capacity, fault tolerance and speed.
The main RAID levels
The number after RAID names a method, not a quality grade. A higher level is therefore not automatically better. What matters is how many drives may fail, how much raw capacity remains usable and how fast the array writes. The overview gives the fault tolerance at the minimum number of drives and the typical use. Capacity figures apply to drives of equal size, where n is the number of drives in the array.
- RAID 0: striping without redundancy, full capacity, high throughput. One failure destroys all data.
- RAID 1: mirroring of two drives, 50 per cent usable capacity, one failure tolerable. Common for system disks.
- RAID 5: parity from three drives upwards, usable capacity n-1, one failure tolerable. Risky with large drives.
- RAID 6: double parity from four drives upwards, usable capacity n-2, two simultaneous failures tolerable.
- RAID 10: mirrored stripe sets from four drives upwards, 50 per cent usable capacity, fast when writing. Common for databases.
- RAID 60: several combined RAID 6 groups for large arrays with plenty of capacity and high fault tolerance.
At today's drive sizes RAID 5 is considered outdated. The reason is rebuild time, covered in the next section.
Hardware RAID or software RAID?
A hardware RAID runs on a dedicated controller with its own processor and a write cache backed by a battery or capacitor. This relieves the CPU, speeds up writes and prevents data in the cache from being lost during a power failure. On the other hand, the array is tied to the controller, and a defect often requires an identical replacement part. Software RAID, usually mdadm or ZFS under Linux, needs no special hardware and can be moved between systems. ZFS also verifies checksums and so detects silent data corruption. Software RAID does cost CPU time, though, and writes more slowly at the parity levels without a buffered cache. Hardware RAID is the norm for dedicated servers, including at Realtoxmedia.
The risk lies in the rebuild
After a drive failure the array has to be restored, which is called the rebuild. The controller reads all remaining drives in full to fill the replacement drive. With a 16 terabyte hard disk this takes many hours to several days, depending on load. During this time the array has no redundancy or only reduced redundancy. At the same time the sustained load raises the probability that a second drive of the same age fails. With RAID 5 and large drives, all data is then lost. RAID 6 and RAID 10 remain protected during this phase. Keep replacement drives or hot spares ready so that the rebuild can start immediately.
RAID is not a backup
This misconception is expensive and usually only noticed when data is missing. An array only protects against the failure of one or more drives. Every change is written immediately to all participating drives, including a wrong one. RAID provides availability, a backup provides recoverability, and you need both. No RAID level helps in these cases:
- Accidentally deleted files or a database command executed incorrectly.
- Ransomware that encrypts data. The encryption is written to all drives immediately.
- File system errors and corruption caused by faulty software.
- Controller defects or configuration errors that render the entire array unreadable.
- Fire, water or theft, because all drives sit in the same chassis.
How do you combine RAID and backup?
RAID keeps day-to-day operation running, the backup is for recovery. The 3-2-1 rule is the usual standard: three copies of the data on two different media, one of them at another location. A storage server or separate storage space at the provider covers the off-site part without you setting up hardware of your own. Test the restore. Only then do you know whether the backup works.
- Choose the RAID level by use case, RAID 10 for databases, RAID 6 or 60 for large capacity.
- Monitor failures. A degraded array keeps running and can otherwise go unnoticed for months.
- Write backups to separate hardware and to another location.
- Keep versioned backups so that damage noticed late can still be undone.
- Test restores regularly and document the recovery time required.
At Realtoxmedia, dedicated servers have hardware RAID. The Virtual Dedicated Server (VDS) stores data on SSDs in the Ceph cluster, the Storage VPS on HDDs in the Ceph cluster with an NVMe cache. The Storage VPS is available from €3.99 per month as a target for your backups.
RAID absorbs drive failures and so increases availability. It does not protect against data loss from deletion, encryption or fire. Choose RAID 10 for write-intensive systems and RAID 6 or 60 for large capacities, and set up a separate, tested backup following the 3-2-1 rule as well.