On Tue, Nov 10, 2015 at 12:32 AM, Mike Gilbert <flop...@gentoo.org> wrote:
> On Mon, Nov 9, 2015 at 2:36 PM, Jarry <mr.ja...@gmail.com> wrote:
>> On 08-Nov-15 17:58, Mike Gilbert wrote:
>>> On Fri, Nov 6, 2015 at 12:19 PM, Jarry <mr.ja...@gmail.com> wrote:
>>>>
>>>> I noted one strange thing today: It seems one of my servers lost "/"!
>>>>
>>>> vs5-dns ~ # df
>>>> Filesystem    1K-blocks    Used Available Use% Mounted on
>>>> /var/log/named 10138552 2223148   7377344  24% /chroot/dns/var/log/named
>>>> tmpfs            308196     420    307776   1% /run
>>>> dev               10240       0     10240   0% /dev
>>>> shm             1540968       0   1540968   0% /dev/shm
>>>> cgroup_root       10240       0     10240   0% /sys/fs/cgroup
>>>> none            1048576       0   1048576   0% /var/tmp/portage
>>>
>>> Is your /etc/mtab a regular file, or is it a symlink to
>>> /proc/self/mounts? The latter is recommended.
>>
>> It is regular file. I never changed it...
>>
>> vs5-dns ~ # ls -l /etc/mtab
>> -rw-r--r-- 1 root root 908 Nov  9 19:14 /etc/mtab
>>
>>> Anyway, please have a look at the contents of /etc/mtab,
>>> /proc/self/mounts, and proc/self/mountinfo while named is running and
>>> when it is stopped. If you pastebin them we can take a look for key
>>> differences.
>>
>> With bind running:
>> http://pastebin.com/wkTW6xAY
>>
>> without bind:
>> http://pastebin.com/JG5FPNDW
>>
>> While I can see some differences there, I still do not understand
>> why is "/" missing in "df" output. BTW I can not proove it, but this
>> was not the case all the time. At least when I was tuning monitoring
>> software, I'm pretty sure "/" was there...
>
> It may be a bug.
>
> Can you try replacing /etc/mtab with a symlink to /proc/self/mounts to
> see if it makes any difference? That triggers different code paths in
> several programs.

>From the OP's pastebin:

vs5-dns ~ # more /etc/mtab
/dev/sda2 / ext4 rw,noatime,data=ordered 0 0
/etc/bind /chroot/dns/etc/bind none rw,bind 0 0
/var/bind /chroot/dns/var/bind none rw,bind 0 0
/var/log/named /chroot/dns/var/log/named none rw,bind 0 0

vs5-dns ~ # more /proc/self/mounts
/dev/sda2 / ext4 rw,noatime,data=ordered 0 0
/dev/sda2 /chroot/dns/etc/bind ext4 rw,noatime,data=ordered 0 0
/dev/sda2 /chroot/dns/var/bind ext4 rw,noatime,data=ordered 0 0
/dev/sda2 /chroot/dns/var/log/named ext4 rw,noatime,data=ordered 0 0

There was a blog post a few years ago by the util-linux maintainer in
which he was pushing for users to symlink "/etc/mtab" to
"/proc/self/mounts" and he was explaining that having "bind" as a
property in mtab doesn't make sense because you could unmount the
"bound-to" mount and the "bound" mount would still show "bind" as a
property.

Is "/" shown when you run "df -a"? If it's shown, then there's a bug
in coreutils (as long as they accept a bug on a system where mtab
isn't a symlink) because, AFAIR, "df" should show the mount with the
shortest mount path if a filesystem's mounted more than once.

Reply via email to