Sei sulla pagina 1di 29

Installing and Configuring FreeNAS (Network-

attached Storage) Part 1


by Babin Lonston November 15, 2014

Download Your Free eBooks NOW - 10 Free Linux eBooks for Administrators

FreeNAS is an open source network-attached storage (NAS) operating system based on BSD and the
ZFS filesystem with integrated RAID support. FreeNAS operating system is totally based on BSD and
can be installed on virtual machines or in physical machines to share data storage via a computer
network.

Using FreeNAS software you can easily build your own centralized and easily accessible data storage at
home and same can be managed via a dedicated web interface originally written in PHP language, later
re-written using Python/Django language from scratch.

FreeNAS Installation and Configuration

FreeNAS supports Linux, Windows and OS X and numerous virtualization hosts such as VMware and
XenServer using protocols such as CIFS (SAMBA), NFS, iSCSI, FTP, rsync etc.

Home users can build FreeNAS storage to store there videos, files and stream from FreeNAS to every
network devices or to smart TVs etc. If you are planning to build torrent site, you can use FreeNAS to
setup one for you. There are several plugins available for FreeNAS which is as follows.

1. Own-Cloud = To build Own cloud Storage.


2. Plex Media Server = To build Own video streaming server.
3. Bacula = Used as a network backup server.
4. Transmission = Create torrent server.

Features of FreeNAS

1. Support ZFS file system.


2. Support inbuilt RAID with parity support, cronjobs, Smart tests.
3. Supports Directory services such as LDAP, NIS, NT4, Active Directory.
4. Support NFS, FTP, SSH, CIFS, iSCSI Protocols.
5. Supports for windows based file-system such as NTFS and FAT.
6. Periodic Snapshot and replication support, rsync.
7. Web interface with GUI and SSL.
8. Reporting systems such as email notification.
9. Disk Encryption and much more features are available.
10. Adding UPS for Backup power systems.
11. A Rich GUI graph reports for Memory, CPU, Storage, Network etc..

In this FreeNAS 4-article series, we will cover the installation and configuration of FreeNAS with
storage and in later articles will cover setting up a video streaming & torrent server.

Part 1: Installing and Configuring FreeNAS 9.2.1.8


Part 2: Configuring FreeNAS Settings and Adding ZFS Storage
Part 3: Create Your Own Home Media Streaming Server Using Plex with FreeNAS
Part 4: Upgrading FreeNAS from Older Version to Newer
My Server Setup

Hardware : Virtual Machine 64-bit


Operating System : FreeNAS-9.2.1.8-RELEASE-x64
IP Address : 192.168.0.225
8GB RAM : Minimum RAM
1 Disk (5GB) : Used for OS Installation
8 Disks (5GB) : Used for Storage

Download FreeNAS 9.2.1.8

To set up a FreeNAS operating system, you will need to download latest stable installation ISO Image
(i.e. version 9.2.1.8) from the FreeNAS download page, or you can use the following links to download
image for your system architecture. Ive included download links for CD/DVD and USB bootable
images of FreeNAS, so select and download images as per your requirements.

CD/DVD Images

1. Download FreeNAS-9.2.1.8-RELEASE-x86.iso (185MB)


2. Download FreeNAS-9.2.1.8-RELEASE-x64.iso (199MB)

USB Images

1. Download FreeNAS-9.2.1.8-RELEASE-x86.img.xz (135MB)


2. Download FreeNAS-9.2.1.8-RELEASE-x64.img.xz (143MB)

Installing FreeNAS System

1. Now its time to install and configure FreeNAS. As every Operating system FreeNAS too have the
similar steps for installation and it wont take more than 2 minutes to Install.

2. After you download FreeNAS ISO image from the links above, if youve a CD/DVD drive, burn that
ISO image to a disc and then boot it, or if youre using USB Image you can directly boot it.

