FreeNAS installation

technology: 

FreeNAS is an interesting way of storing data at lower cost than dedicated NAS hardware. Here is my experience of installing FreeNAS. I originally used version 0.686b2 from 2007. Currently I am experimenting with version 0.7.1 and will update this article for the shiny new easier to use version.

Your hardware should not be relevant outside of the disks but FreeNAS is based on BSD instead of Linux and is not as up to date in hardware support. The computer monitor and keyboard are used only to install FreeNAS then assign a network address. After that, you do everything through the Web interface. You can disconnect the display and keyboard until you make a major reconfiguration requiring changes to the BIOS.

Use a minimum configuration at first. You could use just one disk to get through the initial installation. On some installations it just bombed out. One of my test computers worked for a while then overheated, possibly because of the disk load, and FreeNAS started doing weird things. The problem during the first install to disk is that the process runs for a long time with no meaningful messages. You can minimise the hardware load until you get past the installation of FreeNAS to your boot disk then access FreeNAS from the Web and check the device health then load more disks and check the health again.

An alternative is to check the temperature and voltage in the BIOS while adding more hardware. Check the temperature rise over 10 or 20 minutes because that is how long it will take FreeNAS to reach a stage where it displays useful information.

This installation started by recycling a machine with three disks as RAID 5. One disk was faulty so was removed and the RAID array rebuilt as RAID 1.

Test machine

Display: 1920*1200*60
Memory: 8GB
Network: Realtek RTL8111/8168B PCI Express Gigabit Ethernet Controller
Processor: AMD Athlon 64 X2 Dual Core 4000+
Disks:
1 * 1GB USB memory stick
3 * 500GB SATA (Was RAID 5 then became 2 * 500GB as RAID 1)
USB DVD drive for installation

BIOS

Remove potential hardware compatibility issues by disabling all the hardware you will not use in a NAS. Audio chips cause a lot of pain in the Unix so switch off the audio chip first. We are using only SATA drives because the old PATA drives are too old to be reliable.

Integrated Peripherals:
On chip IDE: [Disabled]
On chip SATA: [Enabled]
On chip SATA Type: [AHCI]
On chip Audio: [Disabled]
On chip Parallel: [Disabled]
On chip Serial: [Disabled]
Advanced BIOS features:
Boot sequence:
Put the USB DVD first for the install then the disks next.
Hard Disk Boot Priority:
Put the USB memory stick at the top of the list.

Install freeNAS to the memory stick

Boot from the USB CD drive. There will be a long wait while FreeNAS loads from CD, then you will see a menu with Option 1, the default, to boot from the CD so that you can install on disk. Go get a soda while the system grinds away because it will wait only 5 seconds then boot and go through another long process.

You are then presented with several installation steps.

1/ Assign Interfaces
This turns out to be Configure LAN interface and you do not have to do anything if you have the standard single network connection chip.

If your computer is new, you may need the network chip MAC address to configure the router for the computer. The MAC address is displayed in option 1. A MAC address looks like 00:f8:9c:53:76. My router displays the MAC of any unknown device on the network and I do not have to use Option 1 to see the MAC.

2/ Set LAN IP Address

You select DHCP and let your router supply an IP address. You will be asked if you want to use IPv6. Just accept the default. FreeNAS will then display the IP address for the NAS box.

9/ Install or Upgrade.

Install "embedded" OS on hard disk/Flash/USB drive. During the install it will ask you which CD drive to read and which storage device will receive FreeNAS.

At the end you remove the CD and reboot. I found the software reboot from FreeNAS dis not work and I had to perform a hardware reboot. The hardware reboot was a chance to remove the USB CD drive.

After the hardware reboot you can access FreeNAS from the Web. use another computer to access FreeNAS by IP address. The default address is 192.168.1.250. My router assigned 191.168.0.198 so I used 192.168.0.198. freeNAS maintained 192.168.1.250 across a software reboot then changed to 192.168.0.198 after the hardware reboot.

After the reboot you will see the following menu options.

  • System
  • Network
  • Disks
  • Services
  • Access
  • Status
  • Diagnostics
  • Advanced
  • Help

System

System contains the following sections.

  • General
  • Advanced
  • Firmware
  • Backup/Restore
  • Factory defaults
  • Reboot
  • Shutdown
  • Logout

General

General

Change the General settings then select Save to save the changes.

Hostname

Hostname: P2nas
Domain: local (the default)

DNS settings

The defaults from the router DHCP are ok.

WebGUI

The defaults are fine.

Time

Time zone: Set to your time zone. For example: Australia/Sydney
Enable NTP: [*] then accept the defaults for the server pool.

Password

Change the password from the default if your NAS contains anything of value. Anyone can easily grab the contents by booting from the CD and changing the password. You are just stopping them grabbing control across the network. If your NAS box is locked in a room with restricted access, then few people can attempt a boot from CD. You could also remove the USB CD drive boot option and add a BIOS boot password to slow down attempts to boot from CD.

Eventually you would have to move the memory stick inside the case and have case intrusion set on to monitor attempts to boot in unusual ways.

Save your changes.

Advanced

Advanced contains the following sections. You have to set your email details before you can send warning email from S.M.A.R.T. and other areas.

  • Advanced
  • Email
  • Proxy
  • Swap
  • Command scripts
  • Cron
  • rc.conf
  • sysctl.conf

Email

Set up your email details here. Test the email settings. Where it says From email, it also means To. The test sends from example@example.com to example@example.com. There is no option to test nas@example.com to example@example.com.

From email: me@example.com (Your own email address)
Outgoing mail server: mail.example.com
Port: 25
Security: none
Authentication: [ ] Enable SMTP authentication.

[Save]
[Send test email]

You should get the message Test email successfully sent.

Network

Disks

Management

Management

You can hit that plus sign to add disks. We will perform this three times to add our three disks then hit the button to apply the changes.

Disk: select the first hard disk on the list. The only other disk will be the memory stick.
Description: RAID 3 disk 1 of 3
Transfer mode: (Leave as the default auto)
Hard disk standby time: 10 minutes
Advanced Power Management: Level 1 - Minimum power usage with Standby (spindown)
Acoustic level: Disabled
S.M.A.R.T.: [*] You always want SMART reporting.
S.M.A.R.T. extra options: (leave empty)
Preformatted file system: unformatted (we will format it later.)

[add] (to add this disk then go to the next)
[Apply changes]

Remember this page. If you change the disk configuration, remove a disk, swap cables around or anything, you may need to visit Disks, Management, Management, and select [Rescan disks]. The rescan will take a while if something is missing and will take a long time for each disk. On occasions a rescan is the only way to may FreeNAS update the list of available disks. You might have to plug in a screen and keyboard then visit the machine's BIOS to change the disk configuration. The rescan will display something like the following.
Command output:
Resetting channel ata0
Resetting channel ata1

S.M.A.R.T.

Switch on SMART using the [*] Enable box in the top right hand corner.

Power mode: Standby

Scheduled self-tests: (Add each disk with Long Self-Test. You can change it later)
An example Short Self-Test for a working disk is shown in FreeNAS installation Short self-test.
An example Long Self-Test for a broken disk is shown in FreeNAS installation Long self-test.

Email report: [*] Activate
To email: me@example.com
Test email: [*] to send a test email on startup. keep this on until you are happy everything is working.

iSCSI Initiator

Format

You have to format the disks before moving on to creating a RAID array.

Disk: select the first disk then repeat for the other two.
File system: Software RAID
Don't Erase MBR: [ ]
[Format disk]

Software RAID

I installed three disks as RAID 5 then had errors with one disk so removed the bad disk and joined the other two disks as RAID 1. First the description of RAID 5 then the description of RAID 1.

When you select Software RAID, you have the following choices. We visit only RAID 5 and RAID 1. RAID is explained in RAID. JBOD is Just a Bunch Of Disks and concatenates disks the same way you concatenate disks in Microsoft NT and early Windows Pro versions. RAID 0 is sometimes exactly the same and sometimes adds striping. The FreeNAS RAID 0 adds striping. Remember that RAID 0 is not RAID because it has no redundancy, the R in RAID.

  • JBOD
  • RAID 0
  • RAID 1
  • RAID 5
  • RAID 0/1/5

RAID 5

Management

Raid name: data (yeah, imaginative.)
Type: RAID 5 (rotated block-interleaved parity) (the only option)
Provider: (Select all three)
Initialize: [*]

[Apply changes]

You will see a status of Rebuilding.

The first time through here I had one disk fail initialisation and the array ended up marked degraded.
I went to Diagnostics, Log, and the log showed the following error several times.
kernel: ad8: FAILURE - READ_DMA status=51 error=40 LBA=2258176
The last message about the disk was:
kernel: GEOM_RAID5: data: ad8(1): pre-remove disk due to errors.

RAID 1

You are presented with three headings.

  • Management
  • Tools
  • Information

Encryption

ZFS

Mount Point

Status

You can get status reports emailed to you.

  • System
  • Process
  • Interfaces
  • Disks
  • Graph
  • Email report

Disks

This report is almost useless. When I had the disk error, it said all disks were online and the RAID array was degraded. There was no indication of the disk problem and you could not select more detail.

Email report

This example is the one I used after spotting a disk error.

Email Report: [*] Enable
To email: me@example.com, you@example.com
Subject: Status report from %h on %d
Reports
[ ] System info
[ ] System message buffer
[ ] System log
[ ] FTP log
[ ] RSYNC log
[ ] SSHD log
[*] S.M.A.R.T. log
[ ] Daemon log
[Send now]

The resultant email is in FreeNAS installation Status report email.

You can send the report now or set a polling time then hit [Save and restart]. You will then get an email at the interval set in polling time.

Diagnostics

The Diagnostics section includes the log. Look in here regularly until your system is stable and you have warning email working.

Log

Visit the Settings section first to change the log display to put the most recent message first.

Log

Settings

[*] Show log entries in reverse order (newest entries on top)
Number of log entries to show: 50
Resolve IP addresses to hostnames: [ ] (You probably know your few local IP addresses)
[ ] Enable syslog'ing to remote syslog server (Use this when you have several NAS devices across several networks)

Comments

dear Peter, we have installed freenas (KHASADAR) version single HD and are facing a problem. we make our company's backup on it but whenever we copy files we don't want any file to change its date or time but it happens that all the files , folders and sub folders chnage their date+time to the same as the current time on freenas server.
we want freenas server to keep the original dates of these files saved and not chnage of this type. we are backing up windows XP based PCs files on freenas.
what should we do? please guide in detail if you can because i am a bad learner.

Hello Shujaat,
I replaced FreeNAS on my test NAS computer and cannot look at the date change problem. I access other storage using FTP and dates appear to stay the same when copying to Windows but may change when copying to Linux. Filezilla will preserve dates when copying to Linux but only if you turn on a special option and the FTP target supports MFTM. I think the Linux Ext3 file system creates the current date then Filezilla uses MFTM to change the data. FreeNAS might have to perform a similar trick and might have a similar option.

Ext3 has a creation date and a modification date and, optionally, an access date. Other file systems have different collections of date/times. You will have to research FreeNAS, the underlying OS, and the file system. If FreeNAS has support forums then look there first. Please report back your success because it is useful for anyone performing backups by file copies.