My Little RAID, Pt. 2

Posted 30 Apr 2011

So now that I have a machine and the hardware has checked out, it’s time to load the software. But: what software?

There are, thanks to the Free Software Movement, lots of choices these days. All proprietary software (Windows, OS/X, etc.) are non-starters for me. Never give up freedom for a bit of temporary data safety.

When I first started this project, I planned to use something like FreeNAS or OpenFiler. They take a machine with a set of drives and turn it into a NAS. Since this was the main purpose of my box, it seemed a quick and easy way to get up and running. But as I sorted through hardware options, I wanted more capability. If I was going to run on a full PC, I may as well have all the functions.

All modern operating systems support software RAID and can export files via standard protocols; even Microsoft’s SMB is supported via the Free SAMBA code. So I had no worries about setting up a file server that could share with anyone. I was more concerned about security, stability, and features.

Linux is something I know well, having used it since 1995 as my only OS. But I’ve seen Linux grow fat and less stable over time. I really like OpenBSD, since it has a security record unmatched by anything outside of the NSA computer complex. But since I don’t plan to expose this box to the outside world, I am not as concerned about security. FreeBSD seemed like a good choice. It’s a stable, enterprise class OS that’s been around for decades. The one ISP that gave me a tour was using it, and when I commented on that he said, “When you need the best, you run BSD.” If BSD can run a large ISP, I guess it’ll handle my file storage just fine.

I did a bit more searching to make sure I could have a media center under BSD as well. I found that while there’s no MythTV or Freevo equivalent on FreeBSD, it does run all the audio and video players I use. When I set up my current media center, I tried Freevo, and it broke on upgrade. I realized I really only needed to run the movie player anyway, so I switched to a wireless mouse, RF remote and Xine. (Amarok for audio.) If the FreeBSD box can handle that, I’m happy.

So FreeBSD it is. The next piece is the most important; the RAID software. Linux has “mdadm” and “lvm” to handle this. FreeBSD has “vinum”, “GEOM”, and “ZFS”. Ah, there’s that choice paradox again: the more choice I have, the more likely I am to get what I want. But I’m also forced to sort through the choices to find it. Apple solves this for their customers by simply not providing a choice. It’s iWay or the highway.

Vinum is a logical volume manager that is mostly replaced by GEOM. ZFS is the “Zettabyte File System” created by Sun (now Oracle) and released as Free Software. You can read more about GEOM and ZFS at Wikipedia.

Both GEOM and ZFS do the same job, but in different ways. Aside from the different approaches to the same features, ZFS does a better job of managing bit errors. This problem with data storage was mentioned in the original RAID paper, and was the reason for creating the standard RAID level 2. In a nutshell, magnetic media is subject to “bit rot”. Alpha particles from space (or Fukushima) will corrupt the data on the drive. Left unchecked, your data eventually becomes unreadable. RAID-2 is no longer used, however, because drive manufacturers recognized the problem and built error correction in to their products. Modern RAID is all about drive failure, not bit failure.

But error correction schemes have limits. From what I’ve read, the standard error correction starts failing somewhere between 1.5TB and 2.0TB. This means that those larger drives will eventually lose your data, because the error correction can’t manage it. ZFS excels in this area: it does extensive data checksumming and correction throughout the file system (not just on data; the housekeeping can go bad as well). For enterprise systems using 2TB drives, this is the only game in town. It’s supported on all OS’s except Microsoft Windows (which you shouldn’t be using for enterprise servers anyway).

I decided to go with GEOM instead. First, I’m using 500GB drives, so the error correction is just fine. Second, it has an interesting architecture that makes it unbelievably flexible. Third, the instructions for what I intend to do are right there in the FreeBSD Handbook. I also like that GEOM has been in FreeBSD longer than ZFS, so it’s likely to have better support and more web pages to help me over unexpected errors.

Well, that took longer to explain that I expected. I’ll cover my installation experience and bring-up hassles in the next installment.

Same bat-time…same bat-channel.