Build Your Own Home Server

Using FreeNAS to build a DIY home server

We haven’t checked in with FreeNAS, the FreeBSD-based DIY NAS OS, in quite some time. The OS has been completely overhauled, plugin support has been added, and it now works with even more hardware.

Since the last time we built a FreeNAS box, back in January 2010, the OS has been through some changes. It switched developers, nearly switched platforms, removed media streaming, added it back in via plugins, added better ZFS management, and more. FreeNAS promises near-endless customization and hardware support, enabling nearly anyone to build a highly moddable NAS from off-the-shelf parts. I’ve been promising an updated FreeNAS build for quite a while, and now’s the time to deliver. I assembled a cream-of-the-crop batch of hardware, got the latest version of FreeNAS, and got cracking.

Choosing the Hardware

The beauty of FreeNAS is that it’ll work with just about any old hardware you have lying around—you don’t need to build a special box for it. This “build” is more about exploring the new version of FreeNAS than it is about the hardware itself. I took the opportunity to build a pretty powerful system, but you don’t have to take my hardware choices as your minimum recommended specs or anything like that. I just wanted to see what would happen if I gave it beefy hardware to play with.

I chose a Fractal Array R2 chassis, which has six drive bays and an integrated PSU. I had a Mini-ITX FM1 board and an AMD A8 APU lying around and decided to use those, because a more capable CPU in your NAS means better transcoding and streaming. You could just as easily use any Mini-ITX board with a PCIe slot, maybe one with an integrated Atom or Brazos chip, if you want to save some money.

Four Western Digital Caviar Red NAS drives at 3TB each give me a theoretical 12TB of capacity if I were just going to make a RAID 0, which I’m not. Because I’ll be using a filesystem called ZFS, which does all its volume management in software, I want a good host-bus adapter that doesn’t insist on imposing its own hardware RAID over it—just something to pass the commands from the OS to the drives. I picked LSI’s SAS-9207-8i, which can control up to eight 6Gb/s drives and runs on a x8 PCIe 3.0 bus. Because I want to use the case’s SATA power connectors, I also bought a HighPoint Mini-SAS-to-SATA breakout cable rather than use the included connectors, which run on Molex power.

Because ZFS loves RAM and wants as much as you can throw at it (the specs recommend at least 1GB per TB of storage), I used two 8GB DDR3 DIMMs from G.Skill.

FreeNAS won’t mount any storage on the boot drive, and only takes up about 2GB total (with another 2GB swap), so there’s no point wasting a hard drive on it. It’s perfectly happy booting from a flash drive. I just used an 8GB drive left over from a CES press kit.

Set it Up

Since this is a very straightforward build but a complicated software install, I’ll skip the step-by-step build entirely, and start with the software configuration. It’s a bit of a doozy. Thankfully, I have the excellent instructions on Freenas.org and the FreeNas Quick Start Guide to help. Here’s how to set up FreeNAS; create volumes; set up users, groups, and sharing; and install a few streaming plugins.

1. Install the OS

To create the bootable OS image (from a Windows machine), you’ll need the aforementioned USB drive, the programs 7-Zip and Win32 Disk Imager, and the img.xz file for your install. We’re using FreeNAS 8.2.0 Release 1. Download the FreeNAS-8.2.0-RELEASE-p1-x64.img.xz file from SourceForge. Extract the img.xz file using 7-Zip to turn it into an .img file, then burn that file onto your USB key with Win32 Disk Imager. This might take a few minutes. Once it’s ready, plug the USB key into one of the FreeNAS box’s rear USB ports and turn on the machine. You’ll need a keyboard and a monitor for this, but only for a few minutes. Make sure the FreeNAS box is connected to your network via Ethernet. Make sure the system is set to boot from USB. The system will spend a few minutes doing a self-test and then dump you at a screen called Console Setup. At this point, under a list of 11 options, you should see the phrase “You may try the following URLs to access the web user interface,” followed by an IP address. Go to another computer on your network and enter that address into the web browser; you should be able to get right into the web console, which will make this whole process a lot easier (image A).

You’ll notice a blinking Alert light on the upper right. Click it and you’ll see that you need to change the admin password. Hit the Account button to the left of the Alert button, then select Change Password. Changing the admin username from “admin” can help with security too. You should also set up an email address for the root account, so FreeNAS can email you with admin alerts. Go to Account, then Users, then View Users, and click Change Email on the root account. You should also set up console logging by going to System > Settings > Advanced and selecting Show Console messages in footer.

I'm with you on this. My FreeNAS with ZFS (6 drives) is running just fine off the mobo's on board sata. I would think that a drive controller card for a home setup just adds an unnecessary piece for future issues.

I just built one this weekend using FreeNAS on an old P4 Processor w/2GB of RAM that's PLENTY fast..

I'm streaming 1080p movies off it over wireless and it's smooth as silk.

Unless you are working with really heavy file loads, a 'modern' computer running FreeNAS is a waste of resources.

My whole reason for using FreeNAS was to be able to hodge-podge a NAS server together from old obsolete parts.. Take my giant desktop system, shove the 8 Hard Drives into the FreeNAS box, and run my desktop in a Micro-ITX footprint with SSD.... and still have easy access to the files on the FreeNAS server shoved away in a quiet corner.

You are going to be limited by the network cable plugged into the back of it anyway.. Even if you have a gigabit network setup.. that's only ~120MB/s that can be shoved through it.

I have an old P4 and other older equipment laying around. I wanted to make a NAS but all reading material says you need an I-? and lots of up to date tech to stream 1080 and other content. Glad to know you don't.

until I saw the paycheck that said $6457, I have faith ...that...my friends brother trully receiving money parttime online.. there aunt has done this for under twelve months and just now repayed the morgage on their place and bought a new Cadillac. this is where I went, http://www.Cloud65.com

Built my freenas rig for $170 minus the cost of disks. Asus board with AMD E350 dual core and 8gb of memory were $109 + $30. The case and PSU were like $40 for generic 300 watt. It idles at like 19 watts or something last time I checked.

You definitely got pwnd on the RAM, case+power supply and board.

I can't advise my build to anyone that wants to do streaming, in hindsight, I wish mine had way more horsepower.

I always found paying for hot-swap bays on a home system kind of funny. Do you really want to be swapping out a bunch of disks? I dont.

Comparing the entry cost of the QNAP TS-469L-US vs. DIY (FreeNas). If the QNAP just needs drives and you are off a running, I could get the same WD Red's (x4) and still come out $200 less and my patience will be intact. If the DIY was sub $1000, I'd be all over it for sure. Great article, I still might look around for an old MB to use.

PS - I have a HighPoint RocketRaid 1820 that fits in a long PCI slot. Any boards out there currently still support it?

I use a Windows 7 platform with FlexRAID for my fileserver. 10 drives, ~20TB. I can (and just did) recover from 1 disk failure, although I'm going to be adding another disk so I can recover from 2-drives failing.

I choose this because:
1) the ability to mix-and-match drives
2) I can run my 2 VMs easily. I assume since this is Linux, the same ability exists using VMWare or similar?
3) the ability to pull any drive from the array, plug it into another computer and just copy the files off the drive.

FreeNAS is not a Linux based operating system. It's based off of FreeBSD.

1. You can mix and match, but if you are using ZFS you cannot just swap drives and increase the size of the RAID volume. You have to backup, destroy, and recreate the volume.

2. FreeBSD doesn't have much visualization support (you can run VirtualBox on it at this time). It would be incredibly difficult, by design, to get VirtualBox running under FreeNAS.

However, you can run FreeNAS as a guest OS, using something like VMware ESXi or Xen on the bare metal as the VM host.

3. This will depend solely on the hardware you are using. Chances are if it works on Windows FreeBSD/FreeNAS will support hot-swapping, but you will need to check the compatibility of your hardware to FreeBSD first.

I've been toying with the possibilities of a NAS setup and weighing the pros/cons of FreeNAS vs a factory box. The $1700 price of this FreeNAS is a bit expensive compared to a factory box. I think I'd rather a Netgear 4 bay with 4-3TBs.

Aside from the cost of the hard drives, this system could be built for a fraction of the price. Get a cheaper case and power supply (~50), cheaper CPU and motherboard (~$150 combined), get a better price on RAM (4 to 8 GB at most), and skip the hardware RAID controller and instead do software RAID.

Using a hardware RAID controller means your data can only be accessed via said controller. If you don't have a back up and that controller dies you could be waiting days or weeks to get a new one to install in your machine.

I would use free NAS, but I'm also using my server as a compute node for luxrender and some other distributed computing that I don't want hogging up cycles on my main machine. For that reason,I am stuck with ubuntu and Samba. Not the most elegant solution ever, but it works.

I dont think Nathan is with the magazine anymore, so I dont know who to address this question to lol. How easy is it to recover data after swapping out a dead hard drive? What if your flash drive that's running the OS suddenly dies? Can you just swap in a new flash drive with a clean OS and still be able to see your datasets or pools or whatever? Or should you be making a backup of your OS?

I used to ran FreeNAS as weel until I switched to a custom Linux install. I also used various old hardware for my homeserver. But last year I discovered the HP n36l and n40l microservers. I couldn't spec any miniitx build with a case suitable for a NAS that would come cheaper as the HP. The cpu is a bit underpowered - I have the n40l it uses a dual core amd I think 1.2Ghz but other than that it's a solid, stable system. It came by default with 2gb ram and one 250gb hdd - those are nice bonuses in my opinion but I switched to 8gb ram and 4x2tb. It's small, stable, pretty quiet and has a bit of room for expansion - everything a home server needs to be IMHO.

The N40L is a nice option, but it only supports up to 8GB. FreeNas recomends 1GB per TB of storage so what if you had 4x4TB drives? A custom box would be alot more expensive, but this box is cheaper than most Netgear NAS boxes and its a full blown computer! very nice deal.

That memory requirement probably comes from FreeNAS and ZFS. I use good old Linux with ext4. I ran it for some time using 3x2Tb and 2Gb RAM (doing dlna, download box, mysql and apache+php server, openvpn and two xfce desktops ready for vnc) and yet it had no issues. I did upgrade to 8Gb RAM but that was because RAM is cheap (and probably won't be when DDR3 goes out of style and I will really need more)

I would suggest rather then leave a usb key stuck in the back of the machine for it get snapped off and broken or accidentally jarred loose that getting a header to external cable and mounting it inside the case would be a much safer option.