I recently wrote an article on how to setup a NAS using the open source FreeNAS software.
One of the many features of FreeNAS is the ability to setup an iSCSI drive. iSCSI stands for Internet SCSI and allows client machines to send SCSI commands to remote storage servers such as FreeNAS.
This allows you to consolidate your storage drives into a single machine for lower cost per GB and easier maintenance, with the illusion of local disk drives on your client machines. The functionality to use iSCSI drives is built into both Windows Vista and Server 2008 natively. At the higher end you can also use iSCSI for low cost clustering solutions and disaster recovery.
In the past this was usually done using special hardware and Fibre cabling, though with iSCSI you can leverage your existing network infrastructure.
It should be noted that depending on the network load and performance requirements of your servers this can be drastically slower than the dedicated options. For a high performance production application you can still use iSCSI but I would look at setting it up on its own network at 1GB speeds.
There are two parts to the iSCSI protocol, the first being clients and the second being storage devices.
Clients are called iSCSI initiators and can be configured either using hardware or software solutions. As I mentioned earlier this functionality is already built into Vista and Server 2008, so we will not have to add any software/hardware to these machines.
The storage devices are called iSCSI targets and must be running some type of software/hardware to receive the incoming requests from the iSCSI initiators. Luckily FreeNAS has the ability to create iSCSI drives as part of its core package so I am going to use the FreeNAS server I used in a past demo.
I’m going to use FreeNAS as the iSCSI target, and if you are going to follow along with this demo, it is imperative that you have one setup as well.
If you don’t you can read how to setup FreeNAS server and then come back to this article for the next steps.
This demo is going to assume that while the hard drives are installed in the server they are NOT added to the FreeNAS interface.
1. Connect to your FreeNAS server through the WebGUI using your favorite browser. In the top menu select Disks, then click Management.

2. Click on the plus sign in the lower right corner to add drives.

3. Next to Disk, choose the drive you want to add from the drop down, and if you want enter a description for it next to Description.
I usually leave the rest of the settings at default then click Add.
4. When you go back to the Disk Management screen you will be asked to confirm the addition by clicking on Apply changes, go ahead and do that now.

5. From the top menu choose Services, then iSCSI Target.

6. Click on the plus sign in the Extent area.
7. The Bolded fields are required, so place a name in the Extent name field, leave the Type as Device, and then choose the Device you want in the dropdown.
You can also enter a note in the comment field for reference. When you have set your options click on Add.

8. When you get back to the iSCSI Target page click on Apply changes.
9. Click on the plus sign in the Target area.
10. As before the Bolded fields are required. Here is a breakdown of the fields:
Target name: Add your own or leave the default
Flags: RW for Read/Write or RO for Read Only
Storage: Will have the extents listed that were setup, choose the one you want to use
Authorized Network: Enter the IP network that can access this drive. For example if your IP was 192.168.1.100, you would enter 192.168.1.0. Most people will leave the 24 in the dropdown if your subnet mask is 255.255.255.0
Once you fill in all the info click on Add.

11. Back at the iSCSI target page you need to click on Apply changes once again.

12. Now place a check in the box next to Enable in the top right corner and then click Save and Restart in the bottom left.

The iSCSI Target drive is now setup and ready for use.
Now that the iSCSI target drive is ready, let’s go in and configure our Vista client machine to use it.
1. Click on the Start menu and type iSCSI into the menu bar and hit Enter.
2. Depending on your settings you may get a UAC warning, go ahead and approve if you do.
3. If this is the first time you are using iSCSI you will get a warning that the iSCSI service is not running and it is asking if you want to start the service and also have it automatically start with your computer. Go ahead and click Yes.

4. The next window that appears will ask if you want to unblock the Microsoft iSCSI service in Windows Firewall. Click on Yes.

5. When the iSCSI Initiator Properties appears click on the Discovery tab.

6. Click on Add Portal…

7. Place the IP address of the iSCSI target in the text field labeled IP address or DNS name: and then click OK.

8. Click on the Targets tab.

9. Highlight the target drive listed and click Log on…

10. In the next window you can choose to have this connection restored when the computer starts by placing a checkmark next to that option. If you don’t then leave it blank. Either way click Ok.

11. You should now see a status of Connected, confirm that and then click Ok.

12. Click on Start, right click on Computer, then click on Manage.

13. If you get a UAC warning, click through. You will now see the Computer Management MMC, click on Disk Management and in a few seconds the disks will populate.
Disk 1 is the iSCSI drive and you can see that it shows up unallocated. Right click on the drive and select New Simple Volume.
NOTE: If the disk drive was formatted previously you might have to Delete partition first.

14. When the New Simple Volume Wizard starts go ahead and click Next.

15. Set the size of the volume you want to create; in this demo I am using all the space. After you set the space click Next.

16. Assign a drive letter, for this demo I am using F; then click Next.

17. I am going to format this drive as NTFS and place a check next to Perform a quick format. You can also assign a volume label, then click Next.

18. Review the settings selected and then click Finish.

19. Depending on the speed of the network and the size of the drive it may take some time to format. When it is finished you will see it ready to go in Disk Management.

