unRAID But Not Unprotected
January 07, 2010
One of the things I like best about this job is discovering hand-crafted software that elegantly solves the problem its designer had in mind, while putting a new twist on familiar technology. Looking for a reliable and yet expandable place to store the media for his home theatre PCs, Lime Technology's Tom Mortensen came up with unRAID, an innovation that lets users build parity-protected data stores from drives of different sizes and add capacity on the fly.
Like a RAID-4 array, an unRAID is made up of a group of data drives and a dedicated parity drive. Rather than stripe data across the data drives as a RAID-4 array would, unRAID writes an independent RFS 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.
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 shares create a CIFS share that exists on 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. This means that you can still watch seasons 1-24 of Dr. Who when the drive with the last few seasons crashes.
Not striping data does limit unRAID's performance, but you should remember that unRAID isn't supposed to be a general purpose replacement for standard RAID based NASes. It just has to be fast enough to deliver an HD video stream to a HTPC (Home Theater PC) and save data as fast as a Blu-Ray drive can rip it. Read performance is limited to the speed of a single drive and writes are normally somewhat slower. Users can dedicate a cache drive to hold new data until a scheduled process copies it to the unRAID. With a cache disk write performance is about that of the cache drive.