My ZFS Home NAS/HTPC Box Build

Tue 19 January 2010

I was looking to build a NAS (Network Attached Storage) to store all my music, photos, files, e-books and important work related files. I also wanted to have a central place for my backups and to be used sometimes as HTPC. So, a "two in one" solution (NAS and HTPC).

Even if there are many ready-to-go NAS solutions I decided to build myself one and having the HTPC on the same machine. Here is mainly what I wanted:

  • low powered system (64-bit microprocessor)
  • used as a media server (stream movies/music)
  • to be used sometimes as a HTPC, so I wanted HDMI (for HD video)
  • ZFS file system with all its goodies
  • gigabit ethernet interface to take advantage of the network bandwidth
  • nice chassis with four hot-swappable 3.5" SATA HDD (I am using just two HDD right now because the motherboard has only 3 SATA)

My NAS/HTPC specs are here:


I choosed FreeBSD as operating system, because I am more familiar with it than with Solaris. I recompiled mplayer with vdpau support (for HD video).

Here are the steps:

  • download the latest mplayer snapshot from their website
  • download these two files ( and put them in /usr/include/vdpau (create that directory)
  • ./configure --disable-x264-lavc --disable-x264 -–enable-vdpau
  • gmake
  • gmake install
  • check to see if you have vdpau support with: "mplayer -vo help". If you see something like: "vdpau VDPAU with X11" then everything is ok.

Some additional steps/configs:

  • add zfs_enable="YES" in /etc/rc.conf
  • add  the following in /boot/loader.conf:
  • zpool create storage mirror ad4 ad10
  • zfs create storage/archives
  • zfs create storage/backups
  • install samba, duplicity, rsnapshots, rsync, unison, ushare, ...

Right now, everything is working very well, I am very happy with the setup, but I still didn't manage to have sound over HDMI, so, a temporary solution will be to connect an additional speaker system to it.

I don't need any fancy remote control, I have a logitech wifi keyboard/mouse, because I like to be able to read the news in the morning (during cofee time) using google reader

The total power consumption is about 35W idle / 45W load which is pretty good, I think.