When we last left off, I found Christmas joy in a big honking bag of hard drives and an external SATA enclosure. But my joy was not complete without a measure of redundancy and recoverability.
The controller that shipped with the enclosure did not support RAID 5 in firmware and the embedded controller on my motherboard could not be used with a SATA port multiplier.
Oh, the agony of being so close… and yet so far.
Then I discovered FreeNAS (www.freenas.org). Some kind soul put together a FreeBSD distribution that would handle RAID 5 in software. But am I going to blow away my beloved Windows 7 box and dedicate it to NAS? Hell no. But I am going to download VirtualBox and run it as a virtual machine.
More agony: I find myself willingly running an Oracle product. I’ll get over it. Somehow.
So here’s what I did:
On each of the five 2 TB hard drives, I created two 900 GB “virtual hard drives” using the VBoxManage utility. I then created a virtual machine in VirtualBox. I figured this way I’d only lose 900 GB to parity instead of 2 TB.
I then downloaded the FreeNAS VMWare images (VMDK files).
I created a FreeNAS virtual machine, attached the FreeNAS VMWare images, and the 10 virtual hard drives. Configured FreeNAS to use the 10 hard drives, set up a RAID 5 stripe using all 10, then made the RAID 5 stripe available as a CIFS share accessable by the host operating system.
This sounds like a simple, quick process… but it wasn’t. Creating each of the virtual hard drives took hours and hours. Configuring the RAID 5 array was simple and quick… but waiting for the array to be ready took about 24 hours.
Needless to say, there was a lot of starting processes either before work or after I got home, then waiting breathlessly for the end of the day or the morning to see if it completed.
The good news: the processes eventually finished without error.
The bad news: there is a memory leak in VirtualBox. I configured the VM to use 1024 MB of RAM. Windows Task Manager reports that the VirtualBox.exe process is using about 4 GB of RAM. Good thing I have 8 GB of RAM in the box or this thing would be useless..
In all honesty, this is one compromise after another. The original idea was to build a small Linux box and install the hard drives into it and present them as a CIFS share or iSCSI target. That’s probably what I’m going to wind up doing. Somewhere down the road I’ll get a new case/power supply/mobo and RAM and make sure the mobo’s embedded controller can handle RAID 5 in silicon.
This time, I’ll just install FreeNAS directly on the hardware without any virtualization (and lose the need to run Oracle software). The VirtualBox memory leak becomes a non-issue.
The FreeNAS web portal is very easy to use… so I probably won’t even bother with a monitor or keyboard for the box, just something big enough to hold the hard drives. Yeah, I’ll have an extra SATA enclosure laying around, but it’ll just join the rest of my experiments in the Closet of Dead Technology. I’m sure I’ll eventually find a use for it.