What is unRAID®?
unRAID is software for storing and managing digital files on a mass-storage server. In more technical terms, unRAID® is an embedded Network Attached Storage (NAS) server operating system. It was specifically designed for digital media storage (e.g., videos, photos, music, & movies). It allows you to build an array of hard drives and share the data from those drives across the local network (typically within a house or business). Importantly, it protects all the data on the drives if one should fail (see all the benefits here).
How Does unRAID® Work?
1. It saves data to one disk, but provides an aggregated view of all the drives
Unlike most RAID systems, unRAID saves data to individual drives. Once you set up your folders on an individual drive, unRAID replicates those folders in an overall share or parent directory that gives you an aggregate view across the entire server. For example, in the first screenshot below, you can see the Web browser view of my shares (or folders) on my unRAID server. If I want to view all the weddings on the server, I just click on the View icon to the right of the Wedding Videos folder (next image). If I need to know where a wedding is located, I can view the drive under the “Location” column.
How is this different than RAID? Instead of saving data directly to one individual disk at a time, all RAID servers (except for RAID1) split the data across two or more drives. This technique is called “striping.” For example, when saving a wedding video, pieces of the wedding video will get distributed across several disks at once. As a result, if you want to view the wedding video, all drives containing its files have to be spun up as it doesn’t exist on any individual drive.
Here are two animations comparing how RAID5 and unRAID save data.
The way most RAID systems stripe data across the disks may appear an odd way of doing things, but it offers faster performance when capturing and displaying data. This was a huge issue in the era of slow, low-capacity drives (circa 1987).
However, striping has its disadvantages:
- Every time the server is either reading or writing data, all of the drives have to be spun up. This consumes more energy, creates more noise and heat, and causes wear-and-tear on the drives over time.
- All the drives need to be the same size and speed and you can’t freely add a new drive without disturbing the data on all of the other drives – therefore it isn’t very flexible.
- Multiple, simultaneous hard-drive failure can result in catastrophic loss of all data.
Here are two animations of what happens comparing what happens when two drives fail in a RAID5 system vs. unRAID. All these examples are just depicting six total drives in the array. Imagine if there were more.
Because modern drive speeds are much faster and capacities much larger, Lime Technology introduced unRAID to overcome some of RAID’s drawbacks and create more reliable, protected mass storage. unRAID® completely does away with striping, writing to a single drive, and lets users build parity-protected data storage from drives of different sizes and add capacity on the fly.
Also, for most small business and home applications, the speed performance advantage of RAID is limited by the bandwidth of the local Ethernet. It’s like having a Ferrari but only being able to drive on residential streets.
2. It Uses a dedicated “Parity” drive to back up all the others
What happens if only one of the drives crashes? Well, you’re okay as long as you have a back-up plan (also known as “redundancy” or “fault tolerance”). RAID1 provides this by simply mirroring or creating an exact replica of another drive. For most RAID systems, including unRAID, the emergency restore plan is accomplished by dedicating one of the drives to backing up all of the others, and this is called the Parity drive.
While it seems mind boggling that one drive can possibly back up other drives that have way more storage capacity than the parity, it is able to reconstruct the missing data from a failed drive using binary logic called XOR (eXclusive OR). Since hard drives store data in zeroes and ones, when a drive fails the parity compares the binary data on all the drives and can deduce the missing data to rebuild. If you have 3 drives, two for storage and one for parity, using “even” parity (meaning what must the sum be to make it even) your drive would look like this:
If Drive B fails, here is the binary logic for rebuilding the data:
Rebuilding from Drive B Failure
Binary Logic for Even Parity
When capturing data, unRAID® writes an independent file system to each data drive. When you save a file to the system, it’s stored in one data disk’s file system. unRAID® updates the corresponding blocks on the parity disk to reflect the new data. As long as the parity disk is as large as or larger than all the other drives, unRAID® can use all the space on all its data drives for user files.
Want to dive deeper on how unRAID® parity works?
To minimize the number of I/Os for each write, unRAID calculates the new parity from the old parity, the new data and the old data, so the parity calculation takes four I/Os for any set of data drives. Calculating parity from all the data drives could take several times that many on a large array. It also means an unRAID system only needs to spin up one data drive to play a movie and just two, the data drive that’s being written to and the parity drive, to store data.
unRAID’s “user share” feature lets you create logical shares that span multiple data drives. Each file is stored on a single drive based on one of several available load balancing or spanning policies. A side effect of not striping data, although one much loved by unRAID’s users, is that in the event of multiple drive failures the files stored on the other data drives are still available.