How to Create a ZFS Volume SCSI Logical Unit

How to Create a ZFS Volume SCSI Logical Unit

ZFS, a file system that is part of OpenSolaris, combines the functionality of a file system and a volume manager. ZFS enables you to easily create storage pools and volumes that can provide data services, such as RAID, mirroring, snapshots, clones, and much more. For more information about ZFS, see the Solaris ZFS Administration Guide.

The following procedure initializes a ZFS volume and creates a logical unit as a backing store. In this example, the zpool uses six disks. The disks are located in the /dev/rdsk directory. The disks are labeled by ZFS, so they contain a single large slice and the data is dynamically striped across a slice. See the zpool(1M) man page for more information.

  1. Create a RAID-Z storage pool.
    # zpool create pool_1 raidz c0t0d0 c0t1d0 c0t2d0 c0t3d0 c0t4d0 spare c0t5d0
    
  2. Create a 100–Gbyte volume named zvol1.
    # zfs create -V 100G pool_1/vol_1
    
  3. Create a logical unit using the volume.
    # sbdadm create-lu /dev/zvol/rdsk/pool_1/vol_1
    
    Created the following LU:
    
                  GUID                    DATA SIZE           SOURCE
    --------------------------------  -------------------  ----------------
    6000ae40980000000000486a6f930002      107374116864     /dev/zvol/rdsk/pool_1/vol_1
    
  4. Verify the creation of the logical unit.
    # sbdadm list-lu
    

Where to Go Next

Labels

task task Delete
smallsiteadmin smallsiteadmin Delete
configuring configuring Delete
storage storage Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. May 22, 2009

    enriqueflores says:

    step #4 should be changed from: # sbdadm list -lu to # sbdadm list...

    step #4 should be changed from:

    # sbdadm list -lu
    

    to

    # sbdadm list-lu
    

    I ran into the following when trying to run sbdadm list -lu :

    #
    # sbdadm list -lu
    sbdadm: invalid subcommand
    Usage:  sbdadm -?,-V,--help
    Usage:  sbdadm create-lu [-?]
    Usage:  sbdadm delete-lu [-?]
    Usage:  sbdadm import-lu [-?]
    Usage:  sbdadm list-lu [-?]
    Usage:  sbdadm modify-lu [-?]
    #
    #
    # sbdadm list-lu
    
    Found 1 LU(s)
    
                  GUID                    DATA SIZE           SOURCE
    --------------------------------  -------------------  ----------------
    600144f01be68a0000004a1790e80001      107374116864     /dev/zvol/rdsk/data/scsi/lun000
    #
    #
    
    1. Jun 23

      DenaSteward says:

      You are correct, Enrique. I have updated Step #4 to remove the space. Thanks!

      You are correct, Enrique. I have updated Step #4 to remove the space. Thanks!

  2. Jun 17

    ccyflai says:

    Does it require to set shareiscsi property for ZFS volume in order to be an iSCS...

    Does it require to set shareiscsi property for ZFS volume in order to be an iSCSI target?

    # zfs set shareiscsi=on pool_1/vol_1
    
    1. Jun 23

      DenaSteward says:

      Hi. You should not set the shareiscsi property on a ZFS volume if you are using ...

      Hi. You should not set the shareiscsi property on a ZFS volume if you are using COMSTAR. Doing so can activate the old user-space target which will cause unpredictable behavior.

Sign up or Log in to add a comment or watch this page.


The individuals who post here are part of the extended Sun Microsystems community and they might not be employed or in any way formally affiliated with Sun Microsystems. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Sun nor any other party necessarily agrees with them.

Copyright 1994-2009 Sun Microsystems, Inc.
Powered by Atlassian Confluence
Sun Guidelines on Public Discourse Privacy Policy Terms of Use Trademarks Site Map Employment Investor Relations Contact