The Lone C++ Coder's Blog

The Lone C++ Coder's Blog

The continued diary of an experienced C++ programmer. Thoughts on C++ and other languages I play with, Emacs, functional, non functional and sometimes non-functioning programming.

Timo Geusch

5-Minute Read

This is a reblog of my “building a home NAS server” series on my old blog. The server still exists, still works but I’m about to embark on an overhaul so I wanted to consolidate all the articles on the same blog.

Up to now I’ve mostly been using recycled workstations as my home mail, SVN and storage server. Nothing really wrong with that as most workstations are fast enough but I’m running into disk space issues again after I started backing up all the important machines onto my server. That’s especially annoying as I started using Time Machine on my iMac and now haven’t got enough space left on the server to also back up the MacBook. Time Machine is great as a backup solution simply because it is so unobtrusive and it appears to just work.

Inspired by an article in the German magazine c’t, I decided that instead of finding another used desktop machine to recycle, I was going to build a proper home server with a few additional bells and whistles. I’m still using mostly desktop parts as I can’t really justify the expense and noise of “proper” server components but I tried to select decent quality parts. Here’s the hardware list:

<td>
  Antec NSK 6580B Black Mid Tower Case - With 430W Earthwatts PSU
</td>
<td>
  ASROCK A780LM AMD 760G Socket AM2+ VGA DVI 6 Channel Audio Mini-ATX Motherboard
</td>
<td class="line">
  AMD Athlon X2 5050e Socket AM2 45W Energy Efficient Retail Boxed Processor
</td>
<td>
  Samsung EcoGreen F2 1TB Hard Drive SATAII 32MB Cache - OEM
</td>
<td class="line">
  Startech Serial ATA Cable (1 End Right Angled) 18"
</td>
<td class="line">
  Crucial 2GB kit (2x1GB) DDR2 800MHz/PC2-6400 Ballistix Memory Non-ECC Unbuffered CL4 Lifetime Warranty
</td>
<td>
  Startech Right Angle Serial ATA Cable (1 end) 24 Inch
</td>
1 x
1 x
1 x
4 x
4 x
1 x
1 x

This little lot cost me around £450 including shipping so it’s a relatively inexpensive machine and will hopefully be more powerful than you average, similarly priced NAS. It should also be reasonably quiet and energy efficient, at least for something that’s got a regular processor and five HDDs in it.

First impressions of the Antec case are good. I like buying Antec cases because they’re usually pretty high quality and this one certain doesn’t disappoint. The nice touches like the disk mounting trays with gel feet are great, there is enough space in there - well, more than enough for my uses - and it’s got an 80plus PSU.

disk carrier

The only downside I noticed when opening the case was that the 120mm chassis fan plugs into a HDD power supply and has a ‘speed switch’. Not that impressive but if the rest of the machine turns out to work well I’ll probably replace it with a high-throughput fan that is hooked up to the chassis fan connector. I also like the removable disk carrier that leaves enough space between the disks for some decent airflow. If I had some front mount fans that is.

disk-carrier-3

I’ll skip the buildup stuff. It’s not that hard anyway, plus there are plenty of howtos on the web already. Everything went together very smoothly. I noticed that there is a well designed space for two front-mounted fans right in front of the HDD bays. Given the number of HDDs I’m running in this box, I’ll put a couple more fans on the shopping list (edit: which I never did and it didn’t seem to have any detrimental effects on the longevity of the disks). As you can see, the case is nice and spacious (it was a relief working in there instead of the Mini-ATX cases I tend to prefer for desktops) and yes, I know that it needs a visit from the cable tie fairy. In addition to the components above, I used a fifth HDD for the OS alone, plus on the heap of bits that no self-respecting geek can be without, I found a DVD drive so I didn’t have to hook up the external USB DVD drive that I keep for such cases.

My first choice of OS for this box was OpenSolaris 2009.06. An older version had achieved very good performance scores in the above mentioned article so I thought it was worth a try. I also hoped to be able to try zfs on the ‘data’ disks. While setting up the machine with OpenSolaris was fine, I ran into the problem that I do require a lot more features than “just” a plain NAS - which was the reason to build the server myself in the first place. In addition to playing file and DHCP server, this machine would need to handle all incoming mail (that’ll be postfix, amavisd-new and policyd-weight then), run an IMAP server (dovecot), an NNTP server (leafnode) and a bunch of other small tools that are necessary but unfortunately not available as packages on OpenSolaris yet. While I wouldn’t mind building all these packages from source, keeping them up to date might turn into a problem as I don’t want to have to manually maintain these packages. While the list of packages seems to be fairly small, with the number of dependencies that amavisd and especially SpamAssassin have, this would be almost impossible for someone like me who doesn’t have a lot of time to spend on server maintenance.

For this reason I went with plan B, which was to keep the OS I’m currently using on my server (FreeBSD). FreeBSD has support for zfs - albeit still labelled as experimental so I’m not sure if it’s a good idea, but I’ll try it anyway - and I can set up a FreeBSD box almost in my sleep. Plus, with cron jobs updating the local ports collection it should be fairly straightforward to keep everything up to date. One change I will be making though is to switch from the regular x86 version of the OS to the 64 bit version. Partially because I can but mostly because zfs does seem to be working better on 64 bit systems. Oh, and I’m beginning to wonder if using only 2GB of RAM was a smart idea as zfs does appear to like loadsamemory. I guess we’ll find out in part II…

Recent Posts

Categories

About

A developer's journey. Still trying to figure out this software thing after several decades.