On 05/13/2016 04:50 PM, Tom H wrote:
On Fri, May 13, 2016 at 2:41 PM, Stephen Berg (Contractor)
<stephen.berg....@nrlssc.navy.mil> wrote:
Mount points that are available on the local hardware under /export/home/
*AND* through the automounter under /home/ show up under /home/ when they
should be showing up under their actual mount point, /export/home/.
It seems that df is preferring whichever mount point is shorter. Which seems
extremely arbitrary and rather stupid.
The kernel doesn't differentiate between the mount of a filesystem and
any of its bind-mounts, so the df developers chose to show the one
with the shortest mount point with "df" and all with "df -a" :
root@west:~# df | grep sda
/dev/sda1 237274808 23197772 202001056 11% /
root@west:~# mount -o bind / /mnt
root@west:~# df | grep sda
/dev/sda1 237274808 23197772 202001056 11% /
root@west:~# df -a | grep sda
/dev/sda1 237274808 23197772 202001056 11% /
/dev/sda1 237274808 23197772 202001056 11% /mnt
root@west:~# grep sda /proc/self/mounts
/dev/sda1 / ext4 rw,relatime,data=ordered 0 0
/dev/sda1 /mnt ext4 rw,relatime,data=ordered 0 0
root@west:~# grep sda /proc/self/mountinfo
24 0 8:1 / / rw,relatime shared:1 - ext4 /dev/sda1 rw,data=ordered
137 24 8:1 / /mnt rw,relatime shared:1 - ext4 /dev/sda1 rw,data=ordered
In your case, is "/home" bind-mounted or nfs-mounted? If it's
nfs-mounted, is the df invocation including "-l"?
The logical volume for my home directory is mounted on /export/home
locally, and /home via NFS/automounter. In the SL5.x and SL6.x days it
would have been a bind mount and I could filter out bind mounts from the
df output, everything worked as expected. These days there's no
indication that it's a bind mount anywhere that I can see, and as you
pointed out, it's displaying the shorter of the possible mount points to
display.
That means that right after a reboot, it shows up mounted on
/export/home which is correct, but once I login it shows up as /home
which isn't correct. When running say for instance "df -PTlk" the
output shouldn't ever change where a filesystem is mounted. But this
choosing of the shorter of possible mount points means it can change on
the fly.
When my monitoring software (OMD/check_mk) does it's thing it wants to
see where the filesystem is mounted during the df part of it's check,
but when it changes arbitrarily it can't adjust for that on the fly.
--
Stephen Berg
Systems Administrator
NRL Code: 7320
Office: 228-688-5738
stephen.berg....@nrlssc.navy.mil