# Custom NAS solution (aka home storage server)

## der bastler

Years ago I built a small server for file storage and subversion repositories respectively. It was built around a VIA EPIA board, started Gentoo Linux from a flash memory card attached via IDE (nowadays known as PATA) and featured a soft-RAID-1 with two 250 GB IDE HDDs. Everything was mounted in an old disemboweled hifi rack.

Now I want to take this to a new level. I would stick with the Mini-ITX form factor, so I would buy a new board, new RAM and two 2 TB SATA disks. The whole thing is meant to be my family's server:

 file archive (atm approx 1 TB since 1997)

 backup service for our machines

 subversion repositories

The two disks would be arranged as RAID 1 to prevent data loss in case of drive failure. Yes, I know the difference between reliability and backup. Thus I intend to use btrfs, taking snapshots to keep track of file changes.

BOM so far:

 Board: Intel Desktop Board DN2800MT

 Mass storage: 2x WD Red 2TB (WD20EFRX)

 RAM: Kingston ValueRAM DIMM Kit 4GB (KVR1333D3N9K2/4G)

I would install Gentoo (amd64) in a chroot environment and would copy it to a flash drive or SSD as prime boot medium. I assume that the Atom N2800 works with amd64?

As far as I understand Intel's manual the board supports mSATA SSDs natively, but I'm not sure it can boot off it when two SATA disks are installed (because mSATA via PCIe is multiplexed to one SATA port). Is this assumption correct?

----------

## der bastler

Sorry for pulling this topic to the surface, but I have to speed up the update process (read: I ran out of disk space).

At the moment I'm looking for an adequate mainboard. It should meet the following requirements:

Mini-ITX form factor

TDP < 13 W

passive cooling

all solid capacitors

at least two SATA ports for two WD 3 TB Red (WD30EFRX)

Applying these my search is narrowed down to the following CPUs:

Intel Celeron J1800/J1900

Intel Atom N270

Intel Atom N2800

Intel Atom S1260

It appears to me that a S1260 would be a fine solution, featuring ECC ram and a modern arch, but this comes with a heavy price tag (220 EUR, Supermicro).

Celeron boards are much cheaper (60 EUR, ASRock Q1900), and N270 lies inbetween (130 EUR, Jetway).

I think one of the Celeron boards would be sufficient for a simple low power file/web server, but... I also read that Bay Trail boards don't work well with Linux?

So it's either Supermicro S1260 (overkill?) or Jetway N270.

Has anyone got some experiences with the mentioned boards? Or can anyone recommend a Mini-ITX board meeting my requirements given above?

----------

## bbgermany

Hi,

dont go with the N270. Its very outdated and you wont hit the TDP < 13W. If you are able to read german (me looks at your username), you should have a look at the following table: http://www.computerbase.de/2014-04/amd-athlon-5350-kabini-sockel-fs1b-test/3/

Maybe this helps you deciding.

greets bb

----------

## der bastler