We have setup a iSCSI target drive in FreeNAS and then setup an iSCSI initiator in Windows Vista to attach to the FreeNAS drive. After that we configured the drive for use on our Vista machine by formatting it and assigning a drive letter.
While not for everyone, iSCSI definitely has its uses and if it is suitable for your environment and needs, FreeNAS provides a low cost alternative.
Copyright © Train Signal Inc. All Rights Reserved.
Gary Sims Says:
January 20th, 2009 at 6:03 am
Thanks for an excellent guide, I have blogged about it at http://www.learnfreenas.com/modules/news/article.php?storyid=54
Thanks, Gary
Scottt Says:
January 26th, 2009 at 2:03 pm
After setting up the system per your recommendation I get an error code 1 when selecting the check mark for the enable in step 12. I look at the log and it says it is failing to start the ISCSI service. Any ideas.
Bas Says:
February 2nd, 2009 at 9:21 am
Great guide, I’m a total newby with freenas but this makes it easy.
@Scotty: I had the same problem, but then I discovered I allready mounted the iSCSI device somewhere else. Deleted this an after that no error code 1 anymore.
Sam Says:
February 8th, 2009 at 8:15 am
Hi Im having the same problem as Scottt. Any ideas ? Thanks
Giorgio Says:
February 9th, 2009 at 1:13 pm
for Scottt problem ‘…error code 1 when selecting the check mark for the enable iSCSI Target…’ you must umount disks then check mark and it works.
FreeNAS Setup for my Home Environment | redmutt.com Says:
March 20th, 2009 at 2:22 pm
[...] up my Vista machines and laptop access so I can do quick transfers on the fly when needed. Here is a good write up on how to setup the iSCSI services within FreeNAS. I may also setup my VMware [...]
Shankar Says:
April 1st, 2009 at 3:26 pm
Thanks for the guide
it is wonderful
once again thank u very much
Iggy Says:
April 3rd, 2009 at 9:08 am
Very cool and useful guide. I do have one question for you that I can’t figure out.
Let’s say I get all the way to Step 19 (where the drive is mounted and functioning).
How do I unmount it gracefully and then disconnect from the target?
I can’t find this info anywhere on the ‘net. I’ve tried the “mountvol F: /d” command and that ‘unmounts’ F:, but I cannot logoff the session (using the Targets tab of the iSCSI Initiator Properties panel). I get an error: “The session cannot be logged out since a device on that session is currently being used.”
I’m using Vista Enterprise on my client machine.
Thanks,
Iggy
Emre CAN Says:
September 21st, 2009 at 6:42 am
Hello thank you for this excellent tutorial.
Im hoping to get a solution from experts here,
My problem is, windows does not start to “New Simple Volume Wizard” because, Windows itself can not find the iSCSI disk no matter how much i clicked tru “rescan disks”
What would you suggest?
Sincerely,
Emre.
Iceberg Titanic Says:
October 23rd, 2009 at 8:08 am
Hi folks -
To unmount the devices, so that you can enable the iSCSI service, go to the Disks menu, and select Mount Point. You can unmount drives there.
Paul Says:
November 8th, 2009 at 12:51 pm
The new version has just been released and I have never used FREENAS before and loved this tutorial. The version 7 has implemented some changes with regards to iSCSI Target and I am a bit confused. Would love to see a revised turorial based on the FreeNAS .7
Thanks in advance
Ash Says:
December 2nd, 2009 at 11:47 pm
Error code 1 is owning me. Tried unmounting, makes absolutely no difference.
jonthegimp Says:
December 4th, 2009 at 11:30 am
Ash
It depends on what version you have – I was able to fix mine with the following:
http://sourceforge.net/apps/phpbb/freenas/viewtopic.php?f=53&t=4854
Hope that helps, it is a frustrating problem.
Kakunka Says:
December 8th, 2009 at 7:42 am
Guys:
This is for Vanilla XP
First, go to Control Panel Select Administrative Tools
Now Select Services
Make sure Logical Disk Manager and Logical Disk Manager Administrative Services
are started, right click and select start.
Now
Check that Microsoft ISCSI Initiator Service is started (same deal)
Now make sure ISCSI is up using the MS ISCSI initiator as he specs above
( run C:\WINDOWS\system32\iscsicpl.cpl )
Okay close out Services go back to Admin Tools
Now select Computer Management
under Storage select Disk Management
The disk will appear with a red no go icon
right click and select initialize
Now right click and select partition and format and select Drive letter. . .
“voila” as they say in Frogland. . . Drive should appear in your Win Explorer window
K.
vinzzz Says:
January 19th, 2010 at 3:36 pm
Hi I have a question regarding iSCSI. I bought a NAS so i can centralize my data. While my data is centralized, i want to index my networkshares on the NAS, so i can quickly find files, metadata etc.
Windows 7 doesnt allow indexing networkshares.
Is iSCSI a solution for my situation? Can the data still resist on my NAS, available for all computers in my LAN, and still trick windows that i have a local drive of 1.5TB (actually the disk on the NAS) ?
powpow Says:
February 4th, 2010 at 1:28 pm
Hey Iggy,
This error is likely being caused by a open file or shared folder pointing to a location on that target.
Under My Computer | Manage | Shared Folders | Shares, stop any shares that point to that target.
Dan Says:
February 20th, 2010 at 2:34 pm
First I’d like to compliment you on your outstanding tutorials I have just recently started working with iSCSI and FreeNAS and you’ve really given me a good education over the past two days. SO on to my question…Out of personal and business curiosity I’ve been trying to make my FreeNAS drive available through the internet. Is this possible? I can see the target from a remote network however when I try to log on i get a connection failed error. I can connect and transfer data just fine on my local network it’s the WAN part that’s giving me a hard time.
Thanks,
-Dan