My new custom NAS

Last Modified: Mon, 29 Jul 2013 00:55:16 +0000 ; Created: Mon, 29 Jul 2013 00:55:16 +0000

I built my own Linux based low-power NAS box. I had wanted something much faster than my OpenWRT Buffalo router that I was using as a NAS. I was only getting around 15 megabytes/second on my older NAS with a gigabit link.

I decided to build my own NAS versus buying one because for about the same cost I could get something that ran a stock Ubuntu Linux system which would make it easier to customize. I run some scripts that do file verification overnight and will also use it for an OpenVPN server and rsync for offsite backup server. While I saw some NAS devices that might have been able to do that they didn't has as much CPU or RAM like I wanted.

One important consideration was a box that would be very power efficient. I could have just taken some old spare parts and ran a server, but it would add $10-$15 a month to my electric bill. I also wanted something that could run 24/7 and not be noisy.

In terms of hardware I wanted something that had dual cores, 1GB+ ram, and supported USB 3.0. Ideally before disks cost it would be around $150. This is what I ended up with:

  • Biostar A68I-350 DELUXE R2.0 motherboard
    • Two USB 3.0 ports
    • Three SATA 6.0gbps ports - useful if I use internal drives later
    • Idle power usage of 5 watts, load average of 30 watts
    • Dual core 1.6GHz AMD Fusion APU 350D Dual-Core Processor
    • 2 DDR3 slots
    • 1 PCIe 4x speed (16x physical) slot
    • Mini-ITX - Small Size!!!
    • $75 on Amazon
  • MI-008 SuperCase
    • Small form factor! Would fit nicely in a TV cabinet shelf
    • Only has two drive slots, but you could cram in 1 more 3.5" if you welded a mount
    • Came with 250 watt power supply
    • Nice optical drive front panel
    • Two front USB 2.0 ports
    • Has HD and AC97 audio cables for front panel
    • $35 on Amazon
  • Corsair Vengenance 8GB PC3-12800 1600mhz 240-Pin DDR3 Dual Channel
    • Two sticks of 4GB each
    • $50 on Amazon
  • 3TB USB 3.0 External Hard Drive
    • I had this already so I just reused it
    • I could have also done an internal HDD on the SATA
    • $120 on Amazon
  • 2GB USB 2.0 Flash Drive
    • This has the OS installed on it.
    • $6 or free swag lots of times

So $165 before hard drives. The motherboard also has HDMI and VGA out, but I only needed that during the initial setup.

I installed Ubuntu 13.04 LTS 64-bit Server Edition on the 2GB USB drive and boot from that. Since the Ubuntu installer uses grub it identifies the boot drive by UUID so I can plug the drive in on any port with the boot order working just fine.

The motherboard's BIOS has a lot of options and little documentation. I initially made the mistake of enabling the thermal shutdown option (in the CPU fan section) which caused the machine to consistently power off hard. This option wasn't necessary as the system wasn't overheating and another option already would cut the power if it reached a critical level of heat. I restored the option back to the BIOS default and it worked fine afterwards.

Updating the BIOS with Windows was as easy as copying the latest BIOS to a USB, inserting the USB, powering on, and hitting F12. I was prompted to select the USB file and confirm to flash.

I configured Samba with the most secure settings for the current version (smbd Version 3.6.9) and created the necessary users and shares.

Overall the system runs very quite and the fan doesn't run at full speed always. I tested full speed by disabling fan smart control in the BIOS just to see. When disabled and the fan always at 100% it is quite loud, but when you leave the fan smart control enabled (I usd Auto) it is very quite.

Performance wise from a Windows 7 machine to the NAS over sftp I only got about 15 megabytes/second with one core of the NAS at 100%. I used FileZilla which may have been a bottleneck as well. I didn't do any optimization of the encryption algorithm for sftp so I'm betting that could be made faster.

Samba performance:

Windows 7 64-bit (fully patched) to the NAS was my setup. I ran the benchmark once so the 4GB file would be cached into memory on the NAS. This test was to verify that my NAS would max out the gigabit connection. I performed a dd on the 3TB drive on the NAS to verify that USB 3.0 performance was meeting the maximum speed of the drive which it did.

  • Read - 112 megabytes / second (4GB file)
  • Write - 76 megabytes / second (4GB file)
    • The 3TB drive was almost full and the bottleneck for writes was it

I'm very happy with the performance, power usage, and price. I can also run integrity checks of all the drive data at night or perform other tasks such as compression to archive files. The NAS makes a great backup device and utilizes the speed of my wired gigabit connection.