Freenas is an open source, bsd based, distribution that provides an easy way to turn a networked computer into a network attached storage (nas) device. For this tutorial, I am using virtual box with virtual hard disks so I will make no comments on read/write speeds or benchmarks. We will focus on ease of installation and configuration.
Virtualbox Freenas Setup
Here is the setup used for this review. We will use three 10 gigabyte (GB) hard disks for the storage component and a 4 GB drive to hold the installation media (on bare metal, you could install onto a usb drive). All four of these virtual drives are run from a virtual scsi controller so that we can use a virtual ide cdrom to install the OS. The system here is allocated 512mb of ram which is much less than recommended and is using a single processor core (64 bit). Networking is setup using the intel pro/1000 MT Desktop interface through virtualbox.
To install freenas, head over to sourceforge and download the image appropriate for your system. For the purposes of this review, I am using the 8.3.1 alpha x64 build as it supported freenas encryption. Once you have the media downloaded, burn it to a cd, pop it in your nas computer and you will be greeted with a screen that looks like this. For production systems, please install the latest stable freenas release.
It will quickly boot and you’ll then have the option to install freenas, upgrade, drop into shell, reboot, or poweroff.
Choose install (obviously). Next you’ll be shown the disks that were detected by freebsd. In this case, we will install freenas to the 4GB disk “da0” (yours may be named differently).
After selecting the disk, you’ll be warned that you’re about to erase data and that this disk cannot be used for sharing.
Confirm and you’ll immediately begin installation. There is no keyboard, network, or timezone configuration. On my virtualbox, freenas installation took less than one minute. Speedy indeed.
Remove the disk and get ready to reboot.
Choose to reboot. At this point, you could also poweroff and remove the cd drive completely.
That’s it. Seven screens total and half of those are “are you sure?” screens.
On first boot you’ll be greeted briefly with the following menu.
After a minute or so of the system trying to set things up automatically, you’ll have a different console menu. If all goes well, you’ll have a configuration url listed.
Here my freenas can be configured at http://192.168.1.171, yours will almost certainly be different. You can set up a static ip a some point, but let’s navigate over and check out the web interface.
The interface is clean and your eye will be caught by the blink red light in the upper right corner of the screen complaining that there is no admin password set. On the left menu, you can choose account > admin account > change password and enter a password now.
Then click login to test your freenas password.
After reauthenicating, you will see the light is now green.
Click storage and you’ll see that no volumes have been defined. Click volume manager to create a new volume.
From the freenas volume manager, you’ll see the disks available to participate in the volume (da1, da2, and da3 for me). Note da0 is not available because that is where I installed freenas. Name the volume (do not choose “data”) and select the disks. I’ll use ZFS and choose freenas encryption here along with RAID-Z.
After clicking add volume, you’ll see you have a new shiny volume that is already mounted. The space listed may be surprising. Here’s how that was figured (10GB-2GB) * (3-1) = ~16GB. The numbers from from the disk size minus a constant of 2 gb for freenas’ administrative use (8gb per disk) multiplied by the number of disks minus one for parity.
To make things easy, I’ll change the permissions on the volume to 777. This is not recommended for production.
With that set up, we can install a freenas cifs share. Click on sharing at the top, then Windows (CIFS).
When you click add you’ll get a simple screen to define your share.
After saving the share, you’ll automatically be taken to the services screen and see that a CIFS server has been started for you. If you need to make changes to the default CIFS server, you can click on the wrench, but everything should work without modification.
At this point you are ready to start using your share. You can point your windows machine to \\ip-address and you should see your share listed. To install and configure Freenas took less than one hour. Stay tuned for upcoming articles on how freenas handles adding more drives and recovering when drives are removed.
If this was helpful …
consider buying me a coffee
either by paypal or bitcoin (1Na8zD2GZqfV1MaFv2HJsjP2nykztfPsBS)
My thanks go to Ladislav and Josh for the recent caffeination