Gaming and Linux software RAID – Your path to pwnage - 03/11/2008 by Andrew
When I've seen gaming rigs (actual rigs, not the big budget magazine stuff), I usually find a powerful CPU and GPU with everything else being of average spec: on board sound, on board networking, average case (apart from see-through windows and a dozen fans) and a single modern SATA hard drive. The reason for this is simple; Eye-candy needs a powerful CPU and GPU, while the rest is just along for the ride – so to speak.
Hard drives are often forgotten as there isn't a huge amount you can do, apart from buy a Western Digital VelociRaptor. There is one more option though, using two (or more) inexpensive drives and RAID them together to increase the speed dramatically. This way you can get to high speed nirvana without destroying your budget.
With Linux, you'll not need to buy any additional cards as you can use the inbuilt Linux software RAID, which is fast, stable and free.
So what is RAID and why should I use it?
RAID stands for Redundant Array of Inexpensive/Independant Disks, or in non-geek, two or more hard drives acting as a single unit. There's a few different types, so I'll quickly outline the basic forms here (in all examples, the hard drives are exactly the same spec, though in practice you can mix and match):
RAID0: Not really RAID, as there is no redundacy. If you had two hard drives in RAID0, the RAID set would have twice the capacity and twice the speed of one drive. If one drive fails, you lose everything. Very risky, but the pay off is speed. This should be your choice for a pure gaming machine, or if it's you're regular machine, invest in an external backup drive to keep your foot fetish pr0n safe.
RAID1: If you had two hard drives, you would have the capacity of just one drive, write speeds would be the same as a single drive, though read speeds can be up to twice the speed of one drive. If one drive fails, nothing is lost as it still exists on the non-failed drive. Very safe (the equivalent of instant backups) and you do get a read boost (in practice, a little bit faster than one drive).
RAID5: If you had three hard drives, you would have the capacity of two drives, increased read speed but slow write speeds. You can lose one drive and you'll still have your data, though since the RAID set will be running in a redundant state, things will be VERY slow. Great for fileservers, not the best for gaming.
There's also RAID1+0, RAID0+1, RAID10, RAID50, RAID6 and RAID5 with hot spares as well as a stack of other obscure RAID types. For gaming, you'll generally stick with RAID0, RAID1 or possibly RAID5 if your gaming machine doubles as your storage server.
So, now you know the basic RAID types – why should your next Linux gaming rig use RAID? Well, first off, you don't need to shell out money for a hardware RAID card – Linux software RAID (included with every distro) will do the job perfectly and has the additional bonus of being transportable to a new system. If your motherboard dies, you can move your entire set into a new machine and you're good to go, if your hardware RAID card dies, you invariably need to purchase that exact same card again to get your data off.
Secondly and most importantly, you'll get a huge speed boost in game loading times and map load times. With UT2004 as well as other first person shooters (like Nexuiz and OpenArena), you'll be one of the first to start the map giving you valuable time before the other players start. With Enemy Territory: Quake Wars, you'll be able to choose GDF or Strogg first, though you'll still have to endure the 30 second warm-up. In other games you'll give a boost in load times, which is a good thing regardless. Having an additional 20 odd seconds to survey the level may mean the difference between pwning or being pwned.
So what are the downsides?
Using Linux software RAID will make your CPU do some extra crunching, though on modern PCs this will be less than 5% of a single core. Basically, you're not going to notice it, though it is a downside. You'll also be at risk of losing your data, depending on the RAID type you're using.
You'll also use a bit more energy as you'll have more hard drives running. This isn't going to be much, around 20 watts or so (YMMV).
Another issue is if you're wanting to run a 'dual boot' setup with Windows as you'll need to use hardware RAID to do this properly. Yes, there are ways around it such as having two drives RAID0 for your Linux and a third drive for Windows, though this is just too much hassle. A better solution would be to have an external SATA (eSATA) drive with Windows on it connected to your first SATA port on your motherboard, with the other internal drives being Linux. This way, if the eSATA drive is switched on, then Windows boots, otherwise you'll be using Linux.
Cool – I'm in. How do I set up RAID?
The easiest way to setup RAID is during the installation of Linux. You will have to do the partitioning yourself though this isn't scary. Lets say you're wanting a RAID0 setup with two 500GB SATA drives. The first thing you'll have to get your head around is that you'll have to create 'md' devices and then create partitions from them. So to create '/boot' you'll need create two 100MB partitions (one on each physical drive) and set the type to RAID. From there you can join the two logical partitions as a RAID1 (it's best to mirror /boot) and from there set as /boot (and as bootable) as if it's a regular drive. Do the same for swap (though use RAID0) and then again for / (again, RAID0) and that's all there is to it.
If you couldn't follow that (and I don't blame you, I've just skimmed the surface), hit google to find some RAID how-tos for your distro of choice.
Bottom Line
Linux software RAID is stable, portable and doesn't require additional hardware. Using two inexpensive drives you can have read/write speeds faster than the fastest single drives out there allowing you to have the fastest load times on the server. By the time the other playsers load the map, you've already grabed all the drops and are setting up to spawn camp and execute tea bag mayhem.