新增 Service:TGT

2026-03-06 02:45:58 +00:00
commit 5ec129cf36

44
Service%EF%BC%9ATGT.md Normal file

@@ -0,0 +1,44 @@
如果使用 PVE 的 CT版本需要選擇 12.X
# 安裝相關套件
```bash
apt update && apt install -y tgt lvm2
```
# 啟動 TGT 服務
```bash
systemctl enable tgt && systemctl start tgt
```
# 建立 LVM 虛擬磁碟
```bash
dd if=/dev/zero of=/root/target.img bs=1G count=0 seek=512
```
- of位置
- bs單位
- count?
- seek數量範例為 512G (bs * seek)
# 設定 TGT 服務到 LVM 虛擬磁碟
```bash
nano /etc/tgt/conf.d/target.conf
```
內容如下
```xml
<target iqn.2026-01.jsc.idv.me:target>
backing-store /root/target.img
</target>
```
# 重啟 TGT 服務
```bash
systemctl restart tgt && tgt-admin --show
```