3. After booting the system with FreeNAS image, by default it will start the installation, if not we have
to press enter to continue the installation.
Booting FreeNAS

4. For installing FreeNAS, we have to choose Install/Upgrade. This will install the FreeNAS if its not
existed.

Install FreeNAS

5. In this step, we need to choose where FreeNAS should be installed. We have total 9 drives, so here
Im using first 5 GB ada0 drive for my FreeNAS installation and other 8 Drives are used for Storage
(will be discussed in next part of this series).

Choose ada0 drive from the listed drives and press Enter to continue.
Choose FreeNAS Install Drive

6. After selecting the drive, on the next screen you will warned for data loss, If you have any important
data in that selected drive, please take a backup before installing FreeNAS on the drive.

After pressing Yes all the data in that drive will be destroyed during installation.

Warning: Please take a backup of selected drive before starting FreeNAS setup.

Drive Data Loss Warning

7. After few minutes it will take us to the end of the installation process. Choose OK to reboot the
machine and remove the installation Disk.
FreeNAS Intallation Completed

8. On the next screen, choose the 3rd option to reboot the machine and remove the setup Disk.

Reboot System

9. After FreeNAS setup completed, we can get the console setup menu to add the DNS IP Address to
access the FreeNAS web dashboard.

By default at first it will assign a dynamic IP address and we have to configure it manually. Here we
can see that, weve got a dynamic IP address as 192.168.0.10 now we have to configure our static ip.
FreeNAS Console Setup

Note: First let me configure the DNS, I have a valid name resolver at my end, so let me configure my
DNS settings.

10. To configure DNS choose number 6 and press enter, then we have to enter the DNS information
such as domain, IP address of DNS server and Press Enter.

Configuring the DNS settings before IP Address will resolve the name from DNS. In your side, if you
dont have a valid DNS server you can skip this step.
Configure DNS for FreeNAS

11. After configuring DNS settings, now its time to configure network interface. To configure the
interface, press 1 and select the default first interface.

Use the following settings for configuring static IP:

Enter an option from 1-11: 1


1) vtnet0
Select an interface (q to quit): 1
Reset network configuration? (y/n) n
Configure interface for DHCP? (y/n) n
Configure IPv4? (y/n) y
Interface name: eth0
IPv4 Address: 192.168.0.225
IPv4 Netmask: 255.255.255.0
Savinf interface configuration: OK
Configure IPv6? n

Finally, at last choosing IPv6 no and pressing enter will configure the interface and get saved
automatically.
Configure FreeNAS Network

12. After configuring network interface settings, you will see that the IP address has been changed to
192.168.0.225 from 192.168.0.10. Now we can use this address to access FreeNAS GUI from any one
of the web browser.

Confirm FreeNAS IPaddress

13. To access the FreeNAS GUI interface, open the web browser and enter the ip address which we had
used to configure the interface setup.

http://192.168.0.225
At first login, we need to define a PASSWORD for the root user to access GUI interface. Set a strong
password for your storage server and continue login.

Set FreeNAS root Password

14. After login, you will see informations about FreeNAS server such as domain name, version, total
memory available, system time, up time, system load, etc.
FreeNAS Server Information

Thats it, In this article, weve installed and configured the FreeNAS server. In the next article we will
be discussing on how to configure FreeNAS settings in step by step process and how can we define
storage in FreeNAS, till then stay tuned for updates and dont forget to add your comments.
Configuring FreeNAS to Setup ZFS Storage
Disks and Creating NFS Shares On FreeNAS
Part 2
by Babin Lonston November 27, 2014

Download Your Free eBooks NOW - 10 Free Linux eBooks for Administrators

In our previous article, weve shown you how to install FreeNAS server. In this article we will cover
configuration of FreeNAS and setting up storage using ZFS.

Add ZFS Disks to FreeNAS

Requirements

1. Installation of FreeNAS (Network-attached Storage) Part 1

