1
掛載 SMB
系統管理員 edited this page 2026-03-06 06:07:28 +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.

1. 安裝 CIFS 工具

apt update && apt install -y cifs-utils

2. 建立 SMB 驗證檔

nano /root/.smbcredentials

(內容如下)

username=SMB帳號
password=SMB密碼
domain=WORKGROUP

設定權限

chmod 600 /root/.smbcredentials

3. 掛載 SMB 資料夾

nano /etc/fstab

(加入以下內容)

//<SMB主機位址>/emby /mnt/ds918/emby cifs credentials=/root/.smbcredentials,uid=100000,gid=100000 0 0

uid=100000,gid=100000對 unprivileged LXC container 很重要,這樣權限會對應到 container 內的 root 使用者id 100000

若是 privileged container可用 uid=0,gid=0

nano /etc/pve/lxc/<ctid>.conf

(加入以下內容)

mp0: /mnt/ds918/emby,mp=/emby

4. 建立掛載的資料夾

mkdir -p /mnt/ds918/emby

5. 重新掛載資料夾

systemctl daemon-reload
mount -a