Novell Home

HOWTO: Install FreeNAS

From Developer Community

Contents

Introduction

FreeNAS is an open source popular software appliance package that can turn a computer into a NAS appliance, or in easier terms: a file server. This guide shows the basic steps to prepare a server for use in a diskless LTSP environment.


This document is correct as of FreeNAS v0.67.1.

Full documentation on installing FreeNAS is available as a Setup and User Guide in PDF format at FreeNAS documents.


Hardware

At a minimum a basic PC with 96MB system memory, one hard disk and a network card is required. For a production site it is recommended to have a backup process in place or at the minimum use disk mirroring, also known as RAID level 1. For this configuration FreeNAS requires 3 disks, although one of them can be a compact flash card with suitable IDE adapter, minimum size 32MB which is very cheap to purchase. Most systems have four IDE adapters, allowing two regular hard disks and one compact flash drive to be attached.

For installation purposes you will need a bootable CD-ROM drive or another computer in which to insert the compact flash or hard disk drive. Only very old CD-ROM drives do not support booting, speed is not important.


One disk:
You will need a regular PC with one hard disk drive.

+


Two mirrored disks + system on compact flash:
You will need a regular PC with two hard disk drives, a compact flash IDE adapter, and a compact flash card.

+ + + +


Software Installation

There are a few choices for the actual installation of the FreeNAS appliance software. The most convenient is to burn a CD with an ISO image, here are the options available:


Burned CD Image

This method requires a blank CD-R disk and a CD-ROM or DVD-ROM device in the target machine.

+

  • Download the ISO image from the FreeNAS website.
  • Burn the ISO image to a CD using whatever tool you have available on your desktop operating system. On Windows this could be Nero, or the free ISO Recorder Power Toy, Mac OS X has the functionality built in, Linux and FreeBSD can use GnomeBaker, X-CD-Roast, or the command line cdrtools suite. Refer to the application documentation for details how to burn an ISO image as it is not simply copying the ISO file to the CD.
  • Power on your target machine, and pop in the newly burned CD.
  • Wait for FreeNAS to finish starting, you might hear the system speaker generate a beep.
  • Select the menu entry to install to HD, CF, or USB.
  • Follow the installer prompts for CD device, usually acd0, and the destination disk, usually ad0.
  • Eject the CD and reboot, if you have an older machine the drive might be locked, so reboot and when the computer starts initialising you can eject the CD.


Compact Flash Image: Media Card Reader

This method requires a media card reader in your desktop PC, either an external USB device similar to the picture or one in the computer case.

+

  • Download the IMG image from the FreeNAS website.
  • Download the physdiskwrite tool from the m0n0 project.
  • Ensure the media card reader is attached and functional.
  • Insert the compact flash card into the media card reader.
  • Follow the physdiskwrite instructions to transfer the IMG image to the compact flash card.
  • Remove the compact flash card from the media card reader.
  • Insert the compact flash card into the IDE to compact flash adapter and connect to a free IDE interface on the target machine.
  • Power on the target machine and check that FreeNAS boots from the card. You might have to alter the BIOS settings or swap IDE connectors for the machine to boot from the compact flash device instead of the hard disk drives.


Compact Flash Image: IDE Compact Flash Adapter

The IDE compact flash adapters do not support hot swap, therefore a slightly different set of steps is required.

+

  • Power off your desktop.
  • Open the case and insert the compact flash card into the IDE compact flash adapter and insert the adapter into a spair IDE connector.
  • Power on the desktop and ensure you can boot into your operating system.
  • Download the IMG image from the FreeNAS website.
  • Download the physdiskwrite tool from the m0n0 project.
  • Follow the physdiskwrite instructions to transfer the IMG image to the compact flash card.
  • Power off your desktop.
  • Remove the compact flash card and IDE compact flash adapter and insert into a free IDE connector on the target machine.
  • Power on the target machine and check that FreeNAS boots from the card. You might have to alter the BIOS settings or swap IDE connectors for the machine to boot from the compact flash device instead of the hard disk drives.


