Today, I’m going to guide you through the process of creating an iSCSI target / extent on FreeNAS-9. This will also work on previous versions of FreeNAS, such as version 7 and 8. There are a few different ways you can go about creating an iSCSI share. You can dedicate an entire device (Hard drive, or RAID array) to the iSCSI share, or you can simply create a Volume, and create multiple iSCSI shares and each is simply a file on the volume. This approach works well because you can use part of a volume as an NFS share, part of it as a CIFS share for Windows, and if you want a few separate iSCSI targets you can just create a single file for each. Lets get started.
How to create an iSCSI Target / Share on FreeNAS
First, we need to add a volume using your hard drive or RAID array that is connected to your FreeNAS server. If you have already done this, you can skip this step. Let’s get started with the rest.
Log into your FreeNAS web interface, and go to Storage > Volumes > Volume Manager. Fill in a volume name (make sure it starts with a letter, and NOT a number, otherwise you will get an error). Add one or more of your Available Disks (by clicking the + sign). Select a RAID type if you wish to do so. In my case, I’m using hardware RAID, so I will leave the default (single drive stripe, IE, JBOD). Now click Add Volume.
Now that we have added a volume, we can begin the process of creating an iSCSI share. This process required multiple steps, in the following order:
- Add a Portal
- Add an Initiator
- Add a Target
- Create an Extent (the file that corrasponds to the iSCSI share)
- Link the Target and the Extent together
- Start the iSCSI service