是的。你可以看看它/proc/$PID/mountinfo
,否则你可以使用findmnt -N
开关 - 关于它findmnt --help
说:
-N, --task <tid>
/proc/<tid>/mountinfo
文件)findmnt
还跟踪PROPAGATION
标志,这是一个mountinfo
准确报告此信息的字段 - 哪些进程共享哪些安装。
此外,您始终可以使用nsenter
您喜欢的任何类型的命名空间 - 当然,前提是您拥有正确的权限。
nsenter --help
Usage:
nsenter [options] <program> [args...]
Options:
-t, --target <pid> target process to get namespaces from
-m, --mount [=<file>] enter mount namespace
-u, --uts [=<file>] enter UTS namespace (hostname etc)
-i, --ipc [=<file>] enter System V IPC namespace
-n, --net [=<file>] enter network namespace
-p, --pid [=<file>] enter pid namespace
-U, --user [=<file>] enter user namespace
-S, --setuid <uid> set uid in user namespace
-G, --setgid <gid> set gid in user namespace
-r, --root [=<dir>] set the root directory
-w, --wd [=<dir>] set the working directory
-F, --no-fork do not fork before exec'ing <program>
-h, --help display this help and exit
-V, --version output version information and exit
For more details see nsenter(1).
Run Code Online (Sandbox Code Playgroud)