user1633272
user1633272

Reputation: 2309

How to read content of /proc/[pid]/ns/mnt?

I’m learning Linux (Centos 6) namespace. I think this file should contains mount information of the process. Do you know how to read the content of this symbol-link using shell?

Upvotes: 0

Views: 1074

Answers (1)

deepskyblue86
deepskyblue86

Reputation: 360

readlink will return you something, but it's not really useful. E.g.:

# readlink /proc/141580/ns/mnt 
mnt:[4026533639]

/proc/[pid]/mounts will get you the mount points, and they will be the same for all the processes in that namespace. Of course also the value of readlink .../ns/mnt will be the same.

You can easily test that with a docker run and a docker exec on that container (not sure if you have docker on centos 6, but you could experiment on other boxes).

Upvotes: 1

Related Questions