coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: /proc/self/mountinfo versus chroot


From: Rick Troth
Subject: Re: /proc/self/mountinfo versus chroot
Date: Mon, 7 Mar 2016 18:13:54 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0

I'm seeing the need for /etc/mtab (as a plain file) with loop-back
mounts too now.

Apologies for being somewhat slow to report these things.
I do try to stay quite current with Coreutils, but I don't run full
regression testing on it.


On 03/04/2016 11:17 AM, Bernhard Voelker wrote:
> Well, the kernel always knows what's mounted where, so it seems that
> mtab has always been redundant.
>
> See also: "Yeah, mtab is evil.", from
> http://karelzak.blogspot.de/2011/04/bind-mounts-mtab-and-read-only.html
>
> Regarding your case: I don't see /dev/root in df's output inside
> a chroot here.

Bind mount can also take you to a sub-directory, for which case showing
the device may not be what the sysadmin wants. (I'm sure Karel knows
about sub-dirs. The article simply doesn't mention them.)

Similarly (now) with loop-back, the pseudo device is less interesting
than the backing file.
The name of the file is available from
/sys/dev/block/<dev>:<inode>/loop/backing_file which might not be
visible under 'chroot'.
The whole problem goes away with /etc/mtab (as a file).

I did run some comparisons of 'df' from 8.24 and 8.25. Did not
immediately see any differences (for bind mounts). Should I?

-- R; <><






reply via email to

[Prev in Thread] Current Thread [Next in Thread]