在Linux上使用tgt透過iSCSI模擬DVD燒錄機,Windows客戶端無法錄製

在Linux上使用tgt透過iSCSI模擬DVD燒錄機,Windows客戶端無法錄製

我正在嘗試使用 Ubuntu 22.04 中的“tgt”iSCSI 目標守護程序(Ubuntu 儲存庫中的版本為 1.0.80)來模擬 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

這是整個過程中產生的唯一日誌條目。

有什麼問題的建議,或者我應該採取其他步驟來調試這個問題嗎?

相關內容