Why DIY build a NAS?
Because it's fun, reasonably cheap, and you control your hardware so you can upgrade any component anytime you like.
Truth be told, the replacement for my old ReadyNAS NV+ was long overdue. Back in 2007 it was a highly rated product, but for me this slow, toaster-shaped NAS "thing" with its old SPARC processor and 256MB RAM just didn't cut it anymore. Today there are many off-the-shelf NAS solutions from vendors like Drobo, QNAP, Netgear ReadyNAS or Synology offering much better RAID technologies.
But I was fascinated with ZFS. ZFS is a local file system and logical volume manager originally developed by Sun Microsystems in 2001 and open-sourced a few years later. Here's an incomplete list of features:
- Focus on data integrity
- Large volume support, easy volume management
- RAID capability
- Snapshots and copy-on-write clones
There are several implementatations of ZFS, notably FreeNAS and ZFS on Linux.
FreeNAS is essentially a very mature ZFS on FreeBSD with a user-friendly GUI and some extra features. So the goal was clear: Build a NAS running ZFS on stock components.
The build is inspired by Brian Moses' excellent blog article "DIY NAS: 2015 Edition". My personal requirements were as follows:
- At least 4 SATA ports, ideally 8: My immediate need is for about 10TB of storage but I would like to be able to grow to 20-30TB over the next few years. A RAID5 array of 4x4TB gives me 12TB, so 4 SATA ports is the absolute minimum. Beyond the growth requirement I like the immediate flexibility offered by having 8 SATA ports. I have some old 1TB drives that I could combine to create a 4TB volume to add extra redundancy to the RAID array. Or I could mirror the four 1TB HDs to create a fast 2TB or 1TB volume.
- Low power consumption: All else being equal, low power consumption is always better: Obviously it means lower electricity bills. And lower heat production requires less cooling, resulting in less fan noise and also a simpler build.
- Small form factor and low fan noise: I'm not quire certain where the NAS will end up. If the performance of NAS is good it may well move to the server room in the office. If not it will stay in the home office. For the latter case I absolutely want the NAS to be small and quiet.
- Ability to run other services on the NAS: Sooner or later the NAS will have to do more than just serve files. Over time more and more services will probably be added for backup, synchronisition, data acquisition, maybe even a small web-server.
Specification & Design
If you want an 8 bay NAS there seems to be a sweet spot with the Silverstone Tek DS380B enclosure and the ASRock C2550DFI or C2750DFI motherboard. The 8 bays perfectly match the 8 SATA3 ports of the ASRock and the 4 internal (2.5'') slots can be connected to the remaining 4 SATA2 ports. Demands on computing power can be met with the 4 core (C2550DFI) or 8 core (C2750DFI) Intel Avoton processor.
A compact rundown of the some hardware choices can be found in So you want to -- build your own, "chic" NAS server.
The small form factor requirement narrows down the choice considerably. There's the Silverstone Tek DS380B with 8+4 bays and the Lian Li PC-Q25B with 5+3 bays. Both have almost identical dimensions and support Mini-ITX and Mini-DTX motherboards. The Lian Li seems to be of better build quality - judging from the reviews on youtube. The Silverstone on the other hand has more bays but is also 30$ more expensive.
|Silverstone Tek DS380B||Lian Li PC-Q25B|
|Dimensions (WxHxD)||211 x 285 x 360 mm||199 x 280 x 366 mm|
|HDD bays (hot swap)||8x||5x|
|Other HDD bays||4x (2.5'')||3x|
|HDD bay mount||Plastic tray||Sliding screws|
|Expansion slots||2x (11'' x 4.38'')||2x (320mm)|
|Front ports||2 x USB, 1 x Audio & Mic||None|
|Information||Detailed user manual||One-page installation guide|
|Price||150$ on Amazon||120$ on Amazon|
Update: Some nice shots of the DS380B can be found on a recent review on techspot.com.
The two ASRock motherboards C2550DFI and C2750DFI made the shortlist and chosing between the two isn't easy. A 100$ more buys you twice the computing power but you also get a higher power consumption. Precise data on power consumption of the board is hard to find. Techspot has an article featuring a comparison which includes the octa-core Intel Atom C2750 showing an idle consumption of 58W vs. 75W under load. According to Intel the C2750 has a TDP of 20W vs. the 17W of the C2550. Another article on servethehome shows that the C2550 processor needs about 28W under load.
|Processor||Quad Core 2.4GHz Intel Avoton Intel Atom C2550|
|SATA ports||8 x SATA3, 4 x SATA2|
|RAM||4 x 240-pin DDR 3 DIMM à 16GB max = 64GB max|
|Expansion slot||PCIe 2.0 x8|
|USB||3 x USB 2.0 (2 front, 1 rear; or 1 front, 2 rear)|
|Price||300$ on Amazon|
If you want USB3.0 you can opt for a PCIe USB 3.0 card such as the Anker USB 3.0 2-Port PCIe card (about 20$ on Amazon) or the SilverStone EC04-P (about 30$ on Amazon). The Silverstone is more expensive but has the supposedly superior NEC chipset. More importantly, the NEC chipset is reported to be well supported on Linux as opposed to Anker's VIA chip.
There's an excellent article on ATX and SFX power supplies in tomshardware.com: Power Supply 101: A Reference of Specifications.
For the Silverstonetek we need a SFX (microATX) PSU. Note that the C2550DFI has a ATX power (24-pin) socket.
First let's get an estimate of the power consumption:
|8 x HDD||26||30||36|
|12 x HDD||40||45||54|
|Total||56 / 70||70 / 85||86 / 104|
Upgrades with the ASRock C2750DFI and 6GB or 8GB drives would probably push the consumption to 130W avg/150W max. so we should chose a 250W power supply (assuming optimal efficiency of PSUs at 50% load). 250W power supplies in ATX or SFX form factor are somewhat hard to find, so I go for one of the 300W or 350W PSUs.
|FSP300-60GHS||300W||FSP||46.99 Amazon||80PLUS, review|
|SST-ST30SF||300W||Silverstonetek||55$ on Amazon||80PLUS bronze|
|SS-350SFE||350W||Seasonic||53$ on Amazon||80PLUS bronze|
|IP-P300BN1-0||300W||in-win||13$ on Amazon|
|IP-P300CN7-2||300W||in-win||53$ on Amazon||80PLUS bronze|
|SFX-350BS||350W||chieftec||cheap, hard to find||80PLUS bronze|
|be quiet! SFX Power 2 300 W||300W||bequiet||hard to find||80PLUS|
I happened to find a good deal on the Chieftek SFX 350-BS so that's the one I used.
ASRock has a qualified vendor list (QVL) for the C2550D4I on their website. Purely based on quick availability I picked the Crucial 2 x 8GB DDR3 DIMM ECC 240-PIN 1600 PC3-12800 kit (Crucial part No. CT2KIT102472BD160B).
The most recent Backblaze Hard drive reliability update of Sep. 2014 shows that it's difficult too make a prediction about new hard drives. HGST (formerly Hitachi) seems to be the most relaiable historically.
The drives on the shortlist are WD Red 40EFRX, Seagate NAS HDD 4TB and HGST Deskstar NAS (0S03664). The drives all have 6 GB/s SATA-III with 64MB cache and come with a 3 year limited warranty, 600k loads/unloads, certified for 24x7 operation. The Hitachi stands out with 7200rpm, otherwise the specs are almost indistinguishable.
|Western digital Red WD 40EFRX||Seagate NAS HDD 4TB||HGST Deskstar NAS (0S03664)|
|Price||160$ on Amazon||160$ on Amazon||165$ on Amazon|
|Speed||5400 rpm ?||5900||7200 rpm|
|Max sustaied data x-fer||150MB/s||180MB/s||?|
|Acoustics||25 / 28dB||23 / 25dB||29/?|
|Power sleep/idle/avg||0.4 / 3.3 / 4.5W||0.5 / 3.95 / 4.5W||? / 6.9 / ?|
Based on articles such as this one, "Who makes the most reliable hard drives?" I choose the Hitachi Deskstar NAS.
FreeNas will run on a USB flash drive. The recommendations on FreeNAS's website is a minimum of 8GB or 16GB. In order to have a more reliable boot disk you could use 2 mirrored USB sticks. Because of its small form factor I chose a 16GB SanDisk Cruzer Fit CZ33.
First, let's run through the finalized bill of materials:
|Enclosure||Silverstone Tek DS380B||1||150||150|
|Power supply||Chieftec SFX-350BS||1||45||45|
|Hard disks||HGST Deskstar NAS 4TB 0S03664||4||165||660|
|USB stick||SanDisk Cruzer Fit CZ33 16GB||1||9||9|
The Silverstone DS380B enclosure has a, well, cheap feel to it. The plastic trays are somewhat flimsy. In fact they need to be secured with screws. Other obervations regarding the DS380B:
- On delivery one cable was squeezed behind a fan
- The screw holes wear out very quickly
Note that the DS380 has a 20-pin USB3.0 front panel connector which is not mentioned in the manual. (See the article USB 2.0 / 3.0 Connectors & Pinouts for details on USB connectors.)
Mounting motherboard and power supply
SATA cables attached
I run a first test with two HDs attached.
HD cage mounted
Alternatives to FreeNAS
FreeNAS is by no means the only choice. There is also OpenMediaVault, NAS4Free, XPEnology, Amahi Home Server, OpenFiler and probably more. FreeNAS and NAS4Free are similar, both are based on FreeBSD and support ZFS.
ZFS on Debian
Update: After a very short time I realised that I didn't need the FreeNAS frontend much. I'm quite happy with the command line interface to ZFS. So I ditched the BSD/FreeNAS in favour of ZFS on Linux.
sudo su - wget http://archive.zfsonlinux.org/debian/pool/main/z/zfsonlinux/zfsonlinux_2~wheezy_all.deb dpkg -i zfsonlinux_2~wheezy_all.deb apt-get update apt-get install debian-zfs
The NAS has been running for almost a year without any problems, and ZFS is an absolute joy to use!
Installed webmin, a "web-based interface for system administration for Unix". There's no (production) quality zfs addin, yet, but otherwise webmin is very nice.
The NAS doesn't seem to be online anymore, and when I connect the VGA screen I see nothing. Strange. I switched off the NAS and since then it doesn't react to the power button anymore.
After taking all apart and measuring all the voltages it turns out that the +5VSB voltage of the chieftek powersupply is only 4.2V, that's way below spec. The power supply died?!
I don't have time for quarreling over questions of warranty, so I just opened the power supply to inspect further.
If you look very closely you'll see two capacitors in the middle section bulging at the top. I'm not sure what function they have, but they need to be replaced. I don't have a 1500µF cap lying around, I guess I have to go to the local electronics shop.
I'm not impressed with the build quality of the Chieftek power supply, so I ordered a replacement "be quiet! SFX Power 2" 300W power supply today.
The "be quiet! SFX Power 2" power supply finally arrived! After reassembling everything ...... moment of thruth: It powers up, boots! All data is there. Then run a
zpool scrub ....... All fine!! Nice.
I've been wanting to measure the power consumption of the NAS drive and I finally got round to doing it. Result: 70W when zpool-scrubbing zfs. That's pretty much in line with the estimate. (I currently have 5 disks in the NAS, 4 for RAID and an orphaned 4TB disk. That gives about 60W.)