GNU bug report logs - #28670
df: detect over-mounted filesystems

Previous Next

Package: coreutils;

Reported by: Alan Jenkins <alan.christopher.jenkins <at> gmail.com>

Date: Mon, 2 Oct 2017 15:38:01 UTC

Severity: wishlist

Merged with 28991

Full log


View this message in rfc822 format

From: Alan Jenkins <alan.christopher.jenkins <at> gmail.com>
To: 28670 <at> debbugs.gnu.org
Subject: bug#28670: df: detection of overmounted filesystems is not quite complete
Date: Mon, 2 Oct 2017 13:27:02 +0100
Scenario 1 - lovely diagnostic

$ df -h /dev/sda1
df: cannot access '/dev/sda1': over-mounted by another device

$ mount | grep boot/efi
/dev/sda6 on /boot type ext4 (rw,relatime,seclabel,data=ordered)
/dev/sda1 on /boot/efi type vfat 
(rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=ascii,shortname=winnt,errors=remount-ro)
none on /boot/efi type tmpfs (rw,relatime,seclabel)


Scenario 2 - breaks down

$ df -h |grep /dev/sda1
$ df -ah |grep /dev/sda1
/dev/sda1                             -     -     -    - /boot/efi

above is consistent (same output as in scenario 1), but below is bad:

$ df -h /dev/sda1  # or same output  from `/boot/efi`
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       3.9G     0  3.9G   0% /boot/efi

Case 2 situation is as follows:

$ mount | grep boot
/dev/sda6 on /boot type ext4 (rw,relatime,seclabel,data=ordered)
/dev/sda1 on /boot/efi type vfat 
(rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=ascii,shortname=winnt,errors=remount-ro)
none on /boot type tmpfs (rw,relatime,seclabel)

i.e. the tmpfs on /boot is the most recent mount, masking the /boot/efi 
mount (and I created a dummy `/boot/efi` directory in the tmpfs).

The practical use-case is that people get very confused when their 
distribution sets up pam_ecryptfs.  If `df` was more reliable about 
detecting overmounts, then it would provide better diagnostics for when 
pam_ecryptfs overmounts a filesystem which was mounted by fstab.

https://unix.stackexchange.com/questions/370043/mounting-a-subdirectory-of-home-onto-an-own-partition-confuses-disk-usage-report/395630?noredirect=1#comment706009_395630




This bug report was last modified 6 years and 293 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.