Sunday, January 6, 2013

Home NAS

I've officially exceeded 500 titles on my HTPC and recently had a scare in which one of the drives in the LVM array started exhibiting errors. I decided it was time to separate the disk from the front-end and put some redundancy in-place. I checked out some of the turn-key solutions like Synology and QNAP. It seemed steep to spend $650 for an enclosure with no drives so I set out to build my own.

The Hardware


The first thing I wanted to do was verify that my assumption of a price premium to turn-key solutions was correct. I hit newegg.com and put together a list of hardware based on some recommended FreeNAS builds:

Qty.ImageProduct DescriptionUnit PriceSavingsTotal Price
1CHENBRO SR30169T2-250 0.8mm SGCC, Hi-PS Pedestal Compact Server Chassis for SOHO & SMB Office
CHENBRO SR30169T2-250 0.8mm SGCC, Hi-PS Pedestal Compact Server Chassis for SOHO & SMB Office
Model #:SR30169T2-250
Item #:N82E16811123173
Return Policy:Standard Return Policy
In Stock
$149.99-$10.00 Instant$139.99
1ASUS P8H61-I R2.0 LGA 1155 Intel H61 HDMI USB 3.0 Mini ITX Intel Motherboard with UEFI BIOS
ASUS P8H61-I R2.0 LGA 1155 Intel H61 HDMI USB 3.0 Mini ITX Intel Motherboard with UEFI BIOS (I ended up with a different MOBO, read below)
Model #:P8H61-I R2.0
Item #:N82E16813131878
Return Policy:Standard Return Policy
In Stock
$85.99$85.99
1Intel Celeron G540 Sandy Bridge 2.5GHz LGA 1155 65W Dual-Core Desktop Processor Intel HD Graphics BX80623G540
Intel Celeron G540 Sandy Bridge 2.5GHz LGA 1155 65W Dual-Core Desktop Processor Intel HD Graphics BX80623G540
Model #:BX80623G540
Item #:N82E16819116408
Return Policy:CPU Replacement Only Return Policy
In Stock
$49.99$49.99
1Crucial Ballistix Sport 8GB (2 x 4GB) 240-Pin DDR3 SDRAM DDR3 1333 (PC3 10600) Desktop Memory Model BLS2KIT4G3D1339DS1S00
Crucial Ballistix Sport 8GB (2 x 4GB) 240-Pin DDR3 SDRAM DDR3 1333 (PC3 10600) Desktop Memory Model BLS2KIT4G3D1339DS1S00
Model #:BLS2KIT4G3D1339DS1S0
Item #:N82E16820148543
Return Policy:Memory Standard Return Policy
In Stock
$59.99$59.99
1OCZ Nocti Series NOC-MSATA-30G mSATA 30GB SATA II MLC Internal Solid State Drive (SSD)
OCZ Nocti Series NOC-MSATA-30G mSATA 30GB SATA II MLC Internal Solid State Drive (SSD)
Model #:NOC-MSATA-30G
Item #:N82E16820227746
Return Policy:Limited Replacement Only Return Policy

Out Of Stock

ETA: 10/14/2013 12:00:00 AM

$59.99-$12.00 Instant$47.99
Subtotal:$383.95

Not too bad, the whole shebang for about $385 and I get an SSD for the OS. I realized at this point that I have a perfectly good Lian-li PC92 case in the basement with 4 external drive bays, and 7 internals. That sounded pretty good allowing me a grand total of 11 drives. Since I now had a larger case, I was able to use a larger motherboard with more SATA ports. The Gigabyte GA-Z77X-UD5H fit the bill nicely. The other part I wanted purely for cosmetic value and simplicity of maintenance was a few drive docks. I decided on the IcyDock 3 in 2 which brings me up to 13 possible drive bays (the motherboard only supports 9 though). The Chenbro case included a power supply so I needed to spend $50 for a good power supply to reuse my case. This raised the price of the system to $427 but gave me the docks.


1 of: Corsair Builder Series CX 500 Watt ATX/EPS  80 PLUS (CX500) [Personal Computers]
Condition: New
Sold by: Amazon.com LLC
$49.99


Shank-NAS



Product Image
In Stock.Offered by JM PRIME
24 Used & New from $64.26

Once all of the part arrived, the assembly went well. Everything connected and fit like it should. I had to do some digging to find the right length and head-angle of sata cables to get everything in place. I lo-o-ove the look of the ICYDOCK and it made identifying drives far simpler. I brought over 4 drives from the HTPC including a WD 640GB, 2 Hitachi 2TB's that I stripped out of an external enclosure and a WD 1TB 2.5". I added 2 WD Red 3TB model WD30EFRX-68A for data and the 30GB SSD mSATA for the OS.

Software


This is where the real research comes in. There are a lot of different ways to do network attached storage. After a few nights of reading on my iPad, I shortlisted the following:

OptionProCon
FreeNAS
  • ZFS is bullet proof
  • Deduplication
  • Snapshots

  • Overkill for media
  • There will be no duplication since it's video.
  • Drives must be planned and can be somewhat inflexible

UnRAID
  • Easy to add different size drives
  • If one drive fails, the others are still accessible
  • Great web interface

  • Closed source
  • Slow development cycle
  • Licensing cost (negligible amount)

Ubuntu + SnapRAID + mhddfs
  • Anything that Ubuntu can do, this solution can do (NFS, AFP, Samba, BitTorrent, bash scripts, etc)
  • Easy to add different size drives
  • If one drive fails, the others are still accessible

  • With flexibility comes complexity, makes it easier to do the wrong thing and lose my data


I was back on forth on this for a few weeks before I finally settled on the Ubuntu option. I installed Ubuntu 12.04LTS which was really fast on the SSD then added the SnapRAID and mhddfs package per these guides:

  • Install SnapRAID - SnapRAID allows user-controlled parity snapshots to be created as long as there is 1 extra drive that is as large as the largest drive in the system. Make sure to follow the Scheduling SnapRAID section at the end, the script is fantastic.

  • SnapRAID on Ubuntu 12.04

  • mhddfs (unfortunately the original guide is no longer available) - This package allows dynamic assembly of multiple drives/mount points into a single "view". It automatically distributes data to each of the participating drives while leaving each of them in an independant state in-case of data loss.

  • Using smartctl to get SMART status information on your hard drives - Want to get an email when your drive is going south? This is where to go.

  • NFS on Ubuntu 12.04 - NFS 4 is a great protocol (Unless you're using the built-in Win7 client) and is my go-to for sharing data on my network
The system works wonderfully. I was able to easily move the drives out of my existing HTPC and recreate the SnapRAID environment without having to copy any data into a new place. I simply copied the existing UUID's from the old HTPC to the /etc/fstab on the new NAS.

3 comments:

  1. [...] Less than 1 month later, this one starts failing. Go Hitachi. The good news is that I had built my NAS for just this purpose. I googled around for some instruction on what to do but couldn’t find [...]

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete