V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
vonsy
V2EX  ›  NAS

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

  •  
  •   vonsy · 2023-03-01 10:28:07 +08:00 · 1093 次点击
    这是一个创建于 426 天前的主题,其中的信息可能已经有所发展或是发生改变。

    问题:

    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 条回复    2023-03-01 13:12:38 +08:00
    vonsy
        1
    vonsy  
    OP
       2023-03-01 10:56:33 +08:00
    可以了
    因为那会以 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  
       2023-03-01 13:12:38 +08:00
    设置 qbittorrent 容器的 PUID 、PGID 与 /mnt/matrix 的所有者一致,且 /mnt/matrix/downloads 与 /mnt/matrix/config 的所有者应当与 /mnt/matrix 的所有者一致
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5569 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 06:32 · PVG 14:32 · LAX 23:32 · JFK 02:32
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.