Setup iSCSI Target

Setting up an iSCSI Target on Fedora

This info was extracted from http://www.server-world.info and moved here for my convenience.  This was the simplest set of instructions I found that worked.  For more information please visit the link above.

# create a physical volume

[root@dlp ~]#  pvcreate /dev/sdb1 

Physical volume “/dev/sdb1” successfully created

# create a volume group named “vg_target00”

[root@dlp ~]#  vgcreate -s 32M vg_target00 /dev/sdb1 

Volume group “vg_target00” successfully created

# create a logical volume named “lv_target00”

[root@dlp ~]# lvcreate -L 80G -n lv_target00 vg_target00

Logical volume “lv_target00” created

[root@dlp ~]# yum -y install scsi-target-utils
[root@dlp ~]#  vi /etc/tgt/targets.conf
# add at the last line
# if you set some devices, add – and set the same way with follows
# naming rule : [ iqn.yaer-month.domain:any name ]

<target iqn.2013-07.world.server:target00>

# provided devicce as a iSCSI target

backing-store /dev/vg_target00/lv_target00

# iSCSI Initiator’s IP address you allow to connect

initiator-address 10.0.0.31

# authentication info ( set anyone you like for “username”, “password” )

incominguser username password

</target>

[root@dlp ~]# systemctl start tgtd.service
[root@dlp ~]# systemctl enable tgtd.service 
[root@dlp ~]# tgtadm –mode target –op show 

# show status
 
Target 1: iqn.2013-07.world.server:target00
    System information:
        Driver: iscsi
        State: ready
    I_T nexus information:
    LUN information:
        LUN: 0
            Type: controller
            SCSI ID: IET     00010000
            SCSI SN: beaf10
            Size: 0 MB, Block size: 1
            Online: Yes
            Removable media: No
            Prevent removal: No
            Readonly: No
            Thin-provisioning: No
            Backing store type: null
            Backing store path: None
            Backing store flags:
        LUN: 1
            Type: disk
            SCSI ID: IET     00010001
            SCSI SN: beaf11
            Size: 8590 MB, Block size: 512
            Online: Yes
            Removable media: No
            Prevent removal: No
            Readonly: No
            Thin-provisioning: No
            Backing store type: rdwr
            Backing store path: /dev/vg_target00/lv_target00
            Backing store flags:
    Account information:
        username
    ACL information:
        10.0.0.31
Facebooktwittergoogle_plusredditpinterestlinkedinmailFacebooktwittergoogle_plusredditpinterestlinkedinmailby feather