Creating iSCSI LUN’s….

Logical Unit Numbers (LUNs) link previously defined storage objects with a target. The kernel target exports SCSI Logical Units to remote systems. Use the targetcli shell to link previously defined storage objects with a target and to specify which Logical Unit Number (LUN) the device uses.

The following example uses the create command to create two new LUNs for a target. From the targetcli shell, begin by using the cd command to change to the LUNs directory within the <target/TGP> hierarchy.

/> cd iqn.2003-01.org.linux-iscsi.host02.x8664:sn.3abca38b994f/tpg1/luns

/iscsi/iqn.20…94f/tpg1/luns>

The following commands create two LUNs from the previously defined block storage objects.

/iscsi/iqn.20…94f/tpg1/luns> create /backstores/block/LUN_1 lun1

/iscsi/iqn.20…94f/tpg1/luns> create /backstores/block/LUN_2 lun2

Use the ls command to view the LUNs.

/iscsi/iqn.20…94f/tpg1/luns> ls

o- luns ………………………………………. [LUNs: 2]

o- lun1 ……… [block/LUN_1 (/dev/xvdd) (default_tg_pt_gp)]

o- lun2 ……… [block/LUN_2 (/dev/xvde) (default_tg_pt_gp)]]