Tgt: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
Zeile 1: Zeile 1:
=Install=
+
=Installieren von TGT=
*apt-get install tgt
+
==Ubuntu/Debian==
=Create an empty target=
+
*sudo apt-get update
*tgtadm --lld iscsi --op new --mode target --tid 1 -T iqn.2021-10.xinux.org:disks
+
*sudo apt-get install tgt
 
+
=Fedora/Redhat=
=Create a LUN for the target=
+
*sudo yum install scsi-target-utils
*tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /mnt/md0/luns/lun0
+
=Erstellen einer Datei für das iSCSI-Target=
 
+
*dd if=/dev/zero of=/mnt/target1.img bs=1M count=10240und Dateinamen.
=Set/Add a new ACL rule=
+
=Erstellen des iSCSI-Target=
*tgtadm --lld iscsi --op bind --mode target --tid 1 -I 10.80.0.0/13
+
*tgtadm --lld iscsi --mode target --op new --tid 1 --targetname iqn.2023-06.com.example:target1
=Show Targets=
+
=Binden Sie die Datei an Ihr iSCSI-Target=
*tgtadm --lld iscsi --op show --mode target
+
*tgtadm --lld iscsi --mode logicalunit --op new --tid 1 --lun 1 --backing-store /mnt/target1.img
<pre>
+
=Aktivieren Sie das iSCSI-Target=
Target 1: iqn.2021-10.xinux.lan:disks
+
*tgtadm --lld iscsi --mode target --op bind --tid 1 --initiator-address ALL
    System information:
+
=Überprüfen des iSCSI-Target=
        Driver: iscsi
+
*tgtadm --lld iscsi --mode target --op show
        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
 
            SWP: 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: 21475 MB, Block size: 512
 
            Online: Yes
 
            Removable media: No
 
            Prevent removal: No
 
            Readonly: No
 
            SWP: No
 
            Thin-provisioning: No
 
            Backing store type: rdwr
 
            Backing store path: /mnt/md0/iscsi/disk-1.img
 
            Backing store flags:
 
    Account information:
 
    ACL information:
 
        10.80.0.0/13
 
</pre>
 
 
 
 
 
 
 
=Links=
 
*http://inqbus-hosting.de/support/dokumentation/docs/target-daemon-tgtd-tgtadm
 
*https://www.cyberciti.biz/tips/howto-setup-linux-iscsi-target-sanwith-tgt.html
 

Version vom 24. Juni 2023, 20:16 Uhr

Installieren von TGT

Ubuntu/Debian

  • sudo apt-get update
  • sudo apt-get install tgt

Fedora/Redhat

  • sudo yum install scsi-target-utils

Erstellen einer Datei für das iSCSI-Target

  • dd if=/dev/zero of=/mnt/target1.img bs=1M count=10240und Dateinamen.

Erstellen des iSCSI-Target

  • tgtadm --lld iscsi --mode target --op new --tid 1 --targetname iqn.2023-06.com.example:target1

Binden Sie die Datei an Ihr iSCSI-Target

  • tgtadm --lld iscsi --mode logicalunit --op new --tid 1 --lun 1 --backing-store /mnt/target1.img

Aktivieren Sie das iSCSI-Target

  • tgtadm --lld iscsi --mode target --op bind --tid 1 --initiator-address ALL

Überprüfen des iSCSI-Target

  • tgtadm --lld iscsi --mode target --op show