You are here

Linux RAID partition almost useless

Submitted by Peter on Thu, 2012-09-27 20:51

There are many ways to build RAID arrays in Linux and Windows. Both Microsoft and the Linux developers work really hard at making RAID difficult for absolutely no reason. Linux is way ahead of Windows on both difficulty and uselessness. if you are a Linux bigot, you might as well leave now before you read the truth.

RAID 1 or RAID 5?

There are two RAIDs in common use, RAID 1 and RAID 5. Everything else is a slight modification for special circumstances. RAID 1 replicates a disk to a second disk and is used to backup your system disk. RAID 5 lets you join multiple disks together for both reliability and speed but you need at least three disks and do not get real storage efficiency until you use several more disks. Disks are so cheap that the cost of duplicating disks in RAID 1 is not significant.

RAID 5 problems

There is one reason for using RAID 5 and that is the huge array you can build. The first problem you will strike is backing up the array because of all that data. You will backup the array because it takes so long to recover an array from a broken disk. RAID 5 has one spare disk and an array of 11 disks is too expensive to depend on one spare disk plus there is nothing big enough to backup that much data.

RAID 6 is RAID 5 with two spare disks instead of one spare disk. The theory is you can replace one broken disk before a second disk breaks and your array will not die until a third disk breaks. Backing up to another device may be less important. RAID 6 can have more than 2 spare disks.

A quick calculation on RAID 5. You can easily buy a server to sit next to your desk with space for 11 magnetic disks. You slip in a couple of SSDs for the system disk as RAID 1 then you put in 11 magnetic disks for your RAID 5. Assume we use 3 TeraByte disks. Using 11 disks as 10 data disks and 1 spare gives you 30 TB of storage or 30000 Gigabytes to 30000000 Megabytes. The backup time across a busy GigaByte network would be lucky to each 300 MB per second, giving you a backup time of 100000 seconds or 28 hours. You might decide to use the 11 disks as 9 + 2 spares and settle for 27 GB of storage, or 8 +3 spares and only 24 TB of storage.

Straight up fact, there is no difference between RAID 5 in Windows and Linux. Both have the same problem of long backups and the problem of long replacement times for disks because of the long time the replication takes to the spare disks. Both have options for different configurations including dynamic configurations that can grow.

For both operating systems, you can replace the operating system RAID processing with hardware RAID, which is equally expensive for both because it is the same hardware. The hardware RAID does not reduce backup times and does not reduce the chance of a second disk breaking while you are recovering the first broken disk.

The only difference between Windows and Linux is the operating system option. Desktop Windows does not have RAID, only the server version has RAID. Linux can have RAID on any version but you have to install it yourself on the desktop versions. Linux has options for LVM and other things that make RAID harder for some things and easier for other things. I find the Linux RAID configuration software extremely difficult and there is no documentation guiding you through the mess.

Yes, Linux does have documentation on how to set up RAID 5. No, there is nothing to tell you all the options or the advantages and disadvantages of each option. You end up with a RAID 5 array that cannot be repaired easily.

When you set up RAID 5 on a typical computer, you end up with defaults that are overly complicated because they are designed to give you features you cannot use. Why have RAID that can expand in size if your computer cannot fit more disks or your motherboard does not have connections for more disks? The Linux RAID configurations should start from simpler defaults.

RAID 1

RAID 1 has two disks back to back replicating the data. There is also a RAID 0, which is not RAID because it has no redundancy, and should be called AID 0. AID 0 has the disks end to end to increase storage capacity but not reliability or speed. If you have four disks, you can put two together in AID 0 then the other two together in AID 0 then join the two AID 0 arrays as one RAID 1 array, a configuration sometimes called RAID 10.

Your four disks can also be configured as RAID 01, a system often called RAID 10. What you do is connect two disks in RAID 1 then connect the other two disks in RAID 1 then join both RAID 1 disks in an AID 0 array.

