« Automation Failure | Main | More Shopping Reviews »

January 11, 2010

My ZFS Server

When I first discovered ZFS, I thought it was a very impressive technology and was eagerly anticipating it maturing and becoming mainstream. Some of the big improvements involve removing a lot of troubling barriers we've all experienced in the past. Partitioning, large files, large disks, errors, RAID, compression, sharing, backups, etc. all changed and made much easier to deal with. Some others that are more key for me, but more subtle include the end-to-end check summing, transparent duplication of blocks and variety of RAID schemes.

For a while now I've been looking to improve my backups of my personal computers at home. I juggled a few ideas but nothing until gelled until I discovered Intel's Atom processor was available cheaply with 64bit support and ZFS had matured and was readily available. The pieces then came together, I snagged an Atom 330 board, a Mini-ITX chassis capable of holding four full sized disks, plus a slim optical drive and a small sized (2.5") drive internally. I added in a Solid State Disk (SSD) for the OS disk that fit in the 2.5" slot and added two 1TB disks for the bulk storage. Back to the 64bit issue, while ZFS runs on 32bit hardware, it's really designed for 64bit and from the reports I've read, it runs faster and more stably on 64bit hardware. The other crucial piece was the operating system.

I had been looking at a few options for operating systems, OpenSolaris, Solaris, Nexenta and FreeBSD all support ZFS. Nexenta looked pretty good, it was a prepacked file serving appliance, but the community was small and the project seemed a bit odd, combining the OpenSolaris kernel with GNU userland. FreeBSD was my first choice, but by version 7.x the ZFS support was tagged experimental and the potential issues looked scary. I've used Solaris quite a bit in the past, but I asked around and OpenSolaris seemed like the better choice.

I installed OpenSolaris and was some what impressed at first, but that quickly wore off. The first issue, a bug that prevented the kernel from detecting my CPU as 64bit capable and no way to force a 64bit kernel to boot. Next the driver for the ethernet card was malfunctioning. I tried many things to fix both but made little to no head way. So I gave Solaris a try, remembering how rock solid it was. Well, Solaris is still very unimpressive on x86 hardware, I had forgotten. The installer is weak compared to OpenSolaris and left a lot to be desired. The issues stacked up faster on Solaris than I could log them and I quickly gave up with nothing really working. I think I pretty much gave up at this point especially with a new release of OpenSolaris due shortly. The new release (2009.06) came and voila, it fixed all the previous issues. Here's where ZFS shone for a bit. When I initially installed OpenSolaris on this box I had setup a ZFS mirrored pool on my two 1TB disks. Through the subsequent two installations I had done nothing with those disks, but kept them online. With a quick ZFS command, the file systems on the disks including the mirror was instantly recovered and back online and perfectly intact. While this install of OpenSolaris was working pretty well, it was a struggle at every point to get stuff working. Some of it I got to work, others I didn't and some OS stuff had bugs that just prevented things from working normally. After months of working to get it up to snuff, it was on the back burner again. This time awaiting a new release of FreeBSD.

FreeBSD 8.0 was released with stable ZFS support and I jumped ship. Although I first had to determine if it supported the TRIM command for SSD, (It doesn't yet, looks like a 9.x feature) so I could pick the right firmware for my SSD. It supports either a garbage collection clean up method or TRIM, but not both at the same time. Whoops, I skipped a step, I wanted to keep all that data I've loaded onto the machine already. ZFS to the rescue? Nope. Here's one downside that is often overlooked. ZFS pools and file systems can be upgraded, but never downgraded. OpenSolaris runs a slightly newer ZFS stack than FreeBSD, meaning FreeBSD wouldn't be able to read the ZFS on my disks. Nor could I use features like a ZFS export as it is also version dependent. So I plugged in an external disk and copied away the old fashioned way. Here's where I discovered how slow and CPU intensive USB is. But now back to FreeBSD. The install went very smoothly. Adding the extra software and functions I wanted also went smooth and quick. There were two things where OpenSolaris out shone FreeBSD. First, FreeBSD hasn't integrated iSCSI target or SMB sharing into ZFS yet, but there are two ports that do iSCSI and I used istgt and samba for SMB which work just fine but have to be configured separately. Second, one of OpenSolaris's big features is TimeSlider which maintains an ongoing periodic backup. There is no analog in FreeBSD so I just used a script to replicate what TimeSlider does, periodic ZFS snapshots. Since this is really what I wanted anyway, point in time backup of the file system. So, in less than two days I got my FreeBSD install all configured and up and running, including everything I wanted from backups of my computers to storing my mp3 files and distributing videos, photos and music to my TiVo.


Post A Comment

Remember me?

Created By: Steven Nikkel (steven_nikkel@ertyu.org)
This webpage and others materials are Copyright © 1997-2016 Steven Nikkel, All Rights Reserved