Category Archives: FreeNAS

FreeNAS – Upgrades and a corrupted USB stick

FreeNAS – Upgrades and a corrupted USB stick

Last week I decided it was probably time to finally upgrade my FreeNAS server from 11.2 U2 to 11.2 U7 as it was giving me rrdcache errors on shutdown and also ground to a halt when I was doing a large clonezilla backup of my machine.

Continue reading FreeNAS – Upgrades and a corrupted USB stick

FreeNAS – Speeding Up My NFS Datastore For XenServer

FreeNAS – Speeding up my NFS Datastore for XenServer

While using a nested XenServer 7.1 on VMware ESXi 6.5 to test something unrelated I noticed that running sdelete on one of my Gold Image VMs was painfully slow.  Looking on the XenServer performance I could see that the write latency was nearly 100ms to the NFS SR which would explain it being painfully slow on a VM.

Continue reading FreeNAS – Speeding Up My NFS Datastore For XenServer

FreeNAS 8.0 Dhcpd 3 – Making The Installation Persistent

FreeNAS 8.0 Dhcpd 3 – Making The Installation Persistent

As FreeNAS 8.0 has been designed to run on a USB disk any changes which are made to the server are lost after a reboot.

Mounting the root filesystem as writtable in the first article allows you to install the ISC DHCP Server to the root filesystem but in order for the changes to be permanent after a reboot, the following steps need to be performed :-

  • Logon to the FreeNAS server through SSH as root or open a shell on the console
  • Copy the isc-dhcpd daemon to the /conf/base/etc/local/rc.d folder by executing the following command :-

cp /etc/local/rc.d/isc-dhcpd /conf/base/etc/local/rc.d/.

  • Copy the rc.conf file to the /conf/base/etc folder by executing the following command :-

cp /etc/rc.conf /conf/base/etc/.

  • Copy the dhcpd.conf file to /conf/base/etc folder by executing the following command :-

cp /etc/local/dhcpd.conf /conf/base/etc/local/.

  • Copy the dhcpd folder to the /conf/base/var/db folders by executing the following command :-

cp -R /var/db/dhcpd /conf/base/var/db/.

Once the package finishes installing you then need to create the dhcpd user and group on the server.  This has to be done through the web console so that the changes remain persistent after a reboot.

To create the dhcp user and group perform the following steps :-

  • Logon to the FreeNAS Servers Web Console as the admin user
  • Expand the Account branch in the Left Hand pane
  • Expand the Users branch in the Left Hand pane and then click onView All Users
  • Click on the Group tab and then click on Add New Group
  • Create the dhcpd group as follows :-

Group ID – 136

Group Name – dhcpd

  • Click on OK to the create the group
  • Next click on the Users tab and then click on Add New User
  • Create the dhcpd user as follows :-

User ID – 136

Username – dhcpd

Primary Group – dhcpd

Shell – nologin

Full Name – DHCP Daemon

Password – password

  • Click on OK to the create the user

FreeNAS 8.0 Dhcpd 2 – Creating A Basic DHCP Configuration

FreeNAS 8.0 Dhcpd 2 – Creating A Basic DHCP Configuration

The next step in the installation of the ISC DHCP Server on a FreeNAS 8.0 server is to create the configuration file.

The steps in this article provide details of how to create a very basic DHCP configuration file which has a Pool of ten addresses.  For a more in depth explanation of the ISC DHCP Server configuration file options please see the article here

A sample dhcp.conf file can also be found under the directory /usr/local/etc/dhcpd.conf.sample which can be copied and modified for your needs.

To create a basic configuration file perform the following steps :-

  • Logon to the FreeNAS server through SSH as the root user
  • Edit the file /conf/base/etc/local/dhcpd.conf by executing the following command :-

vi /conf/base/etc/local/dhcpd.conf

  • In the new file add the following lines :-

ddns-update-style ad-hoc;

log-facility local7;

subnet {Your IP Subnet} netmask {Your netmask} {

  range {Starting IP Address of the range} {Ending IP Address of the range}

  default-lease-time 600;

  max-lease-time 7200;

}

  • Save and Exit the file

Below is an example of the above using the 192.168.0.0 IP Subnet with a netmask of 255.255.255.0

ddns-update-style ad-hoc;

log-facility local7;

  subnet 192.168.0.0 netmask 255.255.255.0 {

  range 192.168.0.10 192.168.0.20

  default-lease-time 600;

  max-lease-time 7200;

}

FreeNAS 8.0 Dhcpd 1 – Installing The DHCP Server

FreeNAS 8.0 Dhcpd 1 – Installing The DHCP Server

This article provides details on how to install the ISC DHCP Server on a FreeNAS 8.0 RELEASE server.

Installation Steps

  • Logon to the FreeNAS Server through SSH as the root user
  • Mount the root partition as read / write by executing the following command
mount -urw /
  • Change directory to the tmp directory by executing the following command
cd /tmp
  • Install the package by executing the following command
pkg_add -r isc-dhcp31-server
The installation is now complete and the next article explains how to create a basic configuration and start the DHCP Server.

FreeNAS 8.0 Dhcpd – Introduction And Pre-Requisites

FreeNAS 8.0 Dhcpd – Introduction And Pre-Requisites

Introduction And Pre-Requisites