Which is better, RAID 01 or RAID 10? Both will break horribly when one disk breaks. With RAID 10, you break the outside AID 0 array first and that destroys all the data across all the disks.

RAID 01 is slightly better. With RAID 01, you will have to break the RAID 1 array then repair one of the AID 0 arrays then join the repaired AID 0 array back to the working AID 0 array and recreate the RAID 1 part of the array and hope the AID 0 arrays within the RAID 01 array replicate in the right direction. You end up with your server down for the whole creation time. RAID 5 is usually a better approach for four disks.

Some hardware RAID controllers are better than the Linux software for helping you recover while other hardware controllers are more insanely difficult than the Linux software.

The good parts

RAID is faster than separate disks. RAID 1 takes the same time to write to two disks as it takes to write to one disk and writes can be twice as fast because they can be spread over two disks. RAID 5 can be faster for large reads and writes because it can spread the work over several disks.

The bad parts

Some RAID software confuses everything by throwing in striping and other complexities where they have no advantage and make recover worse. The most common error is to try to stripe RAID 1 instead of just replicating. The next error, which appears to be only in Linux, is to destroy disk partitions in RAID 1 and replace them with something that is not replication.

Linux is the worst

When you use RAID 1 on Windows and leave the stupid dynamic partitions options switched off, each disk is loaded with a pure clean NTFS partition. You can remove one disk and keep the disk as a backup you can access anywhere. Linux hates anything that simple. A huge slice of Linux developers are ex Unix developers and want everything built by them to be more complicated than anything ever built by anyone else. When you remove a disk from a Linux RAID 1 array, the files are not accessible. STUPID!!!

RAID 1 is a natural for desktop computing and the free RAID in Linux is one of the few real advantages of Linux over Windows, but the free bit does when you try to use RAID 1 in Linux. Configuration is harder unless you use the defaults and the defaults are a disaster where you can never recover from a disk failure. When you do put the effort in to configure RAID 1 the best way, you find the result is still unusable for many of the things RAID 1 is designed for. Recovery is a pig no matter what you do.

RAID 1 on Linux is so bad I am removing RAID 1 from my Linux machines when I rebuild them. RAID 5 is also painful but if you use Linux RAID 5 purely for a large array and give up on recovering from a disk failure, Linux RAID 5 can be made viable.

Ext4 or NTFS

Linux can read and write Windows NTFS plus Linux Ext4. Ext4 is almost as good as NTFS. Several of the faults in earlier versions of Linux file systems are either removed or there is an option to remove them. If Linux distributors could agree to set the right defaults for Ext4, Linux could be the leader instead of the follower. All I can say at this point is I have many NTFS disks from Windows XP systems and every file on every disk is accessible on every computer. I have about the same number of disks from Linux systems and most of the disks are not accessible on Linux.

I still cannot write out a list of settings for Linux that will guarantee a disk can be recovered in an emergency. Some of the points are do not use RAID and use NTFS instead of Ext4. If you use Ext4, switch off atime, do not use LVM, and use only primary partitions. There are some journaling things that need changing to get real journaling. Linux does not have a genuine write, only a fake write with a sloppy delayed write that is never explained properly so you can safeguard against the disasters.

Try removing a disk from a USB socket to see some of the problems with Linux. Most of the time you have to shut down the computer to unplug the disk. The problem is so bad I am giving up on backing up from Linux to USB and looking at plugging al the USB drives into Windows. The only place I currently backup from Linux to USB is on my ultrabook because I can shut that down and restart it in a few seconds.

Conclusion

I could rant on for longer about some of the RAID stupidities in Ubuntu Linux, Debian Linux, Red Hat Linux, CentOS Linux, and some other distributions but the inability to use RAID 1 is a show stopper long before anything else. Linux might as well not have RAID for desktop computers because it is worse than not using RAID. Linux RAID on desktop computers is a disadvantage compared to Windows, not an advantage.