12TB NAS - Software part 1

Choosing the OS

Written on 09/12/2012 by Patrick Bregman


Last two posts were about the hardware parts of my 12TB NAS, this post will focus more on the software side of things. In this first part I will discuss the operating system (OS) that's going to run my NAS. I have only one requirement for my NAS, and that is that the OS supports ZFS.

What is ZFS?

ZFS is short for "Zettabyte File System". ZFS is a filesystem that includes a lot of features to ensure your data is not corrupted, and tries to always give you the original data instead of a corrupted version. If it can't give you a correct version, it gives an error instead of returning corrupted data. One of the ways to do this is something similar to RAID1, RAID5 or RAID6. RAID1 means that the data is mirrored across two disks, while RAID5 and RAID6 do this by calculating parity data. In ZFS these options are named differently, because they are not exactly the same. The RAID1 way is called "mirrored", while RAID5 and RAID6 are referred to as "RAIDZ1" and "RAIDZ2".

Besides those options for making sure your data is always intact, ZFS also has a few other tricks up it's sleeve. For example, encrypting data before it hits the disk, deduplicating data to save space and more. For a full list of features and more information, visit the Wikipedia page. Basically, I want ZFS because it allows easy management of datapools like my NAS, and has the capability to grow a LOT.

The OS

Now that I explained a bit about what my only real requirement is, let's look at the operating systems that support this new filesystem. A bit of Googling gave me the following options:

  • Solaris/OpenSolaris/Nexenta/illumos - These are all Solaris based
  • FreeBSD
  • Linux
  • Mac OS X

Let's take a closer look at those options and see what they offer.

Solaris and derivates

Solaris is a UNIX system originally made by Sun, and is now owned by Oracle. ZFS originated in Solaris, and gets the new versions first. This means that if you care a lot about being on the bleeding edge of ZFS development, your only choice is Solaris. The opensource variants (OpenSolaris, Nexenta, illumos etc.) do NOT have the latest version of ZFS, but do offer the complete Solaris experience.

FreeBSD

FreeBSD is a UNIX system which is a descendant from the old AT&T UNIX. This means that it is basically a complete UNIX system, but due to licensing it isn't allowed to be branded like this. This has the same issue as the opensource variants of Solaris, it only gets whatever ZFS version Oracle decides to offer under an opensource license. Simply said, it will not have the latest and greatest ZFS version.

A special case of FreeBSD is Debian GNU/kFreeBSD. This is the normal Debian GNU distribution, much like the Debian GNU/Linux release, but this time with a FreeBSD kernel instead of a Linux one. This means that you get all the GNU tools that are also available for Linux, but the core is FreeBSD, so you can do ZFS on something that basically feels like Linux.

Linux

Well, I'm going to assume that you've at least heard of Linux once or twice and probably know a bit about it. The downside of Linux is that it does not offer ZFS in the kernel, so you have to do it in userspace. For the people who haven't played with FUSE before, this is slow. The reason for this is that the system has to constantly switch from kernel mode to user mode to write data to disk. On other operating systems ZFS is run in kernel mode, which means that all disk access is much faster. So while this should be usable, it isn't the fastest.

Mac OS X

Probably the OS you didn't really expect in this list. There are actually kernel mode drivers for ZFS for this OS, and the origin of those is actually Apple. While this OS would be pretty neat to have running on the NAS, I highly doubt it would be practical. I would need to run OS X Server to be able to manage it remotely, and probably also to use it as a Time Machine. And, very important, it officially doesn't run on the hardware.

The decision

After toying around and trying a few things, I ran a few virtual machines in VirtualBox. I didn't try any Solaris variants because I do not really feel the need for it, and it doesn't have any advantage over FreeBSD as far as I'm concerned. Mac OS X also wasn't tested, because it officially doesn't work and I don't feel like hacking together something that is supposed to serve as a backup system. Linux was tested, but I noticed a serious slowdown compared to FreeBSD and Debian GNU/kFreeBSD, so that was also dropped. In the end, performance between FreeBSD and Debian GNU/kFreeBSD was almost equal in my experience.

Because of this I decided to go with Debian, with the primary reason being that I want a reasonable package management system. Aptitude fits this bill better than the FreeBSD ports system for me, if only because I can't seem to get the binary ports to work, and I don't really feel like compiling everything myself on a server that's supposed to just work. I know Debian is still in development and not everything is 100% working, but I have good hopes that stuff like that will be fixed soon enough. The basics are there and they are stable as far as I'm concerned.

If you want to know anything about this project, or have specific questions about this build don't be afraid to throw them in the comments. And if I think that a reply is too short, I probably will dedicate an entire blogpost to it :)


blog comments powered by Disqus