| 50 | |
| 51 | == tgt.confの設定 == |
| 52 | tgtadminで逐一設定するのは面倒。/etc/tgt/targets.confで下記のように設定することもできる。 |
| 53 | {{{ |
| 54 | <target iqn.2008-09.com.example:server.target1> |
| 55 | backing-store /var/iscsi/disk.img |
| 56 | </target> |
| 57 | }}} |
| 58 | 設定後、tgtdをリロードする。 |
| 59 | {{{ |
| 60 | # service tgtd reload |
| 61 | }}} |
| 62 | ディスクが作られているか確認する。 |
| 63 | {{{ |
| 64 | # tgtadm --ll iscsi --op show --mode target |
| 65 | Target 1: iqn.2008-09.com.example:server.target1 |
| 66 | System information: |
| 67 | Driver: iscsi |
| 68 | State: ready |
| 69 | I_T nexus information: |
| 70 | I_T nexus: 1 |
| 71 | Initiator: iqn.1994-05.com.redhat:3db1a6cd082 |
| 72 | Connection: 0 |
| 73 | IP Address: 127.0.0.1 |
| 74 | LUN information: |
| 75 | LUN: 0 |
| 76 | Type: controller |
| 77 | SCSI ID: IET 00010000 |
| 78 | SCSI SN: beaf10 |
| 79 | Size: 0 MB, Block size: 1 |
| 80 | Online: Yes |
| 81 | Removable media: No |
| 82 | Prevent removal: No |
| 83 | Readonly: No |
| 84 | Backing store type: null |
| 85 | Backing store path: None |
| 86 | Backing store flags: |
| 87 | LUN: 1 |
| 88 | Type: disk |
| 89 | SCSI ID: IET 00010001 |
| 90 | SCSI SN: beaf11 |
| 91 | Size: 105 MB, Block size: 512 |
| 92 | Online: Yes |
| 93 | Removable media: No |
| 94 | Prevent removal: No |
| 95 | Readonly: No |
| 96 | Backing store type: rdwr |
| 97 | Backing store path: /var/iscsi/disk.img |
| 98 | Backing store flags: |
| 99 | Account information: |
| 100 | ACL information: |
| 101 | ALL |
| 102 | }}} |