Storage optimize

DIY: FreeNAS offers Network Attached Storage for free

FreeNAS is open source and free, which makes it a great option for small shops. Jack Wallen says it also happens to be one of the most versatile NAS solutions available.

If you're looking for a Network Attached Storage (NAS) solution, you've probably researched NAS devices that range in price from $200 to $2,000 and higher. A free option you should consider is FreeNAS, an embedded, open source NAS solution that is easy to deploy. FreeNAS is based on BSD (nanoBSD), so it's not only reliable, it's also secure.

FreeNAS supports these protocols:

  • CIFS (samba)
  • FTP
  • NFS
  • TFTP
  • AFP
  • RSYNC
  • Unison
  • iSCSI (initiator and target)
  • UpnP

One nice feature of FreeNAS is that it can be installed on a USB flash drive and run as a Live distribution (For a full list of compatible hardware, check out the FreeBSD Hardware Compatibility List.) The BIOS on your machine will have to support Boot from USB in order for this to work; fortunately, many modern BIOS support this feature. This makes for a quick, easy, and on-the-fly NAS device.

Installing FreeNAS

Most administrators will want to install FreeNAS so the device is more reliable than that of a live distribution running from a flash drive. The FreeNAS installation process is simple -- just follow these steps:

1. Download the ISO image from the FreeNAS download page (be sure to download the right file for your architecture).

2. Burn the ISO image onto a CD.

3. Boot the NAS machine using the FreeNAS CD.

4. Select Install from the list.

5. In order for the installation to complete, remove the disk and reboot.

Configuring networking in FreeNAS

FreeNAS is not ready for you to use quite yet. The next step is to configure networking, so you can use the web-based administration tool.

When FreeNAS has completed the boot process, you'll see the menu in Figure A. From this menu, select option 1 to configure networking. Figure A

Dropping into a Shell gives access to all of the FreeNAS executables.

Since this device will serve as a NAS where users will push and pull files, the interface will need to have a static IP address. To do this, enter 1 to gain access to the network interface configuration tool. This tool is a text-only tool and will require the following:

  • Select an interface to configure.
  • Configure interface for DHCP y/n.
  • Configure IPv4 y/n.
  • Interface name.
  • IPv4 address.
  • IPv4 Netmask.
  • Configure IPv6.

Once the configuration is complete, the FreeNAS device can be accessed from the web interface.

Using the web interface

The web interface is the best feature of FreeNAS. The web interface makes it incredibly easy to set up and administer your NAS device. Figure B shows that the web interface is user-friendly. Figure B

Adding volumes, importing, and auto-importing of volumes is as simple as a click of a button.

In order to log into the web-based GUI, use these credentials:

  • Username: admin
  • Password: freenas
You should change the password immediately by clicking My Account in the left navigation and then clicking Change Password. After that is complete, the system is ready for the creation of users and volumes. Note: When a new volume is added to FreeNAS, it will clear the data from the device. So if the desired effect is to add a pre-existing volume containing data, make sure the action is to Import or Auto Import the volume. Each time you add a new user, you can define where that user's home directory is located (Figure C).

Figure C

Unless a user has a need for a shell login, you should disable that feature.

The user's home directory must begin with /mnt. When the user's account is created, that home directory can be /mnt/USERNAME (USERNAME is the user's actual name). You define that in the user creation screen, and the FreeNAS system will create the non-existent folder.

Managing services in FreeNAS

One of the most important configurations to manage is the services. Individual services are configured and turned on or off in the screen shown in Figure D. Figure D

Services are turned off or on from the configuration window of the individual service. If a service is needed, click the configuration icon associated with the service (the wrench is the icon in question), change the options necessary, and click OK. When the configuration options have been saved, the service will start. The configuration of each service will depend on the needs of the company/network using FreeNAS.

Get the most out of FreeNAS

There are a ton of other features that can be configured, thanks to the FreeNAS web-gui. Anyone deploying this NAS tool should make sure to take the time to go through every aspect of the GUI to make sure to be taking full advantage of this incredibly powerful and free NAS solution.

More about FreeNAS on TechRepublic

About Jack Wallen

Jack Wallen is an award-winning writer for Techrepublic and Linux.com. As an avid promoter/user of the Linux OS, Jack tries to convert as many users to open source as possible. His current favorite flavor of Linux is Bodhi Linux (a melding of Ubuntu ...

6 comments
Marc Jellinek
Marc Jellinek like.author.displayName 1 Like

I'm running FreeNAS within a VMWare Virtual Machine. I needed a way to take 5 2 TB hard drives (installed in an external SATA enclosure, connected to my computer through an eSATA cable) and configure them into a single RAID5 stripe. I downloaded VMWare Player and created one 1.8 TB vmdk virtual hard drive on each physical hard drive. Then I started FreeNAS inside a VM, and started configuring. I was able to create the RAID 5 stripe, then configure FreeNAS to provide an iSCSI target. I used the Windows iSCSI initiator on the host operating system to connect and present the storage as a local drive to the host operating system. I never touched a command line. Everything was configured through the FreeNAS web interface. It was time consuming, mainly to create the preallocated VMDK files. But after the VMDK files were created, it took about 20 minutes to set everything up. Eventually I'll move this to a physical system instead of a virtual system (mainly for speed, but also to reduce clutter on my desk). Since this is a VM, I have no need for a remote shell, but if I needed one, I'd just go to Services/SSH and enable it. Since I'm the only person able to connect (I'm using a host-only virtual NIC provided by VMWare), I'm not concerned about filesystem security. But if I were, I'd take a look at the user manual. The web interface allows you to set Read/Write/Execute permissions at the mountpoint level. The web interface also include a file explorer (QuiXploer 2.3) that allows you to set permissions. This isn't rocket science.

chrisbedford
chrisbedford

(Because, notwithstanding my negative comments above, I am after all still a technogeek and have to play with stuff) ...after experimenting with freeNAS I am even more convinced I would not want to use it in its present form. 1. The documentation is very much still a work in progress and only useable for aspects of the configuration which doesn't require documentation, i.e. where the menus are self-explanatory. When you need help, you're on your own. Some parts were clearly written for a different version than the one I downloaded, because the screen descriptions didn't correspond to mine, and lots of stuff was missing. 2. The error message I got does not show up on the freeNAS website, under documentation or in the forum. A Google search for it brought it up in a handful of other places but once I found some potential fixes, I could find no way to implement them - freeNAS would not accept an SCP session from another computer, and my Linux command line skills at the console are not good enough to create directories, allocate permissions, and edit text files. 3. So, taking a different tack, it took me ages to navigate around the configuration of users & groups to the point where I could get a working FTP connection. Eventually I figured it out, no thanks to the manuals. 4. When you create a new user, the default user home dir is "/nonexistent". You have to manually change this to the name of a directory that does exist, but you can't assume that the shares you have created are named the same as the share names - they're not, and find out what their real names are you have to do a "ls" from the console. 5. Having got an FTP connection (yaayyyyy) I can "cd .." all the way back to the root of the freeNAS machine and then go into /boot/kernel or anywhere I like! This can not be Good Thing. Overall, a good effort, but I'd say it needs a lot of work before it could be used in any kind of production environment where integrity of data is important. Definitely not worth the effort except for those who have a lot of time to spend fiddling. I spent the best part of Friday night and most of Saturday figuring it out. I'm a dedicated IT support person, with lots of cross-platform experience and more than a smattering of Linux - I can confidently testify that what I achieved is going to be beyond 90% of the amateur IT guys I have dealt with (and many of the professionals!) and let's face it, the "DIY IT guy" is doubling up as something much more line-of-business and does the IT as a sideline, as it were. Not too many of those people have a whole weekend to try stuff out. My opinion. Your mileage may vary.

Neon Samurai
Neon Samurai

Someone more comfortable with *nix command line probably would have found it much more self-evident. if you can SCP, the first question a *nix nerd would think; "is OpenSSH or some other SSH daemon installed? Is port 22 listening or accessible to accept SCP connections?" I'm not saying documentation couldn't be improved or your a lesser nerd for not already having a higher comfort level, just that a *nix comfort level easily ports between *nix based distributions. My ReadyNAS is all browser pointy-clicky but made perfect sense when I found my way to a CLI simply because of my comfort level and the common attributes between *nix CLI. Now, why where you mucking about creating users and groups outside of the provided browser GUI interface or was that the interface you where using but implemented ugly by the FreeNAS folks? Full access to the filesystem through an FTP login is indeed a concern. I'm not familiar with FreeNAS directly though so I don't know if there was a "limit user to home directory" option you could easily select or if user accounts are intended to have private home directories at all. ReadyNAS can generate user specific home directories out of the new user GUI though my preference is to not create a home directory and instead create a share that only that user account has permissions for. FTP is cleartext so it's not acceptable unless the NAS happens to provide FTPS and SCP/SFTP over SSH tends to be for admin needs only with my machines. Given your experience, I wouldn't blame you for keeping it out of production systems. It remains something I'd like to look at and will probably to a pentarget VM for but for me doing a distro install, I may as well do a stock Debian or similar unless the given NAS distro has something that makes it more desirable.

chrisbedford
chrisbedford

I grew up with DOS 2.1 so I have a Clue - just can't be bothered learning more than the required minimum Linux commands. But have to agree that once you do know some stuff, it tends to work no matter what flavour of *nix you are playing with. I was mucking about creating users *in* the provided GUI. It's not ugly, btw, just a little unconventional in structure and therefore not too intuitive. It is fully point - drool - click but I haven't managed to figure out the philosophy behind their directory structure - or, indeed, if there is one. No, seriously, it looked to me like there was a menu option missing - you can't create directories from the GUI. At least, nowhere I could find. I would tend to agree with your experience re the little dedicated NAS units' slowness - I have implemented a couple of D-Link DNS-323's - but assumed they were slow mostly because of the 100 Mb NIC. Could be that the low processing power has an influence there too ;-) and I guess I didn't really consider the gap market between those low-end guys and "proper" NAS servers, however I think you have somewhat over-estimated the $$$ aspect of MS-based systems. Consider a company that already has AD and / or Windows-based servers doing whatever - Exchange, Sharepoint, yada yada - many if not most will have per-seat CAL licensing in place so all they pay for is the server install licence (around $ 500 if memory serves?). This on top of how much for a piece of respectable hardware with lots of disk - ok not insignificant, but if you can fork over $ 20k (or even 10k, or 5k) for a computer another $ 500 shouldn't be breaking the bank. I guess it all comes down to how much is your time worth? Remember this blog is aimed at the DIY IT guy, not the shop with dedicated IT professional(s). Some of those DIY chaps like to have a home life (like we said, they aren't IT geeks!) but I guess there are enough who would be happy to spend weekends figuring out & trialling OSS implementations.

chrisbedford
chrisbedford like.author.displayName like.author.displayName 2 Like

Well, I suppose I do - this gives you the opportunity to build quite a big or a reconfigurable NAS unit. But you still have to buy hardware for it to run on, and the small shops that this type of article is aimed at are much more likely to want something physically small and uncomplicated, like a Netgear ReadyNAS or a Drobo, which consumes less power, takes up less space, and works right out of the box - no 100 MB download or OS install before you can start setting up the thing. And in most cases I have looked at, the hardware is cheaper than the actual computer you have to buy to build a system like this. Most purpose-built NAS solutions are based on some flavour of Linux so you end up with pretty much the same sort of solution anyway - in my opinion you get a tidier result with one of the preconfigured units.

Neon Samurai
Neon Samurai like.author.displayName 1 Like

True, if the option to re-use hardware is not an option, one may be looking at buying hardware to run FreeNAS on. In that case though, hardware purchases are common to all NAS options. Things like ReadyNAS and Drobo provide a commodity appliance with just enough hardware to do the job. It's unlikely anyone is going to pop open the ReadyNAS case and swap in more ram and a more powerful processor. I'm not sure if Drobo chassis are more or less accessible than the ReadyNAS either. My two experiences so far go like this: Linksys NAS200 - works fine as an introductory model and secondary backup. No SSH. No HTTPS. No SFTP/FTPS. Samba works well enough but for large transfers your hard pressed not to ignore security and just enable clear text FTP. It has two bays with hardware RAID (RAID1 for my preferences) but that's your limit. Best use for it may be a backup target; run your backup on something else that can provide a truecrypt file volume then upload the resulting encrypted blob to the NAS200. At least then the data has some minimal effort towards security since the box it's stored on has absolutely none. For 100$, what does one expect though. ReadyNAS - fantastic option for home or a five person business. HTTPS admin forms, SSH supported for shell or file transfer (SFTP). Samba supported for standard use as is NFS. It's a Debian based firmware also; log into shell and you'll find apt-get waiting. I was able to drop in the munin-node package and easily tap the NAS into my existing monitoring setup. (I've also broken it horribly to the point of re-flashing firmware so be warned if your going exploring.) I can't say enough about the self managed hardware RAID; pop in hard drives and the box will RAID them as most redundantly appropriate. I just popped in a fourth drive, the hardware prepared it and expanded the storage space (4 1TB drives = 3TB storage). To increase the size beyond your four slotted drives; replace each one at a time with larger drives. By replacing my current drives with four 2TB drives, I'd end up with the existing data migrated to the larger storage space (4 2TB = 6TB usable). Drobo provides similar self-managed RAID functionality. The short-comings are mostly due to limited hardware. An SFTP transfer to the ReadyNAS is noticeably slower than moving between nodes like my desktop and notebook. I won't even compare it to SFTP between big boy hardware like multi-processor, expansive RAM enabled rack servers. When a downloads dump from notebook to desktop I work away at another task on one of the systems until it's done. When I move a data dump from desktop to NAS, I set it to run then leave for work or go to bed. It's overnight versus over a half hour. Still fine for home use but I'm not dropping it into an office of more than five users even for use by significantly less encrypted Samba transfers. It is also providing an older form of SAMBA as far as I can tell; works fine with Windows boxes but does not play well with Debian 6 (Samba 3.5.6) or with the mediabox appliance plugged into the TV. For the workstation, SSH fixes the issue once you accept the longer transfer times. For the media box, UPnP fixes the issue once you accept that what the mediabox can see, any other machine on the local network can see (no authentication). Doing a self built NAS gives you the ability to upgrade hardware and economically bridge the gap between a ReadyNAS and IBM/HP/Dell storage server. My only complaint in that area would be giving up hot swappable hardware managed raid. I've never liked user setup RAID under the OS that's supposed to be running on top of it; let the firmware manage the RAID separately where possible. I'd be stuck between the trade-off of hardware that happily processes encryption for multiple concurrent SSH transfers versus hardware that manages the storage layer in a much more stable and fault tolerant way than removable media utilities and user setup software RAID. Granted, having a more full distribution running the box means much more flexibility for protocols supported and software installed. Now, back to the issue of hardware and FreeNAS. Sure, you may need to buy all new hardware rather than simply upgrade the storage in an old desktop (a 2 core proc and 3 gig of ram would provide a very solid base for a NAS). The cost may very well work out to far less than desktop equivalent or better NAS appliance. Even if you went all out and bot a rack box; $2,000'ish for the hardware plus $0 for FreeNAS, Debian or such to put on it versus $2,000'ish for the hardware plus $???? for Windows Server plus $???? for required CALS to support your user base. A similar example is groupware; $2,000 for hardware plus $0 for Debian/Courier Mail/Egroupware plus my time plus very little ongoing maintenance versus $2,000 for hardware plus $???? for Windows Server plus $5,000 for Exchange plus $???? for required additional CALS for our user base plus my time to setup plus lots of ongoing maintenance (spent three hours trying unsuccessfully to do a very simple task with Exchange last week; MSTN directions and five different methods where usless, even going back to the old fashion AD advanced security attributes.. nada.. grrr).

Editor's Picks

IT Buying Cycle

Learn more