Opensolaris SAN ZFS+ISCSI

Posted by Dark Training on January 6, 2010 tags: | solaris | zfs

One of the really powerful features of Opensolaris when compared to Linux is the ZFS file system. While you can learn a LOT more about it here for this tutorial I am going to be focusing on how to setup a vanila install to allow ISCSI SAN style storage. Credit where credit is due, I learned alot from the following sites:

  • prefetch.net
  • probably.co.uk
  • </p>

    First (and oddly left out of most tutorials) you'll need to install the following packages:

    pkg install SUNWiscsitgt<br />
    pkg install SUNWiscsi

    Now we are going to create a empty disk (LUN) to store our data.

    zfs create -V 1G pool/lun-name

    Obviously replace "pool" with your zfs storage pool name (zpool list) and "lun-name" with your desired LUN name. Now we need to set the LUN to be shared out over ISCSI:

    zfs set shareiscsi=on pool/lun-name

    You can check the result with:

    iscsitadm list target

    That's it, you can now use a tool like the Microsoft ISCSI initiator (found here) or ISCSI initiator for Linux and your off to the races! Mount the new drive, format and your ready to rock. In a future tutorial I'll cover some more specifics on tuning and ZFS raid1z etc.