I am building myself a sparkling new DIY NAS server which stands for a Do it Yourself NAS. I was very satisfied with my previous NAS servers the Synology DS219 and the QNAP TS259-Pro. They have a fine performance and are very customizable with the qpkg and ipkg support they have.
But I need more space and I really wanted to build a NAS server myself. A knew I would have to do without the great web gui’s both Synology and QNAP provide but I don’t mind much as I am a system administrator who knows the way on the commandline. Another benefit for me is that I would gain even more flexibility with what I wanted to do with the NAS.
I wanted a silent case with at least 6 * 3.5″ bays. Also a Mini-ITX mainboard needed to fit. It was a close call between the Fractal Design Array R2 Mini ITX NAS Case and the Lian Li PC-Q08B.
Because of a lower price and better reviews the “Lian Li PC-Q08B” is an excellent choice. It is very quiet and a nice case to see.
I needed a motherboard with at least 6 SATA-300 or 600 connectors and also which was Mini-ITX. So I want for the Zotac H67ITX-C-E which has the following specs: 1155, H67 , Mini-ITX, 2x DDR3, mini-PCIe, PCI-e, 4x SATA-300, 2x SATA-600, 0, RAID +1, 1, 5, 10, 1Gbps, 802.11n, eSATA, 8x USB 2.0, 4x USB 3.0, DP, DVI-I, HDMI, 8.1.
Please note that this motherboard does not support the new IvyBridge Intel processors but only the SandyBridge processors. This is not very clear as it most sites it says it supports Intel i3, i5 and i7 processors without further specification!
I wanted a powerful processor as I may also want to run virtual machines on this NAS server for various little projects. If you only wish to run a NAS plus some other light tasks you may as well go for a i3 or i5 processor. But as stated I want a powerful processor and the price difference between for instance the i5-2500k and the I7-2600 3.40GHZ Quad-core was limited and the i7-2600 has better virtualization support.
As I wanted to be able to run more than 1 virtual machine I went for 8 GB of memory. I went for the Corsair XMS3 8GB(2x4GB) DDR3 1333MHz CL9. Which is not too expensive and will work fine with my Zotac motherboard.
I want my NAS to be as silent as possible so no stock cooler for me but the “Scythe Big Shuriken 2 Rev. B”! A large CPU fan that is very quiet. Please note however that the combination of this CPU cooler and the Zotac motherboard will make sure you cannot use the PCI-e slot anymore. Not a problem for me as the onboard GPU is enough for me.
Once again quiet is of importance with the power supply. And this Cooler Master Silent Pro M500 500W is very quiet. And it’s modulair setup is quite handy as you only need to have those cables that you really need.
Well the most expensive part of the NAS are the harddrives but also the most important. I have choosen the Western Digital Caviar Green WD20EARX 2TB drives. As I wanted 6 drives the 2.5TB drives where just a bit overpriced but I did need more space and wanted a RAID6 setup so I did need those 2 TB drives.
I bought 6 of these. 5 for the RAID6 setup and one for installing the operating system on. Please note that for the operating system you don’t really need 2 TB. You can buy a smaller drive, or perhaps you already own a drive you would like to use. You can even use a SSD drive for the operating system.
I wanted to install linux on this NAS server and as I already have many years of experience with Ubuntu and I really like Ubuntu I installed Ubuntu Server 12.04 LTS on this system.
After installing Ubuntu on this system you need to make sure your drives are ready for the RAID6 volume.
In my case sdb,sdc,sdd,sde,sdf needed to be partitioned and given the proper system id: fd Linux raid autodetect
Next up is creating the RAID6 volume:
mdadm –verbose –create /dev/md0 –level 6 –chunk 64 –raid-devices 5 /dev/sd[b-f]1
With /dev/sd[b-f]1 I select all drives between /dev/sdb and sdf at once. And a chunk size of 64 seems to be the optimal chunk size for a large RAID6 volume.
Building your newly created md0 array can take up to multiple hours.You can tune the following system options if you create a raid volume for the first time:
echo 200000 > /proc/sys/dev/raid/speed_limit_min
echo 16384 >/sys/block/md0/md/stripe_cache_size
These two commands must really speed up your first sync of the raid array. But they may not be the optimal settings once you are using your NAS as they might push your NAS Server to limit.
you may view the progress of creating the array.
Next up create a filesystem on the newly created array:
mkfs.ext4 -b 4096 -E stride=16,stripe-width=48 /dev/md0
Now you are good to go and start using your array and your NAS server! But ofcourse you need to install and configure things like Samba, NFS or iscsi if you want to use them!