Compact Flash Image: USB IDE Adapter + IDE Compact Flash Adapter

This might work as an alternative to opening your desktop case.

+ +


Software Configuration

Once installed FreeNAS needs to be configured for your network, the disk devices installed, and finally for the services to offer.

FreeNAS menu on first boot
Enlarge
FreeNAS menu on first boot


Network Configuration

FreeNAS manages interfaces with logical names such as LAN, OPT1, OPT2, etc. via the console menu you need to configure which physical network adapter matches which logical name.

FreeNAS console setup
*********************
1) Interfaces: assign network ports
2) Set up LAN IP address
3) Reset webGUI password
4) Reset to factory defaults
5) Reboot system
6) Ping host
7) Install on HD/CF/USB Key
8) Shell
9) PowerOff system

Enter a number: 1

Type in '1 to configure the physical adapter to use for the LAN interface. FreeNAS will display a list of the interfaces that are supported. Some newer gigabit network interface cards are not supported and will not be shown.

Valid interfaces are:

lnc0    00:0c:29:86:03:e5

If you don't know the names of your interfaces, you may choose to use
auto-detection. In that case, disconnect all interfaces before you begin,
and reconnect each one when prompted to do so.

Enter the LAN interface name or 'a' for auto-detection: lnc0

The interface name is the two or three letter code followed by a number in the interface list, the code is based on the FreeBSD driver name.

Enter the Optional 1 interface name or 'a' for auto-detection
(or nothing if finished): 

Extra interfaces can now be configured or it can be performed using the web interface. Hit the Enter key to continue.

The interfaces will be assigned as follows:

LAN  -> lnc0

FreeNAS will reboot after saving the changes.

Do you want to proceed? (y/n)

Confirm the new configuration and reboot in order to assign an IP address to the LAN interface.

FreeNAS console setup
*********************
1) Interfaces: assign network ports
2) Set up LAN IP address
3) Reset webGUI password
4) Reset to factory defaults
5) Reboot system
6) Ping host
7) Install on HD/CF/USB Key
8) Shell
9) PowerOff system

Enter a number: 2

The default FreeNAS LAN IP address is 192.168.1.250 if you have a different LAN subnet or wish to assign a different address menu option 2 is for you.

Enter the new LAN IP address: 10.82.6.3

There are a set of private network addresses you can use that will not be routed to the Internet, it is recommended you use one of these for your internal network. The number used here is used in the VMware demo of the みる directory server.

Subnet masks are entered as bit counts (as in CIDR notation) in FreeNAS.
e.g. 255.255.255.0 = 24
     255.255.0.0   = 16
     255.0.0.0     = 8

Enter the new LAN subnet bit count: 24

Unless you have unusual requirements it is common to use class C networks with a 24 network address bit count.

The LAN IP address has been set to 10.82.6.3/24.
You can now access the webGUI by opening the following URL
in your browser:

http://10.82.6.3/

Press ENTER to continue.

The default login details for the webGUI are username: admin, password: freenas.

Visit the LAN interface page and enter a default gateway. The gateway provides access to the internet to allow DNS and time synchronisation.

Configuring the default gateway for the LAN interface in FreeNAS
Enlarge
Configuring the default gateway for the LAN interface in FreeNAS


Visit the general setup page and enter the IP addresses of your DNS server and local NTP server. Normally if you have a DSL or cable modem internet connection your gateway provides DNS service, check your desktop configuration for further details. A DNS configuration will allow name resolution of a time server such as the default pool.ntp.org.

Configuring DNS in FreeNAS
Enlarge
Configuring DNS in FreeNAS


Disk Configuration : One disk

FreeNAS is a file server, so we need to add some disks and sharing points. First visit the disk management page and add a new disk. This page concerns physical disks, the speed of the interface to the computer and various power management settings.