After installation and configuration of FreeNAS server, following things needs to be done under
FreeNAS Web UI.

1. Set the web protocol to HTTP/HTTPS.


2. Change web GUI address to 192.168.0.225.
3. Change Languages, Keyboard Map, Timezone, log server, Email.
4. Add ZFS supported storage volume.
5. Define any one of the sharing.

After making above changes in FreeNAS Web UI, we have to save the changes under System ->
Settings -> Save Config -> upload Config -> Save to keep the changes permanent.

My Server Setup

Hardware : Virtual Machine 64-bit


Operating System : FreeNAS-9.2.1.8-RELEASE-x64
IP Address : 192.168.0.225
8GB RAM : Minimum RAM
1 Disk (5GB) : Used for OS Installation
8 Disks (5GB) : Used for Storage

My Client Setup

Any Linux Operating system can be used.

Operating System : Ubuntu 14.04


IP Address : 192.168.0.12

Configuraton of FreeNAS and Setting up ZFS Storage

For using FreeNAS, we have to configure with proper setting after the installation completes, In Part 1
we have seen how to install FreeNAS, Now we have to define the settings that we going to use in our
environment.
Step 1: Configuring FreeNAS Basic Settings

1. Login to the FreeNAS Web UI, once you login you will see Settings and System information TAB.
Under Settings, change the Protocol of our web interface to use whether http/https and set the ip
address that we going to use for this GUI Interface and also set, timezone, Keyboard Map, Language for
GUI.

After making above changes, hit on Save button at the bottom to save the changes.

Change System Information

2. Next, setup email notification, go to the Email tab under the Settings. Here we can define the email
address to get the email notification regrading our NAS.

Before that, we have to set the email in our user account, Here Im using root as my user. So switch to
Account Menu in Top. Then choose Users, here you will see the root user, selecting root user you will
get the modify option in left side bottom corner below the users list.
Enable Email Notifications

Click on Modify User tab to enter the email address and password of the user and click OK to save the
changes.

Create Email User


3. Then switch back to Settings and choose Email to configure the email. Here Ive used my gmail id,
you can choose whatever email id that best suits you.

Enter the the username and password for authentication and save the changes by clicking on Save.

Email User Details

4. Now we need to enabled Console message in the footer, to do this go to Advanced option and
choose Show console messages in the footer and save the settings by clicking on Save.
Enable Console Message

Console Message Window


Step 2: Adding ZFS Storage Volumes

5. To add ZFS storage devices, go to the Storage Menu in the Top to define the ZFS volumes. To add a
ZFS volume, select ZFS Volume Manager.

ZFS Volume Manager

Next, add a new name for your volume, Here Ive defined as tecmint_pool. To add the available disks,
click on + sign and add the disks. There are totally 8 drives available now, add them all.
Add ZFS Storage Disks

6. Next, define the Raid levels to use. To add a RaidZ (same a Raid 5), click on drop down list. Here
Im adding two disk as the spare drive too. If any one of the disk fails spare drive will automatically
rebuild from the parity informations.

Define Raid5 on ZFS Disks

7. To add a RAIDz2 with double parity, you can choose the Raidz2 (same as RAID 6 with double
parity) from the drop menu.
Define Raid6 on ZFS Disks

8. Mirror means cloning the same copy of each drive with better performance and data guarantee.

Define Mirror on ZFS Disks


9. Stripe a single data to multiple disks. If we loose any one of the disk, We will loose the whole
volume as useless. We wont loose any capacity in total number of disks.

Define Stripe on ZFS Disks

10. Here Im going to use RAIDZ2 for my setup. Click on Add Volume to add the selected volume
layout. Adding the Volume will take little time according to our drive size and system performance.
Add ZFS Disks

11. After adding volumes, you will get the volume list as shown below.

ZFS Storage Disks

Step 3: Creating ZFS Datasets

