Monday, 21 May 2012

How To Share A Disk Using iSCSI

Here's how to share a disk using iSCSI from a RHEL 6 server.
Note that this is the most basic way of setting iSCSI up and is really only useful for familiarisation of using iSCSI clients.

  • Create an LVM logical volume on the desired disk. In this example /dev/sdb 
pvcreate /dev/sdb
vgcreate vg_sdb /dev/sdb
lvcreate --extents 100%FREE --name lv_sdb vg_sbd 
  • Install the iSCSI apps & daemon and start it up 
yum install scsi-target-utils
service tgtd start
chkconfig tgtd on 
  • Add an entry to /etc/tgt/targets.conf to make the disk available.
<target iqn.2012.05.net.home:san.target1>
backing-store /dev/vg_sdb/lv_sdb
</target> 
  • Open the iSCSI ports on the firewall
tcp / udp 3260 & tcp / udp 860

That's it, the disk should now be discoverable as iqn.2012.05.net.home:san.target1.
There is no security set on the disk so you should be able to just log into it.

No comments:

Post a Comment