我尝试找出特定路径中正在使用哪些文件:
lsof /mnt/cache
这返回例如:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
Plex\x20S 338 nobody cwd DIR 259,1 74 3221225602 /config/Library/Application Support/Plex Media Server/Plug-in Support/Data/com.plexapp.system
如您所见,“NAME”不包含路径“/mnt/cache”。并且主机系统上没有任何可用的“/config”目录:
ls /config
/bin/ls: cannot access '/config': No such file or directory
这是因为 /config 是到 /mnt/cache/appdata/plex 的 Docker 绑定挂载,它仅存在于特定容器内:
docker inspect plex
...
"Mounts": [
...
{
"Type": "bind",
"Source": "/mnt/cache/appdata/plex",
"Destination": "/config",
"Mode": "rw",
"RW": true,
"Propagation": "rprivate"
},
可以lsof
显示真实的源码路径,所以是这样的?
Plex\x20S 338 nobody cwd DIR 259,1 74 3221225602 /mnt/cache/appdata/plex/Library/Application Support/Plex Media Server/Plug-in Support/Data/com.plexapp.system