12. Data-set is created inside the volume, which we have created in above step. Data-sets are just like
folder with compression level, Share type, Quota and much more features.

To create a Data-set choose the volume tecmint_pool at the bottom and choose Create ZFS data-set.

Choose a data-set name, here Ive chosen tecmint_docs, and select compression level from the list and
select a share type, here Im going to create this share for a Linux machine, so here Ive selected the
share type as Unix.

Next, enable Quota by clicking on advance menu to get the Quota. Let me choose 2 GB as my Quota
Limit for this share and click on add Data-set to add.
Create ZFS Datasets

13. Next, we need to define permissions on tecmint_docs share, this can be done by using Change
Permission option. To do we have to choose the tecmint_docs, at the bottom and define the
permissions.

Set Permissions on ZFS Datasets


Here Im defining permission for root user. Select Permission recursively to get the same permission
for every files and folders which created under the share.

ZFS Dataset Permissions

14. Once ZFS datasets are created for Unix share, now its time to create a data-set for windows. Follow
the same instructions as explained above, the only change is to select share type as Windows while
adding the data-set. Those shares can be accessible from windows machines.

Step 3: Sharing ZFS Datasets

15. To share ZFS datasets on Unix machines, go to Sharing tab from the Top menu, choose the
Unix(NFS) type.
Share ZFS Datasets

16. Next, click on the Add UNIX (NFS)Share, a new window will popup to give a comment (Name)
as tecmint_nfs_share and add authorized networks 192.168.0.0/24. Note, this will be differ for your
network.

Next, select All Directories to allow to mount every directory under this share. At bottom choose the
Browse and choose the directory tecmint_docs which we have define for the data-set before and then
click on OK.
Add Unix Share

Unix Share Directory View

17. After clicking on OK a confirmation message will prompt and ask Would you like to enable this
service will be shown. Click Yes to enable the sharing. Now we can see that NFS service has been
started.
NFS Share Enabled

Enabled NFS Share

Step 4: Mounting NFS Share on Unix Client

18. Now login to your Unix client machine (Here Ive used Ubuntu 14.04 and with IP Address
192.168.0.12), and check whether NFS share from FreeNAS works or not.

But, before checking FreeNAS NFS shares, your client machine must have NFS package installed on
the system.

# yum install nfs-utils -y [On RedHat systems]


# sudo apt-get install nfs-common -y [On Debian systems]
Install NFS Package

19. After NFS installed, use the following command to list the NFS share from FreeNAS.

# showmount -e 192.168.0.225

Check FreeNAS NFS Share

20. Now, create a mount directory under /mnt/FreeNAS_Share in Client machine and mount the
FreeNAS NFS Share in this mount point and confirm it using df command.

# sudo mkdir /mnt/FreeNAS_Share


# sudo mount 192.168.0.225:/mnt/tecmint_pool/tecmint_docs /mnt/FreeNAS_Share/

Mount FreeNAS NFS Share

21. Once NFS share is mounted, go inside that directory and try to create a file under this share to
confirm that the root user having permissions to this share.

# sudo su
# cd /mnt/FreeNAS_Share/
# touch tecmint.txt
Create File in NFS Share

Step 5: Finally Save FreeNAS Settings

22. Now go back to the FreeNAS web UI and choose Settings under system TAB to save the changes.
Click on save config to download the configuration file.

Save FreeNAS Configuration


23. Next, click on Upload config to choose the downloaded db file and choose the file and click
upload.

Download FreeNAS Configuration

After clicking on upload config system will reboot automatically and our settings will be save.

FreeNAS Rebooting

Thats it! we have configured the storage volume and defined a NFS share from FreeNAS.
Conclusion

FreeNAS provide us Rich GUI interface to manage the Storage server. FreeNAS support a large file-
system using ZFS with data-set which included compression, Quota, permission features. Lets see how
to use the FreeNAS as a Streaming server and torrent server in future articles.

Potrebbero piacerti anche