Difference between revisions of "Raid on Linux"

From docwiki
Jump to: navigation, search
(Software vs. Hardware RAID)
Line 26: Line 26:
   
 
== Software vs. Hardware RAID ==
 
== Software vs. Hardware RAID ==
  +
  +
If you buy a server you usually get them with a '''Hardware RAID''' controller: That is the controller card takes care of the RAID. If multiple disks are connected and your controller is configured the right way it presents the RAID devices as a normal disk, independent of the operating system you are using. Often this configuration can be done via a BIOS menu that is available while booting the server.

Revision as of 12:45, 30 October 2020


Motivation

While they have gotten significantly more reliable in the last years, hard-disk are still the parts that most often fail in computers and they contain all your data. Thus you should always have a good and recent Backup. But if your server crashes because of a defective hard-drive this is still bad as it means the server is not available and you might need a significant amount of time to restore your data. What we want is a system that can tolerate the failure of a disk and still work. This is what RAID is for.

What is a RAID

In a RAID system you store your data on more then one disk when you write and when you read you can take any of the disks that contain a copy of your data and read from there. When one of the disks fails your data is still available. Once your replace the damaged disk the system can sync the data back and restore the redundancy.

On a RAID1 system you have 2 disks and the data is mirrored on both disks.

On a RAID4 and RAID5 you have 3 or more disks and one of the disks is a party disk (on RAID5 the parity is distributed) disk: E.g. on a RAID5 with 4 disks of 1TB you have a capacity of 3TB and one of the disks can fail.

On a RAID6 you have 2 party disks. This means that 2 disks can fail and you still have access to your data. In a RAID5 when after one disk fails and the disk is replaced the data on the party must be reconstructed. The strain that this puts on the disks can cause an additonal disk to fail so it makes sense to have a 2nd party disk for such cases.

On a RAID0 you do NOT have redundancy but the data is striped between the 2 disks and if one of them fails you loose all your data. People use RAID0 if they need higher performance and if they do not care about data loss.

RAID10 consists of 2 RAID1 systems that are combined as a RAID0 so you have additional performance while still some degree of redundancy. Similar: RAID60 which is a stripe set of 2 RAID6.

Hot Spare Disks are disks that are already in the system but not used until a disk fails and then used to immediately replace the failed disk.

A RAID needs to be monitored!

Since the system runs uninterrupted when a disk fails it can easily happen that you completely miss that event and for month you run the system without redundancy. When another disk fails your data is lost! Thus you always need to monitor your RAID system for failed disks so that you can replace the failed parts in a timely manner. This applies to all redundant components in your system (e.g. redundant power supply).

Software vs. Hardware RAID

If you buy a server you usually get them with a Hardware RAID controller: That is the controller card takes care of the RAID. If multiple disks are connected and your controller is configured the right way it presents the RAID devices as a normal disk, independent of the operating system you are using. Often this configuration can be done via a BIOS menu that is available while booting the server.