My first NAS (or “network attached storage” for those of you who aren’t aware of the acronym) was a Synology Diskstation. It had a single 1TB drive (ie: no redundancy) and offered typical off the shelf software, offering basic file storage and pretty much nothing else. It was slow, difficult to use, sounded like a jet engine whenever it spun up the drive, and with such a small storage volume I soon outgrew it.
From there, in September 2014, I build a custom NAS using PC grade hardware. With an Intel i5 2500K and an enterprise grade Areca RAID controller, it was fairly powerful, capable of serving data from its four 4TB WD Red drives at a decent speed (~100MB/s). However, although the RAID 5 setup offered decent data protection, the write speeds to the array regularly dropped to ~10MB/s, meaning copying even only a few gigabytes of files to the array was horrendously time consuming! What’s more, over time the Windows Server OS became more and more unstable, crashing on a daily basis – it was time for an upgrade.
Enter, Zeus, my newest NAS.
My main focus was data storage, I didn’t want to compromise on data integrity, so a RAID setup of some sort was an absolute must. My previous NAS acted as a backup server for 2 laptops and a PC, along with file storage for at least 3TB of documents, videos, and pictures, totalling almost 7TB of data.
However, data storage isn’t the only thing I want to use this box for. Previously I posted about moving my web server to DigitalOcean, and I wanted to move away from GitHub (more on that in another post), so I wanted to move most of my development to this box too. I also wanted a more centralised backup option than TimeMachine (Mac) and good ol’ copy-paste for Windows. Finally, I wanted to move away from using Parallels on my Mac for access to a Windows machine (yes, I could turn on my main PC – but crucially I’m pretty lazy).
I considered a whole host of OS options but finally settled on UnRAID 6 for a number of reasons.
UnRAID runs a software RAID 5-like filesystem that can be expanded simply by adding data disks. It then manages all the necessary parity calculations internally, writing them to the parity disk. This allows the array to lose any disk (as with a RAID5 system) and continue functioning. It also solves the slow write problem of the old NAS by allowing for the addition of a read/write cache disk (or pool of them). In my system I chose a 120GB SSD initially, and can easily increase that later. Finally, UnRAID manages the setup of SMB shares (along with other protocols), allowing for user level authentication all in one interface.
UnRAID acts as a virtualisation host for both Xen and KVM instances (in other words true hardware virtualisation and software virtualisation). On top of this, UnRaid has Docker built in, allowing for the deployment of a wide range of pre-built images for a huge range of tasks in (usually) 1 click. Both of these facts allow UnRAID to be a versatile server OS, expanding to the needs of the user.
UnRAID also has support for a huge range of custom plugins, such as environmental sensors, real-time hardware statistics, custom sleep cycles, and more. While these (probably) had much more use before Docker was integrated, plugins still have their place and offer a good range of options if a Docker container isn’t available. One example of this is the ability to run a native OpenVPN instance within UnRAID, allowing for secure instant access to the management console without needing public access.
In terms of hardware, I went quite over the top for my current needs (as of yet I haven’t gone over 10% CPU utilisation) but that certainly gives me room for expansion. I decided to go for a rackmount build, but in a short chassis. This allows me to rackmount the case later in a network cabinet (because of the 450mm case depth) whilst also keeping the build compact enough to sit on (or under) a desk. The short depth chassis did however limit the size of motherboard available.
As I had already decided to go with server grade hardware, I already knew the costs were going to be higher than consumer alternatives, but I also knew that the kind of hardware available was much better suited to my purpose.
In the end I went for the following hardware:
- Chassis: Logic Case SC-43480B 4U Rackmount Case
- CPU: 2x Intel Xeon 2670
- Motherboard: Asus Z9PA-D8C
- RAM: 32GB Samsung 1333Mhz ECC (4x8GB)
- Power: EVGA SuperNova Gold 750G2 750W power supply
- HBA: Supermicro AOC-SASLP-MV8 dual SAS HBA
- Hard Drives: 4x 4TB WD Red (3 data, 1 parity, 12TB effective storage)
- Cache Disk: 120GB OCZ Agility 3
Why so much hardware for a NAS?
As I said, I went a little over the top on the hardware, but I did it so I don’t need to upgrade in 18 months time again (I’ve done that once already). The two processors manage a PassMark score of 18,000 in total over 32 logical cores, almost 5 times as powerful and 8 times as many cores as my previous NAS. The Asus board allows for up to 256GB of ECC RAM, so I also have plenty of room for expansion later (with even 8GB sticks allowing up to 64GB of RAM in the 8 slots total).
I chose a rackmount case because, surprisingly, I want to rackmount this NAS at some point. I also have a HP ProCurve 24 port gigabit switch that I want to mount alongside this machine, but I’ll discuss that at a later point. The case I chose isn’t the prettiest server case, but it allows for ATX boards (pretty much a requirement for dual socket boards) whilst also allowing for up to 15x 3.5″ hard drives thanks to 3x 5-bay drive cages.
The ASUS board also comes with some nice features. Firstly, the two sockets are inline, meaning that my front (in relation to the chassis) CPU cooler can actually push air through the rear socket. This means that I actually get a ~5°C cooling bonus on that CPU. Secondly, the board comes with dual gigabit LAN ports, which UnRAID can bond to form a teamed theoretical 2 gigabit link. If that isn’t enough, then the board also comes with a variety of PCI gen 3 slots ranging from 4x all the way up to 16x – easily enough to handle an expansion card with multiple gigabit or even 10 gigabit ports. Furthermore, the rear IO contains dual USB3 ports (although there is no internal header) and it even features an internal USB port – great for running UnRAID from!
To HBA or not to HBA?
While the ASUS Z9PA-D8C does have 6 internal SATA ports, only 2 of these function at SATA3 (6Gbps) speeds. This means (assuming the cache drive is on a SATA3 port) only 1 of my WD Red drives would be on a SATA3 port. For that reason, I opted to get a HBA. The AOC-SASLP-MV8 has good reviews in the UnRAID community, offering dual SAS 8087 ports, allowing for up to 8 SATA devices to run at 6Gbps through a PCI x8 lane.
UnRAID is an incredibly capable OS, and has fulfilled my storage needs and more. Over the coming months I’ll be increasing the number of VM’s and services I run from this server, but thus far it has exceeded my expectations. Share setup is a breeze, as is adding new drives. The Docker integration is great, and has allowed me to quickly bring services online with minimal manual installation. I’d definitely recommend UnRAID to anyone looking to self-build a NAS.