Adding a disk drive to the FreeNAS system
Enlarge
Adding a disk drive to the FreeNAS system

Once added the main management page should update with the disk details.

FreeNAS disk management screen showing all configured disks
Enlarge
FreeNAS disk management screen showing all configured disks

Now head over to the mount point page to define which disk partitions that need to be shared, add a new mount point and fill in the details. If you installed via the CD-ROM installer method you might have one or two disk partitions, on this screen the warning message indicates that the device ad0s1 contains the system image and so the second partition ad0s2 is available for data.

Adding a new partition as a mount point in FreeNAS
Enlarge
Adding a new partition as a mount point in FreeNAS

Saving brings you back to the mount point page which now shows the partition summary and status.

Mount point status screen showing newly added share
Enlarge
Mount point status screen showing newly added share


Disk Configuration : RAID

+

RAID FreeNAS requires a few steps in addition to the regular install. Each disk needs to be added to the FreeNAS system and then both need to be added to a RAID device and then that device formatted and added as a mount point for sharing. First visit the disk management page and add two new disks. The disk page concerns physical disks, the speed of the interface to the computer and various power management settings.

Adding a disk drive to the FreeNAS system
Enlarge
Adding a disk drive to the FreeNAS system

Once added the main management page should update with the disk details.

FreeNAS disk management screen showing all configured disks
Enlarge
FreeNAS disk management screen showing all configured disks

For each disk visit the format tab and select "Software RAID: Geom mirror" and format.

Formatting a disk for use in a software RAID 1 mirror
Enlarge
Formatting a disk for use in a software RAID 1 mirror

Once both disks have been formatted head over to the software RAID page, and the default screen should show "Geom mirror" and underneath "Manage RAID", select the add icon to create a RAID device using both disks.

Creating a RAID 1 mirror from two specially formatted disks
Enlarge
Creating a RAID 1 mirror from two specially formatted disks

Returning to the software RAID page should now show the new RAID device.

RAID management screen showing a new RAID 1 array called default and 8GB in size
Enlarge
RAID management screen showing a new RAID 1 array called default and 8GB in size

With the new RAID device we need to format for file usage, select the "Format RAID" tab and enter the volume name you previously entered for the RAID device.

Formatting the RAID 1 device
Enlarge
Formatting the RAID 1 device

Now head over to the mount point page to define which disk partitions that need to be shared, add a new mount point and fill in the details. The device will be the name you previously entered and the partition should be listed as "Software RAID - gmirror".

Adding a new partition as a mount point in FreeNAS
Enlarge
Adding a new partition as a mount point in FreeNAS

Saving brings you back to the mount point page which now shows the partition summary and status.

Mount point status screen using RAID 1 mirror device
Enlarge
Mount point status screen using RAID 1 mirror device


Network Service Configuration

Image:Network_services.gif

For diskless NFS operation you need to enable the NFS service, to allow Microsoft Windows desktops to access shared files you will also need to enable CIFS, Apple Mac OS X users can connect via either of the protocols or AFP.

Enabling NFS service in FreeNAS
Enlarge
Enabling NFS service in FreeNAS

In order to support NFS root you need to make one custom modification until it is supported in the mainstream release. Download a backup of the FreeNAS configuration file and edit in your favourite text editor, e.g. notepad or gedit. Add the following section inside the <system> stanza, replacing the network parameters as appropriate. Note that the ampersand and quotation marks are escaped in order to validate as correct XML.

<shellcmd>echo &quot;/mnt/common -alldirs -network 10.82.6.0 -mask 255.255.255.0
-maproot=root&quot; &gt; /var/etc/exports &amp;&amp; killall -hup mountd</shellcmd>

Restore the new configuration file and FreeNAS will reboot and use the new configuration which is now ready for a diskless LTSP deployment.

Novell® Making IT Work As One

© 2008 Novell, Inc. All Rights Reserved.