by July 16, 2006 0 comments



Network Attached Storage, or NAS boxes have become a necessity for just about
every organization today. Even the most entry-level NAS boxes can cost you more
than a Lakh. If you’re on a tight budget, or would like to get a feel of a NAS
box before choosing a commercial product, then you can build your own using an
open-source software called FreeNAS. We used it to build a 1.3 TB NAS box based
on an ordinary PC and SATA drives. The machine had an AMD Athlon 64 X2 CPU with
512 MB RAM, four SATA drives and a LAN card. Out of these, four were of 500 GB
capacity, and one of 80 GB.

FreeNAS supports all the commonly used protocols on the network, such as CIFS
(samba), FTP, NFS, RSYNC and AFP protocols. It supports software RAID (levels 0,
1, and 5) and requires less than 16 MB disk space.

Direct
Hit!
Applies
to:
IT Managers
USP:
Build your own fully featured NAS box using FreeNAS 0.66, with support for CIFS, FTP, NFS, RSYCD, SSHD and AFP
Links:
www.freenas.org 
Google
keywords:
software NAS

The installation
Boot your machine from the ISO image of the software, and you’ll get a list of
nine options (see the following screenshot). From these nine options, select the
seventh option ‘Install On HD/CF/USB Key’. 

This will lead you to two more options ‘Install on HD, CF or USB key:
Create one UFS partition’ and ‘Install on HD: Create two UFS partitions (FreeNAS
and DATA)’. Both options are pretty much self-explanatory. You can’t use the
drive in which FreeNAS has been installed for storage, but you can do so in the
second option. As we were already using five drives, we used the second option.

Next it asks to select the source CD drive, from where the installer can read
the installation files. In our case, it was ‘acd0’. You will be shown a list
of HDDs along with their device names.

Here select the destination HDD that you want to install and then boot
FreeNAS from. In our case we used the 80 GB HDD for the job.
The complete installation process takes some time to create the file system and
copy files on the selected HDD. After installation, it shows the main menu where
you can select the fifth option to reboot the system. Once the system has
booted, you’re ready to configure FreeNAS.

Network setup
Now, you need to configure the NAS box for your network. From the menu, select
the first option and enter the name of your Ethernet interface (fxp0 in our
case) and press Enter. It will prompt you to reboot.

Once the machine has rebooted, the menu will come up again on your screen.
Select 2 and enter your IP address settings (192.168.5.100 and /24 in our case).
Then from the same menu select 6 and ping another network device on the subnet
to test network connectivity.

Configuration
In order to configure the NAS box, open a Web browser from any node and type the
NAS box’s IP address that you just defined in the step above. You will be
asked for a username and password.

Cost
estimate of our NAS
 
Equipment
Cost   
(Rs)
P4 2.8 GHz machine with 512 MB
RAM (without monitor and keyboard)   
11,000
4 x 500 GB SATA     64,000
20 GB IDE
Drive   
 1,600
Total    76,600

 

By default, username is admin and password is freenas. On successful
authentication, it will open a Web interface of your NAS device.

The Web page shows a navigation tree on the left side of the page and on the
right side the data entry part is displayed.

From here, you can configure and manage the entire operation of your NAS box.

Configuring disks
Now comes the important part-configuring the remaining disks in a RAID
configuration of your choice. Make sure all drives you’re using in the NAS box
are of the same size. If you’re configuring RAID 5, which is usually the most
commonly used option, then four drives are recommended, one of which would be
completely consumed by RAID, and only three drives would be used for data
storage. In addition to software RAID levels 0, 1, and 5, FreeNAS also supports
hardware RAID.

We were able to build a NAS box with 1.3 TB storage, RAID level 5, and integrate it successfully into an Active Directory domain

To configure RAID on FreeNAS, first you need to allocate the drives to your
NAS box. For this, add disks one by one, by clicking Disks/Management page of
the NAS interface and then clicking on the ‘+’ sign on the right hand side.
It will open an ‘Add Disk’ page, where you have to select the drives that
you want to add in your NAS box-in our case the disk device names were ad1,
ad2, ad3, and a4. After adding the disks, they should appear in the table and
the Status should be Online.

Now, from the same page click on the Format tab and from the drop down,
select the drive you want to format and then select Software RAID as the file
system and click on the ‘Format Disk’ button.

We were configuring RAID 5, so we had to format all the disks one by one in
the same way as mention above. After formatting all disks, click on the
Disks/Software RAID page and click on the ‘+’ sign on the right hand side to
add a new RAID. Give your RAID a name, and select the type (RAID 5 in our case).
Then select each of the drives from the list that needs to be used in this RAID
array. Once you have created the disk array, it will show the RAID array in the
list with Status shown as Up.

Open the ‘Format RAID’ tab and enter the RAID volume name. Choose the
format type as ‘UFS’, and click on ‘Format Disk’ button. Once the RAID
array is formatted, all that is left is to mount the RAID array.

To do this, open the ‘Disk/Mount Point’ page and click on the ‘+’ on
the right hand side. Then from the Disk drop down, select the RAID volume name
that you have configured previously. Set ‘Mount Point’ partition to ‘Software
RAID’, set File System UFS and give a share name for your RAID volume and
click on Save. With this your NAS box is ready to serve your network.

Configuring file sharing
FreeNAS supports all the common file sharing protocols, such as CIFS (samba),
FTP, NFS, RSYCD, SSHD and AFP file sharing services. CIFS is used for Windows
file sharing over the network, which is what we configured. For this, open the
NAS interface from a Web browser and select the services/CIFS and select the
enable check box.

Leave all other fields to their default values for the moment. You can tweak
them later. Click on the Save button, and your NAS box will be available to all
the Windows machines on your network. For example, to test the NAS share, go to
any Windows node and click on Start>Run and type \\ followed by the NAS box’s
IP address.

Security of the NAS box
FreeNAS gives you two types of security in this version, Local User access and
Active Directory based authentication. Though it has provision for NIS and
RADIUS authentication as well, it’s not operational in this version. For the
Local User level, you have to create users and groups by clicking on
Access/Users and Groups page. Here, select the Groups tab and click on the ‘+’
sign to add a group. Then click on the User tab to add users and assign users to
the groups you just created.

Click on Add and Apply changes. If you are using CIFS (Samba) for the file
services, go to the services/CIFS from the NAS Web interface and change the
authentication to ‘Local User’. If you are using ADS on your network, you
have to change the CIFS authentication to Domain. Then select MS Active
Directory and fill in the entries such as your ADS server name, its IP address,
the domain name, and ADS administrative username and password. Your NAS box will
now get authenticated from an active directory domain.

Disaster recovery
Let us now see how fast the NAS can recover data in case of a disk failure. For
this, we removed one of the 500 GB drives and replaced it with another
one. 

The NAS software RAID automatically detected the change and was able to
rebuild the entire RAID 5 volume in 15 to 20
minutes and even go back online.

As you would have seen from this, FreeNAS is a useful software to build your
own NAS boxes. It has all the standard features once would expect from a NAS
software, and is lightweight as well. The fun is not over yet. In the next
issue, we also compare its performance with a branded NAS box.

Sanjay Majumder

No Comments so far

Jump into a conversation

No Comments Yet!

You can be the one to start a conversation.

Your data will be safe!Your e-mail address will not be published. Also other data will not be shared with third person.