Pluralsight blog Where devs, IT admins & creative pros go for news, tips, videos and more.
3,500+ tech & creative courses authored by experts - unlimited & online Get it now →
January 19, 2009

How to Setup iSCSI Drive Using FreeNAS

By

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.

How Does iSCSI Work?

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.

Setup iSCSI Target Drive on FreeNAS Server

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.

How to Setup iSCSI Drive Using FreeNAS - 1

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

How to Setup iSCSI Drive Using FreeNAS - 2

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.

How to Setup iSCSI Drive Using FreeNAS - 3

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.

How to Setup iSCSI Drive Using FreeNAS - 4

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

How to Setup iSCSI Drive Using FreeNAS - 5

6. Click on the plus sign in the Extent area.

How to Setup iSCSI Drive Using FreeNAS - 6

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.

How to Setup iSCSI Drive Using FreeNAS - 7

8. When you get back to the iSCSI Target page click on Apply changes.

How to Setup iSCSI Drive Using FreeNAS - 8

9. Click on the plus sign in the Target area.

How to Setup iSCSI Drive Using FreeNAS - 9

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.

How to Setup iSCSI Drive Using FreeNAS - 10

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

How to Setup iSCSI Drive Using FreeNAS - 11

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.

How to Setup iSCSI Drive Using FreeNAS - 12

The iSCSI Target drive is now setup and ready for use.

Setup iSCSI Initiator on Vista

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.

How to Setup iSCSI Drive Using FreeNAS - 14

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

How to Setup iSCSI Drive Using FreeNAS - 15

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

How to Setup iSCSI Drive Using FreeNAS - 16

6. Click on Add Portal…

How to Setup iSCSI Drive Using FreeNAS - 17

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

How to Setup iSCSI Drive Using FreeNAS - 18

8. Click on the Targets tab.

How to Setup iSCSI Drive Using FreeNAS - 19

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

How to Setup iSCSI Drive Using FreeNAS - 20

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.

How to Setup iSCSI Drive Using FreeNAS - 21

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

How to Setup iSCSI Drive Using FreeNAS - 22

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

How to Setup iSCSI Drive Using FreeNAS - 23

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.

How to Setup iSCSI Drive Using FreeNAS - 24

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

How to Setup iSCSI Drive Using FreeNAS - 25

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.

How to Setup iSCSI Drive Using FreeNAS - 26

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

How to Setup iSCSI Drive Using FreeNAS - 27

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.

How to Setup iSCSI Drive Using FreeNAS - 28

18. Review the settings selected and then click Finish.

How to Setup iSCSI Drive Using FreeNAS - 29

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.

How to Setup iSCSI Drive Using FreeNAS - 30

Summary

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.

About the Author

(MCTS, MCP, A+) has been working in the IT field since leaving the U.S. Army in 1996.  Working his way up from printer hardware repair to running a corporate datacenter for a multinational corporation, Dave has seen many environments throughout the years. Focusing on web sites and search engine optimization the last few years, with the release of Server 2008 it has renewed his passion for the Wintel platform and server technologies. David also runs Windows-Server-Training.com where he posts free videos and walk-throughs for a variety of server technologies. David currently works as a freelance technical consultant and writer for a variety of companies in the Chicago area.

Author's Website: http://www.DaveLawlor.com


Discussion