Well, actually the problem with these Celeron boards seems to be an UEFI issue. And it seems to be solvable (http://wiki.gentoo.org/wiki/UEFI_Gentoo_Quick_Install_Guide).

But I'm looking into the AMD portfolio, thanks for the hint...

----------

## gorkypl

Hi bastler,

I have dealt with exactly the same problem very recently, and have done a very extensive research  - perhaps my findings would be useful to you.

You definitely want a modern filesystem which would protect the files from silent data corruption (bit rot) - i.e. btrfs or ZFS.

From those two, ZFS is more mature, with a drawback that is not included in kernel due to licensing issues. I have no issues running ZFSonLinux since two months, and this solution is generally considered stable enough for production use (http://zfsonlinux.org/faq.html).

 For ZFS and btrfs you absolutely need ECC RAM, as a single bit filp may corrupt the whole filesystem (single bit flip while using ext2/3/4 would corrupt only a single file) - http://hardforum.com/showthread.php?t=1689724

 'Normal' BayTrail chips do not support ECC. You'll have to go with the server SOC called Avoton, which is using a bit more power (http://www.servethehome.com/intel-avoton-rangeley-power-consumption-real-world-c2750-samples-tested/) or a Haswell CPU, which is using very similar power to BayTrail when idle.

 Mini-ITX motherboards with ECC support are available from Asrock (http://www.asrockrack.com/general/products.asp#Server) and Supermicro, but the Supermicro ones use SO-DIMM ECC RAM, which are harder to find (ASrock uses normal DDR3 DIMMs), so you are going either with Supermicro and small DIMMs, or ASrock and the regular ones. 

I have decided I do not trust ASrock that much (they are making great desktop motherboards, but are not experienced in the server market) and resigned from the ITX form factor - the server is hidden anyway, so I do not care if it is a bit larger. Goung from ITX to uATX I was able to select a Supermicro motherboard with regular DDR3 ECC RAM.

Considering all those things, I went with such setup:

 Supermicro X10SLM-F motherboard: http://www.supermicro.com.tw/products/motherboard/Xeon/C220/X10SLM-F.cfm - rock solid, from a reputable manufacturer

 32 GB of ECC RAM (8GB would be sufficient, but I had an opportunity to buy it cheap. Also, you absolutely want to buy sticks that are on the motherboard support list, I have chosen Samsung memory)

 Pentium G3420 CPU (using almost the same power at idle as the Avoton chips - and the server is idling 90% of the time).

 Fortron FSP250-60EGA PSU - gold efficiency, low power, very silent, cheap.

 Currently I am running two disks in ZFS mirrored mode (similar to RAID1), but I am planning to build a 6-disk RAIDZ2 when my storage needs grow.

This setup uses under 15W idle, with disks not spinning, and has a great potential for further expansion if needed.

A great source of information for such applications is the freenas community - http://forums.freenas.org/index.php?forums/hardware.18/ There are much more storage-centric questions there, and in fact they can usually be considered OS-agnostic - e.g. take a look at this thread: http://forums.freenas.org/index.php?threads/mini-itx-freenas-homeserver-build.20254/

(BTW, for pure storage applications, FreeNAS might be better than Gentoo)

----------

## der bastler

*sigh*

One just wants to replace an external TB drive with a more sophisticated solution and ends up with discussions about server-grade hardware. So let's do it requirements-based...

Conditions/Requirements

HDD: 2 x WD Red 3 TB 3.5" SATA (payload), ca. 200 EUR

SDD: Intel Series 320 40 GB SATA (system), ca. 26 EUR

Mainboard/CPU: passive cooling, all solid capacitors, minimal TDP, Mini-ITX (Morex power supply available)

Features: encrypted RAID-1, integrated incremental backup based on snapshots, custom async I/O server daemon with client/server authentification based on TLS

For me, it comes down to two solutions.

Premium storage solution

Supermicro X9SBAA-F retail + 2*8 GB Kingston ValueRAM ECC + ZFS = 586 EUR

Economic storage solution

ASRock Q1900-ITX + 2*4GB Kingston ValueRAM (non-ECC) + btrfs = 360 EUR

Quite a difference. Although I'm not sure how to create a RAID-1 encrypted ZFS...

----------

## gorkypl

Uh, sorry for the delay.

Basically, the question is, how important is your data?

The 200EUR price difference takes you from home-grade hardware to a server-grade one.

I would just rather go with newer Haswell board (the CPU is less power-hungry) and avoid Kingston RAM - they are not on Supermicro compatibility list.

On the other hand, I have been using simple RAID1 with ext4 for many years, and haven't had more than 2 files corrupted. 

But now, with my current knowledge, and as I have some files that are so precious that I cannot afford loosing them (old family photos, scanned documents, years of my personal work, etc.) I have decided that keeping my data secure is a top priority.

So, personally, if I were you I would pay my last pennies and be sure that I have a reliable storage. And, obviously, this does not rule out backups - just makes you sure that what you backup is not already corrupted.

As for encryption - currently there isn't an easy way to do ZFS encryption. You can set ZFS over LUKS, but I am not sure how it affects reliability of ZFS (it is intended to work on 'bare metal').

Until a proper solution appears, I am storing my files unencrypted, and crypting only the backup which I am storing off-site.

----------

## NeddySeagoon

The HP Microserver N54L

With 5 2TB HDD, don't use WD Greens, 8G RAM and a 4 port NIC, mine uses 60w running headless.

Every now and again, HP do £100 cashback on this box too, so its too good to miss.

Its quite quiet but not something for under the TV.

It also runs Kernel Virtual Machines very well.

----------

## der bastler

Last week I chose my hardware: ASRock Q1900-ITX, Intel Series 320 SSD (40 GB), 2 x WD 3 TB RED, 2x4 GiB Kingston RAM.

Everything is installed and ready to go: https://abelbeck.files.wordpress.com/2014/08/box.jpg

I could retrieve that disk cage to the right from an old Lian Li HDD case. The chassis is recycled from an old amplifier. As I said I had a VIA EPIA setup running, thus I could re-use the Molex PSU. Power/HDD LEDs and the power switch are taken from an ancient ATX case.

Next on my list is to setup the base Gentoo system. Then I'll add the disks as an encrypted soft-RAID 1. Access is restricted to SSH until my own async I/O server is up and running (by-product of my thesis).

When everything is working, I'll spend new front and rear panels, some silk mat black paint, new green LEDs, a new switch and an OLED status display.

----------

