Techno Blog Just another Technology Blog


Create iSCSI Target

This article outlines the steps to install packages needed and set up an iSCSI target on Linux.

  1. Install SCSI Target Utils
  2. $ yum install scsi-target-utils

  3. Create target
  4. $ tgt-setup-lun -n tgt-1 -d /dev/sdb

    Where /dev/sdb is the disk to share and and are the IP's of the servers where the initiators will be.

  5. Start tgtd
  6. $ /etc/init.d/tgtd start

  7. Show all the targets
  8. $ tgt-admin -s
    Target 1:
        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
                Online: Yes
                Removable media: No
                Backing store type: rdwr
                Backing store path: None
            LUN: 1
                Type: disk
                SCSI ID: IET     00010001
                SCSI SN: beaf11
                Size: 2147 MB
                Online: Yes
                Removable media: No
                Backing store type: rdwr
                Backing store path: /dev/sdb1
        Account information:
        ACL information:

  9. Make persistent
  10. $ chkconfig tgtd on
    $ /bin/cat <<xxEOFxx > /etc/rc.local
    tgt-setup-lun -n tgt-1 -d /dev/sdb

Related Posts

Create iSCSI Initiator

Filed under: Linux, SCSI Leave a comment
Comments (0) Trackbacks (0)

No comments yet.

Leave a comment

No trackbacks yet.