Document Youtarr SMB storage mount
This commit is contained in:
parent
cdd4874bf1
commit
e2f62deb2d
3 changed files with 51 additions and 31 deletions
|
|
@ -51,8 +51,9 @@ for media servers. Run all commands from the repository root.
|
||||||
|
|
||||||
If this stack runs inside a Proxmox LXC, bind-mount
|
If this stack runs inside a Proxmox LXC, bind-mount
|
||||||
`/mnt/unas/youtube_downloads` into the container before starting Docker.
|
`/mnt/unas/youtube_downloads` into the container before starting Docker.
|
||||||
The current UNAS NFS export maps writes through its anonymous owner, so the
|
The Proxmox host mounts this share over SMB with
|
||||||
dedicated privileged LXC runs Youtarr with upstream's default root UID/GID.
|
`/etc/unas-smb-credentials` and maps it to UID/GID `0`. The dedicated
|
||||||
|
privileged LXC therefore runs Youtarr with upstream's default root UID/GID.
|
||||||
|
|
||||||
4. Render the template:
|
4. Render the template:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# LXC Boot Dependencies — NFS and NVIDIA
|
# LXC Boot Dependencies — Network Mounts and NVIDIA
|
||||||
|
|
||||||
Two things must be ready on the Proxmox host before LXC 101 (arr-stack)
|
Two things must be ready on the Proxmox host before LXC 101 (arr-stack)
|
||||||
can start: the UNAS NFS mount and the NVIDIA device nodes. Both are
|
can start: the UNAS NFS mount and the NVIDIA device nodes. Both are
|
||||||
|
|
@ -80,38 +80,38 @@ After any change: `systemctl daemon-reload`
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Per-container NFS fix (future containers)
|
## Per-container network-mount fix (future containers)
|
||||||
|
|
||||||
Every LXC that mounts a UNAS NFS share via `mp` **and** has `onboot: 1`
|
Every LXC that bind-mounts a UNAS NFS or SMB share via `mp` and has `onboot: 1`
|
||||||
needs its own drop-in. Run these commands on Proxmox right after creating
|
needs its own drop-in. Run these commands on Proxmox right after creating
|
||||||
the container (substitute the real CT ID and mount name):
|
the container (substitute the real CT ID and mount name):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
CTID=<id>
|
CTID=<id>
|
||||||
NFS_UNIT=mnt-unas-<mountname>.mount # see table below
|
MOUNT_UNIT=mnt-unas-<mountname>.mount # see table below
|
||||||
|
|
||||||
mkdir -p /etc/systemd/system/pve-container@${CTID}.service.d
|
mkdir -p /etc/systemd/system/pve-container@${CTID}.service.d
|
||||||
cat > /etc/systemd/system/pve-container@${CTID}.service.d/nfs-deps.conf << EOF
|
cat > /etc/systemd/system/pve-container@${CTID}.service.d/nfs-deps.conf << EOF
|
||||||
[Unit]
|
[Unit]
|
||||||
After=${NFS_UNIT}
|
After=${MOUNT_UNIT}
|
||||||
Requires=${NFS_UNIT}
|
Requires=${MOUNT_UNIT}
|
||||||
EOF
|
EOF
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
```
|
```
|
||||||
|
|
||||||
`Requires=` means: if the NFS mount fails (UNAS is genuinely down),
|
`Requires=` means: if the network mount fails (UNAS is genuinely down),
|
||||||
systemd will not start the container — which is correct, since the
|
systemd will not start the container — which is correct, since the
|
||||||
container's data lives on that mount.
|
container's data lives on that mount.
|
||||||
|
|
||||||
## Container checklist
|
## Container checklist
|
||||||
|
|
||||||
| Container | NFS mount path | systemd unit | Drop-in status |
|
| Container | Protocol | Network mount path | systemd unit | Drop-in status |
|
||||||
|---|---|---|---|
|
|---|---|---|---|---|
|
||||||
| LXC 101 — arr-stack | `/mnt/unas/arr_data` | `mnt-unas-arr_data.mount` | ✅ done |
|
| LXC 101 — arr-stack | NFS | `/mnt/unas/arr_data` | `mnt-unas-arr_data.mount` | ✅ done |
|
||||||
| LXC ??? — immich | `/mnt/unas/immich_data` | `mnt-unas-immich_data.mount` | ⬜ apply when created |
|
| LXC ??? — immich | NFS | `/mnt/unas/immich_data` | `mnt-unas-immich_data.mount` | ⬜ apply when created |
|
||||||
| LXC ??? — gramps | `/mnt/unas/gramps_data` | `mnt-unas-gramps_data.mount` | ⬜ apply when created |
|
| LXC ??? — gramps | NFS | `/mnt/unas/gramps_data` | `mnt-unas-gramps_data.mount` | ⬜ apply when created |
|
||||||
| LXC ??? — paperless | `/mnt/unas/paperless_data` | `mnt-unas-paperless_data.mount` | ⬜ apply when created |
|
| LXC ??? — paperless | NFS | `/mnt/unas/paperless_data` | `mnt-unas-paperless_data.mount` | ⬜ apply when created |
|
||||||
| LXC 103 — ytd | `/mnt/unas/youtube_downloads` | `mnt-unas-youtube_downloads.mount` | ✅ done |
|
| LXC 103 — ytd | SMB | `/mnt/unas/youtube_downloads` | `mnt-unas-youtube_downloads.mount` | ✅ done |
|
||||||
|
|
||||||
LXC 100 (PBS) uses a local disk — no NFS or NVIDIA dependency.
|
LXC 100 (PBS) uses a local disk — no NFS or NVIDIA dependency.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
Persistent mounts for the UniFi Drive shares on the Proxmox host, and how to
|
Persistent mounts for the UniFi Drive shares on the Proxmox host, and how to
|
||||||
bind-mount each share into the LXC that consumes it. Most shares use NFS;
|
bind-mount each share into the LXC that consumes it. Most shares use NFS;
|
||||||
`mobile_photos` is the SMB/CIFS exception because PhotoSync writes to it.
|
`mobile_photos` and `youtube_downloads` use SMB/CIFS.
|
||||||
|
|
||||||
## Understanding the U-NAS Path Structure
|
## Understanding the U-NAS Path Structure
|
||||||
|
|
||||||
|
|
@ -63,16 +63,16 @@ Repeat for every share in the list.
|
||||||
- `arr_data`, `gramps_data`, `immich_data`, `paperless_data`: set to
|
- `arr_data`, `gramps_data`, `immich_data`, `paperless_data`: set to
|
||||||
**No Root Squash** (Isolated Mode). This allows the Proxmox host root to
|
**No Root Squash** (Isolated Mode). This allows the Proxmox host root to
|
||||||
`chown` files so that container users (UID 1000) can write.
|
`chown` files so that container users (UID 1000) can write.
|
||||||
- `pbs_backup`, `youtube_downloads`: default squash mode is fine.
|
- `pbs_backup`: default squash mode is fine.
|
||||||
6. Set access to **Read/Write**.
|
6. Set access to **Read/Write**.
|
||||||
7. Save and confirm before moving to the next share.
|
7. Save and confirm before moving to the next share.
|
||||||
|
|
||||||
LXC containers do not mount NFS directly. The Proxmox host is the only NFS
|
LXC containers do not mount NFS directly. The Proxmox host is the only NFS
|
||||||
client; LXCs get access via bind mounts from the host.
|
client; LXCs get access via bind mounts from the host.
|
||||||
|
|
||||||
`mobile_photos` is the exception: it is mounted on the Proxmox host over
|
`mobile_photos` and `youtube_downloads` are mounted on the Proxmox host over
|
||||||
SMB/CIFS using `/etc/unas-smb-credentials`, then bind-mounted into the Immich
|
SMB/CIFS using `/etc/unas-smb-credentials`, then bind-mounted into their
|
||||||
LXC.
|
consumer LXCs.
|
||||||
|
|
||||||
> **Why No Root Squash for some shares?** UniFi Drive's default NFS mode
|
> **Why No Root Squash for some shares?** UniFi Drive's default NFS mode
|
||||||
> squashes the client root to an anonymous UID (977:988). That anonymous user
|
> squashes the client root to an anonymous UID (977:988). That anonymous user
|
||||||
|
|
@ -106,14 +106,12 @@ Export list for 10.0.10.25:
|
||||||
/volume/b69055de-0b30-4e8c-b7ef-b533d92733c3/.srv/.unifi-drive/immich_data/.data 10.0.10.10
|
/volume/b69055de-0b30-4e8c-b7ef-b533d92733c3/.srv/.unifi-drive/immich_data/.data 10.0.10.10
|
||||||
/volume/b69055de-0b30-4e8c-b7ef-b533d92733c3/.srv/.unifi-drive/paperless_data/.data 10.0.10.10
|
/volume/b69055de-0b30-4e8c-b7ef-b533d92733c3/.srv/.unifi-drive/paperless_data/.data 10.0.10.10
|
||||||
/volume/b69055de-0b30-4e8c-b7ef-b533d92733c3/.srv/.unifi-drive/pbs_backup/.data 10.0.10.10
|
/volume/b69055de-0b30-4e8c-b7ef-b533d92733c3/.srv/.unifi-drive/pbs_backup/.data 10.0.10.10
|
||||||
/volume/b69055de-0b30-4e8c-b7ef-b533d92733c3/.srv/.unifi-drive/youtube_downloads/.data 10.0.10.10
|
|
||||||
```
|
```
|
||||||
|
|
||||||
If a share is absent from the output, return to step 1 and confirm NFS is
|
If a share is absent from the output, return to step 1 and confirm NFS is
|
||||||
enabled for that share with the Proxmox host IP in the allowed-hosts list.
|
enabled for that share with the Proxmox host IP in the allowed-hosts list.
|
||||||
|
|
||||||
`mobile_photos` will not appear in `showmount`; it is mounted separately over
|
The two SMB shares will not appear in `showmount`.
|
||||||
SMB/CIFS.
|
|
||||||
|
|
||||||
## 4. Create Mountpoints
|
## 4. Create Mountpoints
|
||||||
|
|
||||||
|
|
@ -137,7 +135,7 @@ cp /etc/fstab /etc/fstab.bak
|
||||||
nano /etc/fstab
|
nano /etc/fstab
|
||||||
```
|
```
|
||||||
|
|
||||||
Add the following six lines. The UUID in the export path must match what
|
Add the following five lines. The UUID in the export path must match what
|
||||||
`showmount -e` returned in step 3. UniFi Drive 4.x exports NFSv3 only —
|
`showmount -e` returned in step 3. UniFi Drive 4.x exports NFSv3 only —
|
||||||
`vers=3` is required.
|
`vers=3` is required.
|
||||||
|
|
||||||
|
|
@ -148,13 +146,26 @@ Add the following six lines. The UUID in the export path must match what
|
||||||
10.0.10.25:/volume/b69055de-0b30-4e8c-b7ef-b533d92733c3/.srv/.unifi-drive/immich_data/.data /mnt/unas/immich_data nfs vers=3,noatime,nofail,_netdev,x-systemd.automount,x-systemd.mount-timeout=10s 0 0
|
10.0.10.25:/volume/b69055de-0b30-4e8c-b7ef-b533d92733c3/.srv/.unifi-drive/immich_data/.data /mnt/unas/immich_data nfs vers=3,noatime,nofail,_netdev,x-systemd.automount,x-systemd.mount-timeout=10s 0 0
|
||||||
10.0.10.25:/volume/b69055de-0b30-4e8c-b7ef-b533d92733c3/.srv/.unifi-drive/paperless_data/.data /mnt/unas/paperless_data nfs vers=3,noatime,nofail,_netdev,x-systemd.automount,x-systemd.mount-timeout=10s 0 0
|
10.0.10.25:/volume/b69055de-0b30-4e8c-b7ef-b533d92733c3/.srv/.unifi-drive/paperless_data/.data /mnt/unas/paperless_data nfs vers=3,noatime,nofail,_netdev,x-systemd.automount,x-systemd.mount-timeout=10s 0 0
|
||||||
10.0.10.25:/volume/b69055de-0b30-4e8c-b7ef-b533d92733c3/.srv/.unifi-drive/pbs_backup/.data /mnt/unas/pbs_backup nfs vers=3,noatime,nofail,_netdev,x-systemd.automount,x-systemd.mount-timeout=10s 0 0
|
10.0.10.25:/volume/b69055de-0b30-4e8c-b7ef-b533d92733c3/.srv/.unifi-drive/pbs_backup/.data /mnt/unas/pbs_backup nfs vers=3,noatime,nofail,_netdev,x-systemd.automount,x-systemd.mount-timeout=10s 0 0
|
||||||
10.0.10.25:/volume/b69055de-0b30-4e8c-b7ef-b533d92733c3/.srv/.unifi-drive/youtube_downloads/.data /mnt/unas/youtube_downloads nfs vers=3,noatime,nofail,_netdev,x-systemd.automount,x-systemd.mount-timeout=10s 0 0
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Add this separate CIFS line for the PhotoSync target:
|
Create one root-only credential file for both SMB mounts:
|
||||||
|
|
||||||
|
```ini
|
||||||
|
# /etc/unas-smb-credentials
|
||||||
|
username=<unas-user>
|
||||||
|
password=<unas-password>
|
||||||
|
domain=WORKGROUP
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
chmod 600 /etc/unas-smb-credentials
|
||||||
|
```
|
||||||
|
|
||||||
|
Add the CIFS entries:
|
||||||
|
|
||||||
```fstab
|
```fstab
|
||||||
//10.0.10.25/mobile_photos /mnt/unas/mobile_photos cifs credentials=/etc/unas-smb-credentials,vers=3.0,iocharset=utf8,ro,nofail,_netdev,x-systemd.automount,x-systemd.mount-timeout=10s 0 0
|
//10.0.10.25/mobile_photos /mnt/unas/mobile_photos cifs credentials=/etc/unas-smb-credentials,vers=3.0,iocharset=utf8,ro,nofail,_netdev,x-systemd.automount,x-systemd.mount-timeout=10s 0 0
|
||||||
|
//10.0.10.25/youtube_downloads /mnt/unas/youtube_downloads cifs credentials=/etc/unas-smb-credentials,vers=3.0,iocharset=utf8,rw,noperm,uid=0,gid=0,file_mode=0660,dir_mode=0770,nofail,_netdev,x-systemd.automount,x-systemd.mount-timeout=120s 0 0
|
||||||
```
|
```
|
||||||
|
|
||||||
## 6. Apply and Verify All Mounts
|
## 6. Apply and Verify All Mounts
|
||||||
|
|
@ -167,25 +178,26 @@ mount -a
|
||||||
Confirm each share is mounted:
|
Confirm each share is mounted:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
for share in arr_data gramps_data immich_data paperless_data pbs_backup youtube_downloads; do
|
for share in arr_data gramps_data immich_data paperless_data pbs_backup; do
|
||||||
findmnt /mnt/unas/$share || echo "MISSING: $share"
|
findmnt /mnt/unas/$share || echo "MISSING: $share"
|
||||||
done
|
done
|
||||||
```
|
```
|
||||||
|
|
||||||
All six NFS shares must show a source line. A `MISSING` line means the share
|
All five NFS shares must show a source line. A `MISSING` line means the share
|
||||||
is not mounted; check `/etc/fstab` for a typo in the export path or mountpoint,
|
is not mounted; check `/etc/fstab` for a typo in the export path or mountpoint,
|
||||||
then confirm the UNAS IP is reachable.
|
then confirm the UNAS IP is reachable.
|
||||||
|
|
||||||
Confirm the SMB-backed `mobile_photos` mount separately:
|
Confirm the SMB-backed mounts separately:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
findmnt /mnt/unas/mobile_photos
|
findmnt /mnt/unas/mobile_photos
|
||||||
|
findmnt /mnt/unas/youtube_downloads
|
||||||
```
|
```
|
||||||
|
|
||||||
Quick write test for each share:
|
Quick write test for each share:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
for share in arr_data gramps_data immich_data paperless_data pbs_backup youtube_downloads; do
|
for share in arr_data gramps_data immich_data paperless_data pbs_backup; do
|
||||||
touch /mnt/unas/$share/.mount-test && rm /mnt/unas/$share/.mount-test \
|
touch /mnt/unas/$share/.mount-test && rm /mnt/unas/$share/.mount-test \
|
||||||
&& echo "OK: $share" || echo "WRITE FAIL: $share"
|
&& echo "OK: $share" || echo "WRITE FAIL: $share"
|
||||||
done
|
done
|
||||||
|
|
@ -194,6 +206,13 @@ done
|
||||||
`mobile_photos` is read-only on the Proxmox host, so no write test is needed
|
`mobile_photos` is read-only on the Proxmox host, so no write test is needed
|
||||||
for that mount.
|
for that mount.
|
||||||
|
|
||||||
|
Verify that the Youtarr SMB mount is writable:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
touch /mnt/unas/youtube_downloads/.mount-test
|
||||||
|
rm /mnt/unas/youtube_downloads/.mount-test
|
||||||
|
```
|
||||||
|
|
||||||
## 7. Bind Mounts into LXCs
|
## 7. Bind Mounts into LXCs
|
||||||
|
|
||||||
Stop each LXC before adding mountpoints. Replace the VMID placeholders with
|
Stop each LXC before adding mountpoints. Replace the VMID placeholders with
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue