新增 掛載 SMB
67
%E6%8E%9B%E8%BC%89-SMB.md
Normal file
67
%E6%8E%9B%E8%BC%89-SMB.md
Normal file
@@ -0,0 +1,67 @@
|
||||
# 1. 安裝 CIFS 工具
|
||||
|
||||
```bash
|
||||
apt update && apt install -y cifs-utils
|
||||
```
|
||||
|
||||
# 2. 建立 SMB 驗證檔
|
||||
|
||||
```bash
|
||||
nano /root/.smbcredentials
|
||||
```
|
||||
|
||||
(內容如下)
|
||||
|
||||
```
|
||||
username=SMB帳號
|
||||
password=SMB密碼
|
||||
domain=WORKGROUP
|
||||
```
|
||||
|
||||
設定權限
|
||||
|
||||
```bash
|
||||
chmod 600 /root/.smbcredentials
|
||||
```
|
||||
|
||||
# 3. 掛載 SMB 資料夾
|
||||
|
||||
```bash
|
||||
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
|
||||
|
||||
```bash
|
||||
nano /etc/pve/lxc/<ctid>.conf
|
||||
```
|
||||
|
||||
(加入以下內容)
|
||||
|
||||
```
|
||||
mp0: /mnt/ds918/emby,mp=/emby
|
||||
```
|
||||
|
||||
# 4. 建立掛載的資料夾
|
||||
|
||||
```bash
|
||||
mkdir -p /mnt/ds918/emby
|
||||
```
|
||||
|
||||
# 5. 重新掛載資料夾
|
||||
|
||||
```bash
|
||||
systemctl daemon-reload
|
||||
```
|
||||
|
||||
```bash
|
||||
mount -a
|
||||
```
|
||||
Reference in New Issue
Block a user