My FreeNAS Project Part 5: The Config

August 22, 2009

So we have our FreeNAS box up and running, connected to the network and accessible via the web-based interface.  One of the first configurations I made was setting a static IP address for my NAS box.  I did this from the console (via option 2), but you can also do this via the web interface under Network->LAN. Have your network’s gateway IP address handy.  If you use a router you bought at a retail store (LinkSys, NetGear, etc.), it most likely will be

At this point, I went headless with my NAS.  I won’t need a monitor connected anymore because I won’t need console access for the remainder of configuration and operation.  I tucked my NAS box in my entertainment center in my bedroom.

Configure the Array

Next I added the disks and built the RAID array.  Like I mentioned in an earlier post, I decided to use FreeNAS’ software RAID rather than the RAID controller on my motherboard.  The first step is to add your disks.  You do this from the Disks->Management menu in the FreeNAS web interface.  Again, the documentation on is sufficient to step through this process.

When adding my disks, I chose to set the “Hard disk standby time” to 60 minutes.  I’m using my NAS as a raw storage device  (backup and archive) rather than an active working device, so allowing the disks to spin down after 60 minutes of inactivity will save power and keep the drives cool.  I also set the “Advanced Power Management” option to “Level 1 – Minimum power usage with Standby (spindown).”  Again, to keep power consumption low and the drives cool.  I activated the S.M.A.R.T. monitoring on all of my drives so I could use the reporting features and monitor the temperature of the drives.

Because of the case I chose to stuff my NAS into, as you can tell, I’m most worried about heat.  Typically NAS cases are small towers with stacked drives with efficient airflow from front to back.  There are also minimal components inside, so there’s not a lot of additional heat created.  My case—as you saw from prior posts—is a media center case with the guts of a full computer.  Keeping a hard drive cool can extend the life of the drive, so to help me monitor this, I setup the S.M.A.R.T. reporting features under Disks->Management S.M.A.R.T. tab.  I set the “Difference” value to 5°C and the “Critical” value to 36°C.  This means if a single drive’s temperature rises 5° or more since the last polling (which I set to 5 minutes) or if any of the drives reach 36°C, I will receive an email notification.  Be sure to click the checkbox to activate the email report and set the destination email address at the bottom of the page.

After adding each disk in your array, you’ll format the disks, create the RAID5 using the disks you added and format the new RAID array (I used UFS file system).  The documents explain how to do each step.

NAS - SpaceWith four 1TB drives added to my RAID5 configuration, it took FreeNAS approximately six hours to build the volume.  This created a volume of 2.6TB of usable storage space.  If you’re building your own NAS and wondering how much usable storage you’ll get from different RAID configurations, check out RAIDCalc.

After the RAID was initialized I created a mount point (Disks->Mount Point).  The mount point presents the volume to the operating system and makes the disk available for use.  Don’t confuse this with a share (CIFS or SMB), which makes a disk or directory available to other computers on your network.

Sharing the NAS

The last few steps to a functioning NAS is making it available to other computers on your network.  On my network I have a couple Macs, a couple Windows machines and an Ubuntu virtual machine.  The easiest way to share disks in this environment is to enable the CIFS/SMB service (Services->CIFS/SMB).  For authentication, I’m using Local Users since I do not have a LDAP server running on my network.  I gave the box a NetBIOS name, set the Workgroup and description, but left the rest of the settings as defaults.

I created one share (Services->CIFS/SMB, Share tab) to the root mount point just to verify everything was working.  However, before I could test and since I’m using Local Users for authentication, I added myself as a user (Access->Users and Groups).  I then went over to my MacBook Pro and sure enough, my NAS box was listed under the Shared section in the Finder window.  I clicked the server and could see my NAS01 share.

Benchmarking the NAS

I plugged my MacBook Pro into my new gigabit router (I bought a new router specifically to get more I/O out of the NAS) and performed a couple of benchmark tests (images below).  And so we have a functioning FreeNAS installation with 2.6TB of usable storage space.

NAS - In Traffic NAS - I/O Traffic NAS - CPU Usage NAS - Disk Temperatures

Protecting the NAS

The last thing I needed to do before starting to use the NAS for production is protect it from power events.

Power outages, surges, and brown outs are deadly for storage devices.  If the unit loses power in the middle of a write to disk, you can potentially lose your RAID.  Enterprise-level storage devices have built-in protections against these events, but lower-level storage devices do not.

I purchased an APC Back-UPS XS 900 from Best Buy for $129.99.  This unit is sufficient to run the NAS and another workstation for about an hour on battery.  If I’m around during a power event, that’s plenty of time to gracefully shutdown the NAS to prevent trouble from a sudden power loss.  But I’m not around all of the time.  Fortunately, FreeNAS has a built-in UPS service.  Once connected to your UPS device (via a USB cable that comes with the UPS), it can react to power events.  Under Services->UPS, you can enable this UPS service.  I couldn’t find the driver for my exact model of APC, so I used the generic “usbhid-ups” driver.  I also couldn’t find any specific help for the port setting, but I ran across a post on an Ubuntu forum that used “auto” as the port, so I tried that.  I set the “Shutdown mode” to “UPS goes on battery” and the “Shutdown timer” to 30 seconds.  In a power outage and after 30 seconds on battery the NAS will initiate a graceful shutdown.  I tested this by yanking the power cord on the UPS, and to my delight, FreeNAS shut itself down.

In the next post I’ll review the entire parts list and then talk about where this FreeNAS project fits into my over all backup/archive strategy.

Previous post:

Next post: