Why a NAS and Which One

Why storing data on a dedicated device and available alternatives

This article is part of a series focused on the building and setup of a home-NAS based on ZFS and OmniOS. The index is located here: An OmniOS ZFS Fileserver.

Introduction About ZFS

Last year in September ZEVO was released, making finally a reasonably recent (v28) version of ZFS available under Mac OS X. Another option was maczfs, already available, but it used a very old on-disk format (v15). Since ZFS guarantees an extremely high safety for the data, and since magnetic media is not so reliable anymore, I decided to install it and to use as primary data storage. Technically, using a new product as main data storage is a very bad idea, but I was lucky.

The main advantage of ZFS is the ability to detect "silent corruption": sometimes the disk spins beautifully, SMART readings are ok and the user thinks everything is fine, but the magnetic surface slowly degrades and gives back corrupted data. Since "normal" filesystems (FAT, NTFS, ext, ...) always assume that data read from disk is exactly as it had been written and therefore they don't check (= cannot check) its integrity, the file gets corrupted. Have you ever heard "clicks and pops" on MP3s downloaded from the Internet? I did and I didn't know what it was causing it, I thought maybe a defective CD used for ripping. After listening to MP3s recovered from a dying hard disk, now I know. Another example: HFS failure. And while a corrupted MP3 can be ripped again (yeah... or downloaded again) but my pictures, documents and in general my data cannot, I wanted to be sure data are safe. Therefore, ZFS.

ZFS has also some other advantages, such as being able to expand the available space easily: put some more disks in the machine, attach them to the previous ones, and the free space increases immediately. And performances too!

There is an alternative filesystem able to check the consistency of data: Btrfs and it is available on linux. However, it is very young and it hasn't gone through the years of testing that only huge datacenters perform, so it was out. Only mature products for my data.

Why a NAS in My Situation

Last year my configuration was getting more and more cumbersome, with an old iMac (mid-2007, bought in 2008) with 320 GB internal HDD and a bunch of external hard disks: two 500 GB for data and one 1 TB USB2 disk for backups. Another 1 TB disk was used for off-site backup, to protect the data from theft of the hardware. Each disk required its own power adapter! and performances of USB2 disks were, as usual, poor, maxing at about 35 MB/s.
The situation was critical and when I felt the need of an expansion (3 TB), I decided to organize everything around a dedicated device: a NAS. NASes are usually limited to gigabit performances (110 MB/s), but I consider it more than enough.

Other choices are possible, for example a DAS, but I preferred a device I can reach from the local network without having my iMac always on. Moreover, choosing a NAS allowed me to offload the handling of ZFS operations to a dedicated machine, freeing on the iMac a huge amount of RAM for the applications.

Overview of the Alternatives

Different ready-made NAS systems are available and many more configurations are possible if a normal computer is converted using dedicated operating systems. The main systems I evaluated are the following ones:

Synology
The models DS4xx and DS2xx are very, very good products because they offer a compact and silent device with an excellent operating system and an optimal user interface (this is what I usually suggest to friends), but they are Linux-based and therefore no ZFS is offered. Too bad, they would use only 6 W power in addition to the hard disks! Furthermore, these simple models lack the processing power to saturate the gigabit connection and to convert on-the-fly video files (i.e. downsampling for mobile devices). More powerful versions are available (DS5xx or DS7xx) but they are too expensive and still lack ZFS.
NAS4Free
This FreeBSD-based distribution (formerly known as FreeNAS 0.7, it's NOT the same as FreeNAS 8.x) is very good and I'm using it on another NAS, but is difficult to customize because it's stripped down to work on limited machines: it works even on Pentium 2 machines! If a computer is laying around, this is the cheapest alternative (energy costs come later).
FreeNAS 8.x
This is very similar to NAS4Free, it is just tuned to more powerful machines (more enterprise-like). It's a younger distribution than NAS4Free and it uses an older FreeBSD kernel (this makes sense for businesses) and it's backed by a company: it's not community driven.
NexentaStor CE
This distribution based on illumos uses GNU tools and is already tuned for NAS applications. It is limited to 18 TB total, unless a yearly license is paid. It provides a very good interface.
OpenIndiana
This distro, nowadays not very actively developed (so I understood) is meant for both desktops and servers and is generic, no special interfaces are provided to simplify setup.
OmniOS
This product is also illumos-based, but it is meant for servers only, no graphical packages are provided, not even X11. It is backed by a company that can lead the developers and it shows an active release cycle, with weekly patches (if needed) and a new major release every six months. Basically, a reboot is needed only every six months.

In my case I tested on virtual machines NAS4Free, NexentaStor and OpenIndiana.
NAS4Free is well done, but it does only one thing: NAS. I wanted a more open solution, where I can install different tools, so I had to discard it (it work beautifully on my parents' NAS at home, using an old Athlon 64 X2).
NexentaStor (maybe due to poor VM emulation) appeared significantly slow and with high processor usage also while idling, so I discarded it. I also didn't want a system that forced me to pay royalties in case (well, improbable case) I needed more than 18 TB data. And I preferred a generic system, not focused on only one function.
I therefore tried OpenIndiana and then I replaced it with OmniOS as soon as I discovered it :) Faster release cycle, a company behind that leads, ... Sold.

Of course I needed a server to run OmniOS: OmniOS: The Hardware.

How to Choose a Configuration for the disks

As written, ZFS can detect data corruption, but it needs a place where sane data is still available, therefore a RAID is required. ZFS works only with software RAID, no expensive hardware RAID controllers are required, and offers normal RAID1, RAID0, RAIDZ1, RAIDZ2, RAIDZ3. As suggested by Constantin Gonzales, at home RAID10 is the best because it is easy to expand and simplifies recovery: one disk went down? turn off the machine as soon as you can, replace the drive, turn on, tell ZFS that the disk has been replaced, then forget about it, data are already fine.

Since I had 2x 3 TB disks and I didn't plan to produce a lot more data soon, RAID1 was the initial choice and it has been expanded to RAID10 as soon as I needed two more disks. I hope 6 TB will suffice for a long time.

If I knew I would have needed a lot more space, I would have used 6x (or more) 3 TB drives in RAIDZ2.

Backups

RAID has nothing to do with backups: RAID is to protect the data from hardware issues, backups protect you from your mistakes and from any other generic problem (virus, theft, ...). I will use all my old external disks to backup the new beast and to keep multiple backups around, so that a fire, a flood, an alien attack on my main house cannot damage the data.

Online backups too? Sure, but not for a lot of data: uploading 3 TB over ADSL is not feasible.

Optical media (DVD)? As backup, maybe, as storage, never: too cumbersome and too bulky! At least 120 DVDs are required to store 1 TB. And they are read-only.

Is It Worth the Effort?

I don't know. To me, yes, to other people, maybe.
I don't have many films or music downloaded from the Internet: a lot of my data is original, therefore if it is lost, it's lost.

Everyone with children or producing a lot of original data should think about it. At least a cheap Synology DS2xx with a RAID1 setup is better than nothing.

Useful Links

Author: Olaf Marzocchi

First revision: 2013-04-20.
Last revision: 2013-11-09.