Sunday, 31 August 2014

Upgrading unRaid cache to btrfs

Having upgraded to unRaid 6 beta7, I've started having a look into the new Docker support. In unRaid, Docker needs to be installed on a btrfs volume or pool. Btrfs is a new filesystem to unRaid and supports 'copy on write' which enables Docker utilise minimal hard drive space. (see the Docker intro thread on unRaid forms for full details.)

My existing cache drive was a seagate 500GB and contained all my VM images and config files in a 'domains' directory. I copied these files off to a backup drive and set to work.

It was a good thing I made a backup as it soon became apparent that it would be very easy to make mistakes and wipe a lot of data!
unRaid now provides a means to assign multiple drives to the cache position. With my pro licence, I have 24 assignable drives. I can elect to assign say 20 to my data drive slots and 4 to cache (or any combination). With my cache drive still installed, I set up 4 slots on my cache and restarted.

On restart, I noticed that my cache drive was inaccessible. Having a look at the unRaid GUI, I noted that the cache drive was showing up as unformatted and the filesystem had been changed automatically to Btrfs. If I'd clicked the 'format' button at this point, I'm sure I would have lost the entire contents of my cache drive (had I not backed up). I went in and changed my cache allocation to 1 drive and re-set the filesystem to reiserfs. Restarting the server revealed my cache drive and files back to normal.

It's interesting, (though not necessarily unexpected), that unRaid behaves like this and reinforces the requirement to backup everything before playing around with new features.

With a better understanding of how the new features work, I set my cache slots to 2 and pulled the seagate cache drive, replacing it with 2x 500GB Hitachis. On restart, the first showed up unformatted so I went ahead and hit the format button and a couple of minutes later I had a 1TB Btrfs pool as cache.

btrfs pool as cache

I copied my 'domains' directory back to this drive and fired up my Xen VMs. Everything worked as it had before.

It's was a  little confusing initially in that it seems only one of the drives allocated to the cache position is manageable/editable. In the main GUI, it appears as if only one of the two drives is in action but on clicking through to the settings screen of the first cache drive, it's clear that there are multiple drives assigned and in use;

Now I'm all set to start playing with Docker containers.


Anonymous said...

have you done any performance readings on the unraid in comparison to local disk or other storage options?

Peter Mee said...

Some time ago I did a detailed comprison of local and network read/write in Winws 8 storage spaces against my then unRaid v5 setup (which was very slow).

Since moving to new hardware, unraid read/write speeds have increased significantly, though I haven't conduced a comparative analysis, I'm getting average parity check speeds of ~75 Mb/s, peaking at 120 Mb/s.

I might do a follow up blog post on this soon.

Peter Mee said...

The link to that original comparison is here;