Tgt: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
Thomas (Diskussion | Beiträge)
 
(19 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
=Install=
=Installieren von TGT=
*apt-get install tgt
==Ubuntu/Debian==
=Show Targets=
*sudo apt-get update
*tgtadm --lld iscsi --op show --mode target
*sudo apt-get install tgt
=Create an empty target=
=Fedora/Redhat=
*tgtadm --lld iscsi --op new --mode target --tid 1 -T iqn.2021-10.xinux.lan:disks
*sudo yum install scsi-target-utils
*tgtadm --lld iscsi --op show --mode target
=Erstellen der Images=
<pre>
*dd if=/dev/zero of=/mnt/target1.img bs=1G count=5
Target 1: iqn.2021-10.xinux.lan:disks
*dd if=/dev/zero of=/mnt/target2.img bs=1G count=5
    System information:
*dd if=/dev/zero of=/mnt/target3.img bs=1G count=5
        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
            SWP: No
            Thin-provisioning: No
            Backing store type: null
            Backing store path: None
            Backing store flags:
    Account information:
    ACL information:
</pre>


=Links=
=Erstellen des iSCSI-Target=
*http://inqbus-hosting.de/support/dokumentation/docs/target-daemon-tgtd-tgtadm
*tgtadm --lld iscsi --mode target --op new --tid 1 --targetname iqn.2023-06.com.tuxmen:target1
*tgtadm --lld iscsi --mode target --op new --tid 2 --targetname iqn.2023-06.com.tuxmen:target2
*tgtadm --lld iscsi --mode target --op new --tid 3 --targetname iqn.2023-06.com.tuxmen:target3
 
=Binden iSCSI-Targets=
*tgtadm --lld iscsi --mode logicalunit --op new --tid 1 --lun 1 --backing-store /mnt/target1.img
*tgtadm --lld iscsi --mode logicalunit --op new --tid 2 --lun 2 --backing-store /mnt/target2.img
*tgtadm --lld iscsi --mode logicalunit --op new --tid 3 --lun 3 --backing-store /mnt/target3.img
 
=Aktivieren Sie das iSCSI-Target=
*tgtadm --lld iscsi --mode target --op bind --tid 1 --initiator-address ALL
*tgtadm --lld iscsi --mode target --op bind --tid 2 --initiator-address ALL
*tgtadm --lld iscsi --mode target --op bind --tid 3 --initiator-address ALL
 
=Überprüfen des iSCSI-Target=
*tgtadm --lld iscsi --mode target --op show

Aktuelle Version vom 24. Juni 2023, 20:46 Uhr

Installieren von TGT

Ubuntu/Debian

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

Fedora/Redhat

  • sudo yum install scsi-target-utils

Erstellen der Images

  • dd if=/dev/zero of=/mnt/target1.img bs=1G count=5
  • dd if=/dev/zero of=/mnt/target2.img bs=1G count=5
  • dd if=/dev/zero of=/mnt/target3.img bs=1G count=5

Erstellen des iSCSI-Target

  • tgtadm --lld iscsi --mode target --op new --tid 1 --targetname iqn.2023-06.com.tuxmen:target1
  • tgtadm --lld iscsi --mode target --op new --tid 2 --targetname iqn.2023-06.com.tuxmen:target2
  • tgtadm --lld iscsi --mode target --op new --tid 3 --targetname iqn.2023-06.com.tuxmen:target3

Binden iSCSI-Targets

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

Aktivieren Sie das iSCSI-Target

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

Überprüfen des iSCSI-Target

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