iSCSI

LINUX Loop Device

You can create a loopback or iSCSI file using dd. The following example creates a file with an initial size o 0 bytes and a allocated size of 8Gb.

dd if=/dev/zero of=LUN3 bs=1000 count=0 seek=$[1000*1000*8]

Mount the file using the following command.

mount -o loop /path/to/file /path/to/mountpoint

 

Open-iSCSI Commands

Discover, Login & Mount Drives

Display all iSCSI targets on give ip-address.

iscsiadm --mode discovery --type sendtargets --portal 192.168.1.250

Connect to a give target.  

iscsiadm --mode node --targetname iqn.1994-04.org.netbsd.iscsi-target:target0 --portal 192.168.1.250:3260 --login

Close connection to a iSCSI target.

iscsiadm --mode node --targetname iqn.1994-04.org.netbsd.iscsi-target:target0 --portal 192.168.1.250:3260 --logout

Mount a iSCSI disk with lable ISCSI-0 on directory ‘/mnt/iscsi-0’.

mount /dev/disk/by-label/ISCSI-0 /mnt/iscsi-0

 

Node records

Display node records.

iscsiadm --mode node
iscsiadm --mode node --targetname iqn.1994-04.org.netbsd.iscsi-target:target0 --portal 192.168.1.250:3260