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

2023-03-01 10:28:07 +08:00
 vonsy

问题:

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. <---还没试

1092 次点击
所在节点    NAS
2 条回复
vonsy
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
2023-03-01 13:12:38 +08:00
设置 qbittorrent 容器的 PUID 、PGID 与 /mnt/matrix 的所有者一致,且 /mnt/matrix/downloads 与 /mnt/matrix/config 的所有者应当与 /mnt/matrix 的所有者一致

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/920073

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX