
Ubuntu 22.04 (Ubuntu のリポジトリのバージョン 1.0.80) の「tgt」iSCSI ターゲット デーモンを使用して DVD+R レコーダーをエミュレートしようとしています。
空のファイル /tmp/cdimage を作成し、/etc/tgt/conf.d/test.conf に以下を追加して設定しました。
<target iqn.2024-1.com.example:test1>
backing-store /tmp/cdimage
device-type cd
</target>
次のコマンドを使用して、デバイスに追加のパラメータを手動で設定しました(ドキュメントから抜粋)ここ):
tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 1 --params vendor_id=STGT_DVD,product_id=DVD101,product_rev=0010,scsi_sn=$SN,removable=1
この最終結果は、次のように生成されたターゲットの説明ですtgtadm --lld iscsi --op show --mode=target
。
Target 1: iqn.2024-1.com.example:test1
System information:
Driver: iscsi
State: ready
I_T nexus information:
I_T nexus: 2
Initiator: iqn.1991-05.com.microsoft:furrina alias: none
Connection: 1
IP Address: 192.168.1.111
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: cd/dvd
SCSI ID: IET 00010001
SCSI SN: XYZ123
Size: 0 MB, Block size: 1
Online: Yes
Removable media: Yes
Prevent removal: No
Readonly: No
SWP: No
Thin-provisioning: No
Backing store type: mmc
Backing store path: /tmp/cdimage
Backing store flags:
Account information:
ACL information:
ALL
Windows iSCSI イニシエーターを使用して接続でき、Windows が DVD レコーダーに接続されていると認識するドライブ文字がマップされているため、そこにファイルを書き込むことができますが、書き込もうとすると、「このディスクの書き込み中にエラーが発生しました。ディスクは使用できなくなっている可能性があります。」というエラーが表示されてすぐに失敗します。このエラーが発生すると、ディスクを変更するまで書き込みプロセスを再開できなくなります。ディスクの変更は、次のコマンドを使用して行います。
tgtimg --op new --device-type cd --type dvd+r --file /tmp/emptycd2.iso
tgtadm --tid 1 --lun 1 --op update --mode=logicalunit --params path=/tmp/emptycd2.iso
(必要に応じてファイル名を変更します)
これを実行すると、次のログ エントリが表示されます。
Jan 24 21:02:30 ubuntu-lxc-1 tgtimg[1318]: DVD+R /tmp/emptycd2.iso being created
これは、プロセス全体で生成される唯一のログ エントリです。
何が問題なのか、またはこれをデバッグするために実行する必要がある追加の手順について何か提案はありますか?