Smooth like Btrfs…

If you have any spare hard drives lying around and you’re a data squirrel like me, you’ve looked at the Drobo or Windows Home Server (WHS) with envy.  Drobo implements a file system  called BeyondFS, which lets you add and swap hard drives at will; the system will reconfigure itself depending in the space available and the number of hard disks installed, implementing mirroring when it can without regard to the actual size of the hard disks installed.  WHS can do the same, on a file level. While these are sweet high-tech toys, they are not free. Even after moving here and recycling dumping the worst of my old hardware, I have plenty left just lying around.  And I hoard data faster than I can hoard money.  Is there a way to build a Drobo with old hardware and free software?

I’ve looked at many solutions such as  unRaid and Freenas,  but they need dedicated servers and I wanted to run on my old Ubuntu server, since it also runs my VMs. I’ve also looked at Btrfs, believing that being a freshly minted file system it would support a logical volume manager internally (or at least intelligently manage volumes of different sizes). But it doesn’t; the current load balancer is very basic. It supports Raid0, Raid1 and Raid10. And for the moment, at least (as of 2.6.35), it is limited by the smallest volume in the Raid array (so you get the same capacity as in Raid1 mirroring, I find Raid5 more appealing).  In the process I’ve discovered that VMWare really doesn’t like running on top of Btrfs – suspending my VMs would leave them in an unrecoverable state with no helpful error message or log entry.

In the end, I went with LVM on top of Raid5.  Although it is not as easy to understand and configure as a Drobo or WHS, I can add and remove hard disks at will (provided I leave enough for the Raid5) and grow or shrink the file system even while it is live. And I can run VMWare on that Ubuntu server without a hitch.

As far as I can tell the only other free option would be to use ZFS, but that would mean switching to FreeBSD (and VirtualBox for my VMs).  I guess I could take another old box out of storage and muck around.  However as far as I can tell – correct me if I’m wrong! – once you define a ZFS array you cannot yet add devices, only replace disks with bigger disks, which is not as flexible as I want. So I’m not ready to invest too much time in the attempt.

Now, LVM+Raid5 isn’t as simple to configure and use as a Drobo or WHS, but it works, has decent performance, and is totally free. You might have some trouble getting all the commands right the first time you define it and you’ll wish it had a working GUI, but once I got the configuration right, it worked like a charm.  Even adding a device and growing the volume, while a multi-step process, proved easy enough.  Best of all, since LVM takes charge of load balancing on the array, you can add and remove disks WHILE it is in use. Unfortunately, there is still one thing that it doesn’t do; manage different-sized disks without waste.  Installed on top of a raid 5 array, the usage of any disk is limited to the smallest partition in the array (to get the final capacity, just ignore one of your partitions when adding up). However you can add as many partitions as you like to grow the array (Taking care not to use two partitions on the same disk).

Thus I ended up with a LVM on RAID5 array,  almost easily expanded to infinity and with some data safety. When Btrfs implements Raid5 (possibly in 2.6.39) and you can do an on-line re-balance, it will be worth another look, as you would not need LVM. The file system would grow without a problem as long as you do add one volume at a time.

All this exploration has left me feeling that there’s a need for a file system that is space-conscious and redundant (for select files).  Would it be possible to use WrapFS to do this?  Is anyone aware of a project or file system that already does this?

So for now it looks like I can’t make a DIY Drobo, but at least I got to experience the magic of LVM.