Clone
1
Service:TGT
Jeffery edited this page 2026-03-06 02:45:58 +00:00
This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

如果使用 PVE 的 CT版本需要選擇 12.X

安裝相關套件

apt update && apt install -y tgt lvm2

啟動 TGT 服務

systemctl enable tgt && systemctl start tgt

建立 LVM 虛擬磁碟

dd if=/dev/zero of=/root/target.img bs=1G count=0 seek=512
  • of位置
  • bs單位
  • count?
  • seek數量範例為 512G (bs * seek)

設定 TGT 服務到 LVM 虛擬磁碟

nano /etc/tgt/conf.d/target.conf

內容如下

<target iqn.2026-01.jsc.idv.me:target>
    backing-store /root/target.img
</target>

重啟 TGT 服務

systemctl restart tgt && tgt-admin --show