V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
请不要把任何和邀请码有关的内容发到 NAS 节点。

邀请码相关的内容请使用 /go/in 节点。

如果没有发送到 /go/in,那么会被移动到 /go/pointless 同时账号会被降权。如果持续触发这样的移动,会导致账号被禁用。
vonsy
V2EX  ›  NAS

请教 TrueNAS 一个 uid,gid 映射权限问题(Debian--->Docker--->qBittorrent: Operation not permitted)

  •  
  •   vonsy · Mar 1, 2023 · 1799 views
    This topic created in 1154 days ago, the information mentioned may be changed or developed.

    问题:

    Debian--->Docker--->qBittorrent, 提示 chown: changing ownership of '/config/qBittorrent/qBittorrent.conf': Operation not permitted
    

    Debian:

    2.2.2.192:/mnt/matrix/config /zion/share/config nfs auto,nofail,noatime,nolock,intr,actimeo=1800 0 0
    uid=1000(foo) gid=1000(foo) groups=1000(foo),998(docker)
    

    qbittorrent: 可以指定 uid,gid

    https://hub.docker.com/r/linuxserver/qbittorrent

      docker run -d \
      --name=qbittorrent \
      -e PUID=1000 \
      -e PGID=1000 \
      -e TZ=Asia/Shanghai \
      -e WEBUI_PORT=8080 \
      -p 16881:16881 \
      -p 16881:16881/udp \
      -p 8080:8080 \
      -v /zion/share/container/qbittorrent:/config \
      -v /zion/share/downloads:/downloads \
      --restart unless-stopped \
      linuxserver/qbittorrent
    

    TrueNAS:

    NFS: /mnt/matrix/downloads,
    uid=3000(foo) gid=3000(foo) groups=3000(foo)
    Mapall User: foo   <--- 所有 NFS 客户端访问都映射到这个用户 /组. 是这个意思吗? 但 qBittorrent 容器 puid=1000,它会把目录 owner 也修改为 1000, 不应该是 3000 才对吗?
    Mapall Group: foo
    

    我知道如果将 TrueNAS 用户 uid,gid 修改为 1000, 或 Debian 用户修改为 3000,两边保持一致就没问题了. 但想搞清楚两边不一致时如何解决?

    还有一种是 mount 时添加-o gid=3000,uid=3000 指定 owner. <---还没试

    2 replies    2023-03-01 13:12:38 +08:00
    vonsy
        1
    vonsy  
    OP
       Mar 1, 2023
    可以了
    因为那会以 uid=1000,gid=1000 运行 qBittorrent, 它把文件夹 owner 部分修改为 1000 了.
    然后再次以 uid=3000,gid=3000 运行时, 又会把 1000 修改回 3000,但部分成功,部分失败(TrueNAS acl 很多设置,还没搞清楚哪项导致的)
    在 TrueNAS Datasets Permissions 中重置 owner,acl. 再次以 uid=3000,gid=3000 运行 qBittorrent 正常
    ragnaroks
        2
    ragnaroks  
       Mar 1, 2023
    设置 qbittorrent 容器的 PUID 、PGID 与 /mnt/matrix 的所有者一致,且 /mnt/matrix/downloads 与 /mnt/matrix/config 的所有者应当与 /mnt/matrix 的所有者一致
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5641 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 08:30 · PVG 16:30 · LAX 01:30 · JFK 04:30
    ♥ Do have faith in what you're doing.