FreeNAS is an open source FreeBSD based NAS solution which supports various ways of sharing storage on a network including CIFS (Windows shares), NFS, and iSCSI.

In order to provide an iSCSI Diskless boot environment it is recommended that the iSCSI network cards are on a separate network and one of the requirements of this is a DHCP server to present the LUNs to the clients.

In a small lab environment the DHCP Server can be installed on to a FreeNAS Server which is providing the iSCSI Disks and the following articles explain how to install and configure an ISC DHCP Server on a FreeNAS Version 8.0 RELEASE server.

The configuration of an ISC DHCP Server on a FreeNAS Version 8.0 RELEASE server can be split down in to the following sections :-

  • Installing the ISC DHCP Server
  • Configuriing the ISC DHCP Server
  • Making the changes permanent

Pre-Requisites

In order to configure the ISC DHCP Server on a FreeNAS Version 8.0 RELEASE server the following pre-requisites must be met :-

  • A FreeNAS Version 8.0 RELEASE installation
  • Access to the internet
  • SSH access enabled on the FreeNAS Server

Hardware Used

The hardware used for these articles was a Virtual Machine running on a VMware ESXi 4.0 host.

Details of the The FreeNAS Virtual Machine hardware used can be foundhere. The server has also had the following additional hardware added :-

  • An additional Network Interface connected to an iSCSI only Network
  • An additional Hard Drive 40Gb for iSCSI Deployment

FreeNAS 8.0 iSCSI 4 – Starting The ISCSI Service

FreeNAS 8.0 iSCSI 4 – Starting The ISCSI Service

Starting The iSCSI Service

The final part of the configuration of iSCSI on a FreeNAS Version 8.0 RELEASE server is to start the iSCSI Service.  To start the iSCSI service perform the following steps :-

  • Logon to the FreeNAS Web Console as an administrative account
  • Expand Services in the left hand pane
  • Click on Control Services
  • The iSCSI Service will be showing as Off (Red)
  • Click on the Off box to start the iSCSI service
  • The iSCSI Service will now be showing as On (Blue)

FreeNAS 8.0 iSCSI 3 – Configuring Targets And Extents

FreeNAS 8.0 iSCSI 3 – Configuring Targets And Extents

Configuring Targets And Extents

The final step in configuring iSCSI on a FreeNAS Version 8.0 RELEASE server is to configure the Targets and Extents.  For this article we will be configuring an iSCSI Disk Target.  An iSCSI Disk Target effectively takes one of the disks in the server and deploys it to the Initiators (Clients) as a Raw block device.  The presented iSCSI Disk will be just like a new hard disk in the Initiator (Client) machine and will require partitioning and formatting before use.

Configuring iSCSI Disk Targets

The first part of the configuration is to configure the Target required.  To configure the Target perfom the following steps :-

  • Logon to the FreeNAS Web Console as an administrative account
  • Expand Services in the left hand pane and then expand iSCSI
  • Expand the Targets branch and click on Add Target
  • Configure the Target Name to the desired name
  • Configure the Type as Disk
  • Configure the Portal Group ID as 1 (The Portal set up in the first article)
  • Configure the Initiator Group ID as 1 (The Initiator Group set up in the first article)
  • Click on OK to create the new Target

Configuring Device Extents

The next part of the configuration is to configure the Extent required on the server for our iSCSI Disk Target which is a Device Extent.  To configure the Device Extent perform the following steps :-

  • Logon to the FreeNAS Web Console as an administrative account
  • Expand Services in the left hand pane and then expand iSCSI
  • Expand the Device Extents branch and click on Add Extent
  • Configure the Extent Name to desired name
  • From the Disk Device drop down box select the disk ID required

N.B. Ensure you select the correct Disk Device ID

  • Click on OK to create the new Device Extent

Associating The Target And Extent

The final part of the configuration is to associate the Target with the Extent on the server.  To associate the Target with the Extent perform the following steps :-

  • Logon to the FreeNAS Web Console as an administrative account
  • Expand Services in the left hand pane and then expand iSCSI
  • Expand the Target / Extents branch and click on Add Target / Extent
  • From the Target drop down box select the iSCSI Disk Target required
  • From the Extent drop down box select the Device Extent required
  • Click on OK to create the new Association

FreeNAS 8.0 iSCSI 2 – Configuring The Target Global Configuration

FreeNAS 8.0 iSCSI 2 – Configuring The Target Global Configuration

The next step in configuring iSCSI on a FreeNAS Version 8.0 RELEASE server is to configure the Target Global Configuration.  To configure the Target Global Configuration perform the following steps :-

  • Logon to the FreeNAS Web Console as an administrative account
  • Expand Services in the left hand pane and then expand iSCSI
  • Expand the Target Global Configuration branch
  • Either configure the Base Name to something more meaningful for your environment or leave it set as the suggested value
  • Leave Discovery Auth Method and Discovery Auth Group as None.  This allows anonymous discovery of the iSCSI Target from all initiators.
  • Tick the Enable LUC (Logical Unit Controller) checkbox
  • Configure the Controller IP Address as 127.0.0.1
  • Configure the Controller TCP Port as 3261
  • Configure the Controller Authorised Netmask as 255.255.255.0
  • Configure the Controller Auth Method as CHAP
  • Configure the Controller Auth Group as 1 (The Authorised Access Group setup in the previous article)
  • Click on OK to save the Target Global Configuration