【发布时间】:2016-01-14 06:56:01
【问题描述】:
最近,我正在学习 linux 命名空间。
我希望即使进程结束,我仍然可以附加该进程所在的命名空间。
有人告诉我可以使用mount --bind /proc/<pid>/ns/pid ./pid 来保持这个文件打开。所以我试了一下。
挂载uts的时候,user、ipc、pid、net……都还好……
root@ubuntu:/home/jiashenh/workspace# touch uts
root@ubuntu:/home/jiashenh/workspace# mount --bind /proc/171/ns/uts ./uts
但是说到mnt……我也是这样用的……
root@ubuntu:/home/jiashenh/workspace# touch mnt
root@ubuntu:/home/jiashenh/workspace# mount --bind /proc/171/ns/mnt ./mnt
mount: wrong fs type, bad option, bad superblock on /proc/171/ns/mnt,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
它失败了.....那么谁能告诉我如何解决它? .
【问题讨论】: