Cheap and NASty - How to Build an Open Source FreeNAS Server
Installing FreeNAS
Don’t let the ancient UI fool you; it’s not as scary as it looks
Download and Burn the LiveCD
You’ll need the latest LiveCD for your processor—either 64-bit (AMD64) or 32-bit (i386). Download the LiveCD ISO from FreeNAS.org or SourceForge and burn it to a CD using image-burning software such as ImgBurn. There’s also a method for flashing a FreeNAS image directly to a bootable CompactFlash card—instructions can be found here.
Boot from LiveCD
Go into the BIOS (usually by hitting Del or F10 during startup) and give boot priority to the CD drive. FreeNAS will load from the disc and present a numbered menu labeled Console Setup.
Select Install Type
Select option 9) Install/Upgrade to hard drive/flash device, etc. In the next screen, pick option 3) Install ‘full’ OS on HDD + DATA + SWAP. You’ll be prompted to select the CD drive containing the LiveCD, which should be cd0, then the destination media—ad4, in our case. (FreeNAS, as a FreeBSD distro, uses device codes, not drive letters, for its drives.)
Next, you’ll be prompted to set a size for the OS partition. We chose the minimum size: 128MB, which is plenty—all your data will be stored on a separate partition. Now you’ll set your swap partition size. We went with the default again here, which gave us a swap size of 1,684MB.
Write it Down!
After you’ve chosen your OS and swap-partition sizes, FreeNAS will install on your system. Once it’s finished, the screen will display some important information. Specifically, make note of the instructions for mounting the data and swap partitions. And make note: The data partition has been formatted in UFS, so don’t reformat it unless you want to use ZFS (see sidebar). After you’ve written down the information on the screen (which we’ll cover again later, don’t worry), you can remove the CD and restart the computer.
Reboot
Once you’ve restarted the machine, go back into the BIOS. Go to the Boot menu and change the boot priority back to your hard drive. Save your changes and exit the BIOS. FreeNAS should boot from the disk and return to the original Console Setup menu. Before we head over to FreeNAS’s WebGUI, where we’ll do most of the configuration, we have a few more things to do here.
Set Web Interface
Select option 1) Assign interfaces, just to make sure your Ethernet connection is detected and working. Your Ethernet interface name will probably be the first two or three letters of your chipset, followed by a number. Ours is ale0. After you’ve assigned the first port, you can assign others (if you have more than one Ethernet port on your motherboard), or finish and exit the configuration.
Set LAN IP Address
You’ll want to give your FreeNAS server a static IP address, to prevent your DHCP server from assigning it a different IP every time the server reboots. First, go to a computer on your local network and run cmd.exe. Enter the command line ipconfig
/all and make note of that computer’s IP address, subnet mask, DNS server, and default gateway.
Now go back to the NAS. Select option 2) Set LAN IP address. FreeNAS will ask if you want to use DHCP for this interface. Select No. The next screen will prompt you for a new LAN IPv4 address. Use something in the same subnet as your other computers—often, this will be some variant on 192.168.1.* or 192.168.0.*. (You'll need to go into your router's config and reserve the IP you chose.)
In the next screen, use the subnet mask bit count that corresponds to your other computers’ subnet mask (most users will use 24). And in the next screen, when it asks for your default gateway, enter your router’s IP address. Finally, you’ll set your DNS IPv4 address, which is the DNS Server address you got from ipconfig on your Windows machine.
Once all this is completed, make note of the new IP address. You’ll use that to access the WebGUI. And now it’s configuration time!
Using FreeNAS's Multi-Drive File System
By default, FreeNAS formats its data storage with UFS (Unix File System). FreeNAS actually warns against formatting in NTFS, the default Windows file system, and you won’t want to format your NAS in FAT32—not if you have any files larger than 4GB, that is. So UFS is the best option for most people. But FreeNAS recently implemented support for ZFS, the Zettabyte File System. Instead of being a single-drive file system, ZFS manages a pool of virtual devices, which can be partitions or whole drives.
Advantages include one file system for all your storage, seamless addition of devices, and the ability to set up RAID-Z redundancy easily. Unfortunately, ZFS is still experimental on FreeNAS, and it does have limitations—the biggest of which is that it is a local file system and doesn’t handle multiple access requests well. There’s also no provision
for defragmentation.
If you do choose to try ZFS on your FreeNAS server, you should configure it from the beginning. You can do so under Disks › ZFS in the WebGUI.