[systemd-devel] systemd-nspawn: where is my container root?

Nikolaus Rath Nikolaus at rath.org
Thu Jun 28 19:25:54 UTC 2018


On Jun 26 2018, Lennart Poettering <lennart at poettering.net> wrote:
> On Di, 26.06.18 09:39, Nikolaus Rath (Nikolaus at rath.org) wrote:
>
>> Hi,
>> 
>> That makes sense.. but is there any way to find out *globally* what
>> devices are mounted in *any* namespace?
>
> If you a PID from any process that belongs to the container you can
> list its mounts by doing /proc/$PID/mountinfo. You can also access its
> files through the /proc/$PID/root pseudo directory. 
>
> There's also /usr/lib/systemd/systemd-dissect --mount if you want to
> look into a raw image and have it mounted externally just like
> systemd-nspawn would do it.

That's good to know, thanks! My question was meant a little different
though (and is probably somewhat off-topic, but it fit nicely into the
thread):

If any process could potentially sit in its own namespace (whether
created by systemd or manually) and have its own mounts, is there any
way for me to get a list of *all* the mounts in any namespace (without
having to determine which pids have their own namespace and query
them one by one)?


Best,
-Nikolaus

-- 
GPG Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«


More information about the systemd-devel mailing list