Go to main content

Managing Devices in Oracle® Solaris 11.4

Exit Print View

Updated: November 2020
 
 

How to Create a Logical Unit

The logical unit provider for creating disk-type LUs is called sbd. However, you must initialize the storage for the logical unit before you can share a disk-type LU.

The disk volume provided by the server is referred to as the target. When the LU is associated with an iSCSI target, it can be accessed by an iSCSI initiator.

The process for creating SCSI LUs is as follows:

  • Initialize the storage for the LU, also known as the backing store.

  • Create a SCSI LU by using the backing store.

When a LU is created, it is assigned a global unique identifier (GUID), for example, 600144F0B5418B0000004DDAC7C10001. The GUID is used to refer to the LU in subsequent tasks, such as mapping a LU to select hosts.

The following steps are completed on the system that is providing the storage device.

  1. Create a ZFS storage pool.
    target# zpool create sanpool mirror c2t3d0 c2t4d0
  2. Create a ZFS volume to be used as a SCSI LU.
    target# zfs create -V 2g sanpool/vol1
  3. Create a LU for the ZFS volume.
    target# stmfadm create-lu /dev/zvol/rdsk/sanpool/vol1
    Logical unit created: 600144F0B5418B0000004DDAC7C10001

    You can find the device path for the ZFS volume in the /dev/zvol/rdsk/pool-name/ directory.

  4. Confirm that the LU has been created.
    target# stmfadm list-lu
    LU Name: 600144F0B5418B0000004DDAC7C10001
  5. Add the LU view.

    This command makes the LU accessible to all systems.

    target# stmfadm add-view 600144F0B5418B0000004DDAC7C10001

    If you want to restrict the LU view to specific systems, see How to Restrict Logical Unit Access to Selected Systems.

  6. Verify the LU configuration.
    target# stmfadm list-view -l 600144F0B5418B0000004DDAC7C10001
    View Entry: 0
    Host group   : All
    Target group : All
    LUN          : 0