Raspberry PI 4 中的 Docker 连接了外部硬盘(NTFS 类型)。有一些 docker 容器正在运行,其卷映射到外部 HD,例如:
- /media/myExternalHD/docker_config/app1:/home/app1/.app1
- /media/myExternalHD/incoming:/incoming
- /media/myExternalHD/temp:/temp
我的用户 ID 是 1000:1000,并且也在撰写的环境变量中进行标识:
- PUID=1000
- PGID=1000
当容器需要修改或写入位于卷中的文件时,会发生权限错误:
2022-09-10 22:37:25: 22:37:25: Error: File '/temp/001.part' couldn't be renamed '/incoming/file1.txt' (error 0: Invalid argument)
2022-09-10 22:37:25: Suspending upload of file: BFF4855E6759474EB3DCDAW3FFB5B71
2022-09-10 22:37:00: 22:37:00: Error: Impossible to set permissions for the file '/incoming/file1.txt' (error 1: Operation not permitted)
2022-09-10 22:37:25: 22:37:25: Error: Impossible to set permissions for the file '/temp/001.part.met.backup' (error 1: Operation not permitted)
2022-09-10 22:37:25: 22:37:25: Error: Impossible to set permissions for the file '/temp/001.part.met.bak' (error 1: Operation not permitted)
这是另一个硬币错误:
os.chmod(filename, 0o600)
PermissionError: [Errno 1] Operation not permitted: '/config/settings/pyload.cfg'
File "/usr/lib/python3.9/site-packages/pyload/core/config/parser.py", line 240, in save_config
self.save()
self.save_config(self.config, self.configpath)
File "/usr/lib/python3.9/site-packages/pyload/core/config/parser.py", line 299, in save
File "/usr/lib/python3.9/site-packages/pyload/core/config/parser.py", line 321, in set
我确实将文件夹所有权更改为我的用户:
sudo chown -R myuserid:docker /media/myExternalHD
和
sudo chown -R myuserid /media/myExternalHD
但没有解决问题,知道吗?