Wednesday, February 19, 2014

SnapRAID + Open Media Vault

Much as I have found Open Media Vault (OMV) to be an excellent choice for managing my NAS, it is not without limitations. At least, when compared with one it's main competitors...


For example, out of the box, OMV only supports fairly standard RAID options, with most NAS users using RAID5 or occasionally RAID6. With RAID5/6, you cannot mix and match drives of different sizes -- this is generally not an issue in a corporate environment, who buy hard drives in large batches. But in my experience, the typical home user cobbles together their first NAS using a mixture of discarded hard drives. As they need (and can afford), this is perhaps supplemented with whatever they can pick up on sale from their local computer shop. It's rarely an orderly process. unRAID's proprietary approach accommodates this well. You can mix and match drives of a variety of different sizes, adding new drives to the pool as required. With RAID5, parity information is striped across the entire pool of drives, whereas unRaid maintains the parity information on a single drive. The only requirement is that your parity drive is as large (or larger) than the largest non-parity drive in the array.
One of the other advantages of unRaid's non-striped approach is that reading data from a drive only requires a single drive to be spinning (ie, the one with the data). With RAID5, since your data is striped across multiple drives, reading a file from the array will require all the drives in the array to be spinning. Again, in a corporate environment this is usually not a problem... file servers are expected to run 24/7, and are designed accordingly. They are usually stored in a server room, where noise, heat and power consumption can be dealt with. In a home situation, this may not be viable.
I'm pretty lucky that I have a "man cave", where my NAS can be tucked away on a shelf. The room is pretty cool most days, so hard drive heat is rarely an issue. And it is sufficiently isolated from the rest of the house that the mild hum of a spinning drive doesn't cause issues. Not everyone is so lucky. About 70% of the activity on my NAS would occur between 6pm-10pm each evening... ie, after I get home from work. The rest of the time, it can mostly sit idle... with the exception of logging, cron jobs, backups, etc. The RAID5 approach means that all my drives are spinning pretty much 24/7, when they really don't need to. Is this really a big deal? No idea. But I wanted to explore some alternative options. Of course, I could always just switch to unRaid. But as per a previous post, it has some limitations.


FlexRAID aims to provide some of the benefits or unRAID, but takes a different approach. Whereas unRAID is a fully-fledged NAS operating system, FlexRAID is an add-on to an existing operating system. Both Linux and Windows are supported. Like unRAID, FlexRAID doesn't stripe your data, which allows you to have a variety of different drives, of different sizes. And, since the drives operate independently, only a single drive will spin up when data is being read. FlexRAID also offers a really nifty benefit over unRAID in that you can add an existing drive to the array and still retain the data on the drive. FlexRAID is proprietary software, with a typical ticket price of US$59 and they offer a 2 week trial for free. Unfortunately, after making an initial attempt to get set up, I wasn't able to really thoroughly test FlexRAID within my two weeks. So my knowledge kinda ends there. At the very least I can say it has a really natty interface :)


Like FlexRAID, SnapRAID provides parity-based redundancy. And, like FlexRAID it is available for both Linux and Windows. In fact, being an open source product, it can potentially be compiled for a wide variety of operating systems. With SnapRAID, you nominate the drives to be included in your "array", and one (or more drives) to store the parity information. A sync command can then be used to update the parity data.The requirement to update on command is an important distinction between SnapRAID and most other forms of RAID. If you have an error, you'll only be able to restore data from the last sync point. Typically, you would schedule syncs according to your needs -- maybe only once a day if your data doesn't change regularly. Of course, the more frequent your data changes, the more frequent you'll want to schedule syncs. But in most home situations, data on a NAS doesn't change that regularly, so this isn't a significant limitation.
On the flip side, SnapRAID has a nice little advantage over typical RAIDs. That is, you can actually restore files even if they aren't corrupted or damaged. In other words, it serves as a handy little "undelete" function. Again, you can only undelete files that have parity information stored. One of the really nice features of SnapRAID is that it works on existing drives and existing filesystems. This means that you can add parity protection to an existing drive without having to back-up your data, reformat the drive and then restore your data. This is something unRaid can't do. Furthermore, if you ever choose to stop using SnapRAID, or want to move your drive to another system, you don't really have to do anything. A drive currently being protected by SnapRAID can be read by another system, assuming the other system can understand the filesystem. There are some limitations; that being you really need to use either NTFS (for Windows) and ext4 (for *nix).
I've heard some criticisms of SnapRAID on the basis that it is a command-line driven application. This is true -- running SnapRAID, either through *nix or Windows, will typically require you to run some simple commands. None of them are overly complicated. That said, there is a GUI for Windows, called Elucidate. I can't comment on whether it is any good or not, since I'm not using SnapRAID on a Windows machine.


I followed the instructions found here. They required me to install some additional packages in order to compile SnapRAID. But if you want, these can be safely removed once SnapRAID is installed. The whole process probably took about 10 minutes in total.
Alternatively, Open Media Vault now has a SnapRAID plugin which integrates quite nicely with the OMV web interface. The plugin keeps the SnapRAID binary up to date without needing to compile from source. I've been using this plugin for several weeks now without any significant issues.

No comments:

Post a Comment