Rolling Your Own NAS with FreeNAS: Part One

Once upon a time, managing data in my house was a no-brainer. I had two computers and a couple of external hard drives. I knew where everything was. If I needed to move or copy files from one computer to another, I’d simply create a Windows share. Backups were a manual process, but not so onerous that they didn’t get done. And because I lived alone, I didn’t have to think about things like sharing data with other people.

Then the girlfriend moved in. And with the girlfriend came all of her digital devices. Suddenly photos and videos needed to be shared, documents needed to be accessed from a slew of different devices, and backups became more of a chore. Overnight, my little office, which used to be a digital island of sorts, became assimilated into a larger ecosystem of devices and content. And my tiny, simple network became a lot more complicated.

Something had to be done. And I was fairly certain a significant part of the solution involved dedicated network storage. Thus began my quest for finding the ultimate “one size fits all” data hub for my home network. I examined a number of different solutions including cloud storage, off-the-shelf NAS devices, and network routers with USB ports for external storage. Heck, I even entertained the idea of dual-purposing my own PC for this task (crazy talk, I know).

None of the commercial options really appealed to me. Each had their own drawbacks. And the more I learned about them, the more disappointed I felt.

My must-haves were:

  • The device should be small.
  • Power efficiency. If the device isn’t in use, it must consume as little power as possible.
  • There must be no software to install on client machines.
  • Support for RAID is a must. This also means that internal drives must be easy to access and replace.
  • Client machines should be able to access the device using plain ole vanilla Windows shares.
  • If the power goes out, the device should be able to shutdown cleanly. I live in a somewhat rural area prone to power outages and brownouts.

My like-to-haves were:

  • FTP support.
  • User account support.
  • The ability to remotely administer the device (shell access).

Eventually, I decided that building a custom NAS was the only way I was going to be satisfied. Instinctually, I began thinking about building a simple Linux machine. And that’s the path I actually started down. I wasn’t sure which distro to use. And there would no doubt be a fair amount of configuration, testing, heartburn, and headaches. So I began searching for folks who had rolled their own Linux-based NAS with the hope of finding a few war stories, helpful pointers, and perhaps even hardware suggestions.

It wasn’t long before I came across this wonderful thing called FreeNAS. It was a ready-made platform for folks like me trying to roll their own NAS. It had everything on my wishlist and seemed extremely easy to get up and running.

FreeNAS runs on top of FreeBSD in fact. Not Linux. I have to confess that I’d never used FreeBSD before undertaking this project. And I was a little nervous about the idea. Moving from a Linux distro you’re comfortable with to some other *nix platform can be scary – files are in different places, daemons are managed differently, package management makes no sense, and the arguments to your favorite command line tools behave oddly. My needs going into this project were fairly modest and now I would be tasked with learning an entirely new OS. It seemed a bit much. And I wasn’t entirely sure I was ready to invest a whole lot of time into this project. But as it often happens to geeks and do-it-yourselfers, I was seduced by the sexiness of something new and shiny. And so it began.

Before I go into the details of my FreeNAS project, I would like to briefly discuss some of the options I mentioned previously and the reasons why I chose not to use them.

Cloud Storage

Cloud storage is all the rage at the moment. Services like Carbonite, Google Drive, and Amazon Cloud Drive allow you to store data online and access that data anytime and from anywhere, so long as you have Internet access that is. Some services market themselves as backup solutions, while others sell themselves as more generalized storage solutions. Some services even tout their wares (pun intended) as a means to share files with others. Whatever your online storage needs and budget, there’s undoubtedly a company out there that can help you.

Cloud storage wasn’t a solution for us for two reasons:

Cloud storage simply isn’t practical for big files. Transferring anything over a few hundred megabytes across the interwebs is time-consuming and potentially very expensive. Sharing things like raw DV video or project files from a recording session (did I mention I’m a musician?) isn’t really appropriate for these products. Not to mention, I’m fairly sure if I started transferring terabytes of data back and forth every month, my ISP would start sending me hate mail and would mostly certainly cut me off.

The consumer also needs to be concerned with security when it comes to these services. How much do you trust your storage provider? Are you uploading sensitive data? How silly would you feel if your tax return suddenly became public domain? And what if your storage provider went out of business tomorrow?

Off the Shelf NAS

There are a lot of great consumer NAS products on the market. And they vary widely in terms of features and price.

At the low end (under $250) are products with extremely limited sets of features. They tend to lack RAID support, require client software to be installed on your PC, and they often don’t integrate well with UPS devices. Some even require an account with the manufacturer’s online service to take advantage of features.

As the price point increases, the feature sets are richer and the products begin targeting more professional users. I did manage to find a couple of devices that would have worked well for me. But they were way outside of my budget. I popped over to NewEgg and created a rough estimate of the kind of hardware I thought I’d need. My estimate for a device with similar capabilities and capacity came in at a fraction of the cost as some of these higher end devices.

Routers With USB Ports

Many modern routers come equipped with a nice little USB port on the back. This allows you to plug a mass-storage device (e.g., external hard drive) into the router and make the drive available to the rest of your network. You may or may not have to install software on your PC to use it. It depends on the router and the mass-storage device.

This is simply brilliant. I love the simplicity of the idea. And I run into plenty of situations where something like this would be handy. For me, however, it wasn’t a real solution. Or at least it wasn’t a solution for this particular problem. Apart from the actual storage, these devices lack just about every other feature on my wishlist.

Enter FreeNAS

FreeNAS is a special distribution of FreeBSD that is preconfigured to function solely as network attached storage. All you need to do is provide the hardware, install the software, and configure it appropriately. It supports RAID, UPS integration, all of the popular network file system protocols, FTP, SSH, email notifications, user access control, SMART monitoring, and rsync, and the proverbial kitchen sink. It also provides a really nice web interface for remote configuration. And did I mention it’s free?

In the next two articles, I’ll show you what hardware I chose and the process I used to configure FreeNAS for my home network. You’ll learn how I set everything up and devised an automatic backup solution.

Stay tuned! In the meantime, visit FreeNAS.org!