Skip to main content

TruenNAS NFS-Volume für Container

TrueNAS NFS Freigabe

image.png

NFS-Freigabe in Truenas aktivieren

  • Dienst aktivieren 
  • NFS-Version V4 wählen (default: V3) > System Settings > Services > NFS > Configure 

Für Plex Container:  

  • Mapall User + Mapall Group zuordnen
  • docker-compose file siehe unten

Für Ubuntu VM:

  • Maproot User + Group, z,B. "root", zuordnen (UID/GID müssen in identisch sein für TrueNAS und VM)
  • Ggfls. Kernel-Modul installieren: sudo apt-get install nfs-common
  • Mount-Befehl: sudo mount -t nfs -o rw 192.168.178.201:/mnt/naspool/mediadata_nfs /mnt/mediadata

 

Docker-compose File:

---
version: "2.1"
services:
  plex:
    image: ...
    ...
    volumes:
      - mediadata_nfs:/mnt/mediadata_nfs
      
volumes:
  mediadata_nfs:
    driver: local
    driver_opts:
      type: "nfs"
      o: "addr=192.168.178.201,nolock,soft,rw"
      device: ":/mnt/naspool/mediadata"
    

Options "o" für NFS-Einbindung -> https://blog.stefandroid.com/2021/03/03/mount-nfs-share-in-docker-compose.html

  • nfsvers=3 or nfsvers=4
  • nolock (optional): remote applications on the NFS server are not affected by lock files within the Docker container (only other processes within the container are affected by locks)
  • soft (optional): the NFS client fails an NFS request after retrans=n unsuccessful retries, otherwise it will try indefinitely
  • retrans=n (optional, default 2): specify the number of retries for NFS requests, only relevant if using soft
  • timeo=n (optional, default 600): the NFS client waits n tenths of a second before retrying an NFS request
  • rw: read-write access
  • ro: read only