[Guide] How to Create iSCSI Storage Disks in FreeNAS 0.8

Create iSCSI Storage Disks in FreeNAS 0.

FreeNAS is a great open source Operating System to make a physical or virtual computer as a full fledged network storage.  That could be easy for testing and learning purpose at your home or office testing lab. The latest version of FreeNAS is having totally different interface to manage and create iSCSI disks than earlier versions. This guide shows how to create iSCSI storage disks in FreeNAS 0.8 and connect from other hosts.

Sysprobs already covered a guide on how to install FreeNAS 0.8 on virtualbox as a virtual machine. This can be used to serve as a iSCSI server for the testing purpose on Network Access Storage (NAS), install Operating Systems in network drives, failover clustering and live migrations etc.

 

Here are the steps to create iSCSI storage disks in FreeNAS 0.8

1) Download and install FreeNAS as explained in earlier guide.

2) You must add the second hard disk (or partition) to use as iSCSI storage disk. I have added one more virtual hard disk to my virtualbox virtual machine.

Create iSCSI Storage Disks in FreeNAS 0.

Here we will create two iSCSI disks ( each 4GB) from this 8GB added disk.

3) Add the volume as shown below.

Create iSCSI Storage Disks in FreeNAS 0.

Storage –> Add Volume –> Provide a volume name –> Select the disk you want to add to Volume pool –> File System.

Press Add Volume and make sure its listed in volumes list.

storage virtualization

For some reasons, my 8GB disk detected as 6.3GB only. So, we can create 2 iSCSI disks with 3GB size.

4) If you like you can change the ‘Target Global Base Name’ under iSCSI settings. Otherwise, leave with existing example name. I changed as below.

storage virtualization

5) Add portal in next step. You can leave the default or provide the IPv4 address of FreeNAS virtual machine. In my case it is 10.10.27.41, so I can add 10.10.27.41:3260 in portal filed, but I left if with default 0 values.

storage virtualization

6) Add the Authorized Initiator now. You can go with default option ‘ALL’, if more security is required then insert the particular network in Authorized network, like 10.10.27.0/24

nas on desktop virtualization software

 

7) Now we need to create Targets, Extends and match them in Associated Targets. We have to repeat the same steps for each iSCSI disks we are going to create.

Create a target first,

nas on desktop virtualization software

Do the same step again for second target, I gave the name ‘disk2’.

two targets

8.) Add extends now. ‘Path to the extend’ filed should contain mounted storage name (Created in Step 3) with extended name. I have allocated 3GB as below.

 

extend

Do it again for second extend because we are creating two iSCSI disks in FreeNAS 0.8. ‘extend2’ is my second name.

extend2

9) Go to ‘Associated Targets’ and match the targets and extends we have created earlier.

associated targets

Repeat the same step again for other targets and extends.

associated targets all

10) We are almost done, but the important part is still pending, which is enabling iSCSI service in FreeNAS 0.8, it was disabled by default. Go to ‘Services’ and Click on OFF to make it ON in iSCSI.

enable iscsi

 

Now your iSCSI storage disks in FreeNAS 0.8 is ready to connect from other hosts. Here are the connected iSCSI disks from my physical host Windows XP.

connected iscsi disks

If you are looking to make Windows 2008 R2 failover cluster by FreeNAS iSCSI disks, then I suggest to read the below guide.

Windows 2008 R2 Failover Cluster with FreeNAS

There are more guides available here at Sysprobs on FreeNAS, VMWare and VirtualBox.

Its really great to have a NAS (Network Access Storage) setup in testing or production environment without buying physical hardware and software.

I’m hoping the final release of FreeNAS 0.8 will not have major interface changes, therefore this guide will be suitable for final release too.

As usual, if this guide is useful and you face any issues on this method, feel free to drop a comment.

2 thoughts on “[Guide] How to Create iSCSI Storage Disks in FreeNAS 0.8”

  1. Firstly, great guide.

    I’m very new to all this stuff and am using this guide in a race to create a functional failover server, having previously known nothing about them 🙂

    i would like to point out a small point i think is worth mentioning. in step 8, it is important to include the MB in the Extent Size field. if not, you won’t anything is wrong until windows gives you write protected errors when trying to format the drives.

    cheers again for a very helpful guide.

  2. First of all, thanks for the article. When I first opened FreeNAS 8.0 I had no idea what I should be doing to create iscsi disks. This helped a lot.

    One small thing: you constantly write about ‘extends’, this should be ‘extents’.

    I found out that you can’t create a ZFS disk on a disk that’s smaller than 2GB, you get an error in the interface: Error: [MiddlewareError: Unable to GPT format the disk “da1”]. The disk size needs to be at least 2GB. This is probably related to the following point.

    I also discovered that every disk loses about 2GB when you create a ZFS partition. When checking ‘gpart show’, I saw that there was a ‘freebsd-swap’ partition (size 2GB) on the disk . So that’s where the lost data is going to. I haven’t found a way yet to disable the creation of this partition.

Comments are closed.