The eTeknix Guide To Building Your Own NAS
Ryan Martin / 10 years ago
Configuring The NAS For Use
With your default administrator account and password set up you’ll want to setup the rest of the settings which are needed to use the operating system properly. The first of those are the global configuration settings found in the Network/Global Configuration area. The main settings you need to fill out are the IPv4 default gateway and the nameservers. Most routers will use 192.168.0.1 or 192.168.1.1 as the default gateway while your nameservers will vary depending on what DNS servers your ISP uses, or whether you use external nameservers like the ones offered by Google or OpenDNS.
To easily access these settings you should use any Windows system on your network. From that system jump into the Windows Control panel, choose the network and internet tab and then check the properties of your local area connection. In the “Network Connection Details” tab it will detail your IPv4 default gateway and DNS servers which you should copy into your FreeNAS global settings.
Next you’ll want to set up a volume from your disks where you can start storing data to. This is found under Storage/Volumes/View Volumes. From here you can create a volume using the ZFS Volume Manager option. We called our first volume “Primary”.
Using the ZFS Volume Manager we would recommend that you simply name your volume, use all available disks and pick an appropriate volume layout. For more details on the ZFS volume manager and which volume to pick you can get further advice here. We recommend using either Stripe (RAID 0) or Mirror (RAID 1) for a two disk set-up like the one we are building. Stripe will give you maximum performance but no data redundancy, Mirror will give you slower performance but parity of your data across both disks in-case one fails. This is better for the user who is storing important files that cannot be lost. In our setup we used Mirror across our two 2TB WD Red drives as this NAS will be used to store important files such as work files, music recordings and family documents.
With a volume created you now have accessible NAS storage available. However, you still need to set up a method of sharing this data storage to users of your local network. FreeNAS provides three options for data sharing: AFP shares, NFS shares and CIFS shares. These can be fund under the Sharing tab. CIFS shares is probably the sharing protocol most people will use as it supports Windows, Mac OS X, Linux and BSD devices so is a good all-rounder. To choose a sharing mechanism that best suits you the official guide will be useful, that can be found here. Setting up a CIFS share is fairly easy if you make certain assumptions. For example I trust everyone on my local network so I have allowed guest access and chosen for my CIFS share to inherit permissions and owners from the volume. I have also made the share browsable on the network for easy movement of files, setting up your permissions is going to be key to mediating access to your storage.
To more carefully allocate your permissions to your storage it is worth creating sub-volumes within your main storage volume. I created one specifically for downloads as this is one of many uses most people would use their NAS server for – a location to download things to such as torrents. Within this particular volume it is easiest to set the owner to nobody and nogroup and allocate all permissions to everyone. This means all guests on your local network can download and modify files in the downloads volume. Ensure you direct your CIFS share to the directory you want to share and then label it appropriately, in my case I have directed the CIFS share to the mnt/Primary/Downloads directory and called the CIFS Share “Downloads”. You can replicate the above process with multiple volumes for different things such as a music, films, documents, photos and so on. If you need to have your network storage secured more then you can set more advanced permissions. For example you may have a folder that you only want a few people to access (such as a folder for household financial information) so you might create a group (Adults) for that folder and allocate users (Mum and Dad) to that group. Or you might have a folder that you want people to be able to view files on only (except the administrator who puts those files on), this might include family photos.
Up to this point I have covered how to set up your global network settings, create a volume and share these volumes with users on your network. Of course I have only skimmed through these processes in a very basic way because I am not an advanced FreeNAS user, I may revisit FreeNAS at a later date when I am more knowledgeable, but for now I am just guiding you through the basic processes that a new user will be going through. Once you have set up your volumes it is worth installing some plugins to more effectively use your NAS device. There is a wide range of plugins to choose from, as shown below. Most users will probably go for some form of download client (such as BtSync, CouchPotato, XDM, Transmission, etc) and a media playing client (miniDLNA, PlexMediaServer, etc).
The first plugin you install will always take the longest. This is because it has to download and install the generic jail template for a plugin first. The overall process is very simple though and requires no user input other than for you to confirm that you want to install the plugin. Once the plugins are installed you can configure them through the plugins tab. You will need to turn their respective services on first before you can use them. For more details on plugins you can see here.
You will also want to allocate storage to your plugins within the Jails tab, this is important because if you have a specific volume for Downloads (for example) then you will need to ensure that the Jail storage for your download client (such as Transmission) puts files into a storage folder available on your Downloads CIFS share that you created earlier. This would mean that downloaded files end up on accessible shared storage so you can easily access them once they have downloaded, whereas if you download them to the storage within the jail of that particular plugin then you’d need to create an additional share for the volume of the plugin jails…..and this can just get confusing as you’ll end up with way to many shares. To allocate plugin storage you go to the jails tab, select the jail of the chosen plugin, select add storage, choose the source as the folder where you’d like downloaded files to go and choose the destination as the folder within the plugin jail where files get downloaded to automatically. In most download clients you’ll save yourself a headache by just calling the default download folder in that plugin jail “downloads”.
At the end of this brief configuration of FreeNAS I would like to make a note of a few things. Firstly, where I have not specified changing settings I have left things as defaults. In most cases you will want to do the same, the default settings are normally the best for basic users (like myself) and in the vast majority of cases they work best even if you have no idea why! Secondly, the official FreeNAS documentation is essential reading. Their documentation is extremely detailed and helpful and has saved my a$$ on numerous occasions so I really recommend keeping it at hand as you go through your configuration process, it will probably answer most, if not all, the questions you may have during configuration. Finally, this brief guide I have produced is just a distilled version of the processes I undertook: every user will be different and want different things and in that case the FreeNAS documentation is your friend (as well as Google!). In my case I’ve been more interested in having easily accessible network storage for all users to assist with downloads and media distribution such as streaming.