Re: OT: Linux df question

  • From: De DBA <dedba@xxxxxxxxxx>
  • To: JSweetser@xxxxxxxx
  • Date: Sun, 13 Jul 2014 11:25:39 +1000

Joe,

Is this a dual-boot machine with Windows? Why would the /boot and /boot/efi 
partitions be formatted with VFAT instead of the usual ext4?

On 12/07/14 01:12, Sweetser, Joe wrote:
UUID=6fede090-8fff-40d8-9066-fcf9d6a67680 /                       ext4    
defaults        1 1
UUID=F9A5-364C          /boot                   vfat    
umask=0077,shortname=winnt 0 0
UUID=F9A2-0016          /boot/efi               vfat    
umask=0077,shortname=winnt 0 0

I can now reproduce the issue by formatting 2 partitions with FAT file systems 
and mounting one on  top of the other with your mount options:

[root@emperor /]# mount -o umask=0077,shortname=winnt /dev/dm-3 /fattest
[root@emperor /]# mount -o umask=0077,shortname=winnt /dev/dm-4 
/fattest/fat2test

[root@emperor /]# mount
/dev/mapper/vg_skerchi_sys-LVRoot1 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
*/dev/sda1 on /boot type ext4 (rw)*
/dev/mapper/vg_skerchi_sys-LVHome1 on /home type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
*/dev/mapper/vg_skerchi_sys-LVtest1 on /fattest type vfat 
(rw,umask=0077,shortname=winnt)**
**/dev/mapper/vg_skerchi_sys-LVtest2 on /fattest/fat2test type vfat 
(rw,umask=0077,shortname=winnt)*

[*root*@emperor /]# df -h
Filesystem                          Size  Used Avail Use% Mounted on
...
/dev/mapper/vg_skerchi_sys-LVtest1  8.0M  4.0K  8.0M   1% /fattest
*/dev/mapper/vg_skerchi_sys-LVtest2  248M  4.0K  248M 1% /fattest/fat2test*

[*user*@emperor ~]$ df -h
*df: `/fattest/fat2test': Permission denied*
Filesystem                          Size  Used Avail Use% Mounted on
/dev/mapper/vg_skerchi_sys-LVRoot1  7.9G  2.8G  4.8G  37% /
tmpfs                               372M  228K  371M   1% /dev/shm
/dev/sda1                           485M   35M  426M   8% /boot
/dev/mapper/vg_skerchi_sys-LVHome1 1008M  104M  854M  11% /home
/dev/mapper/vg_skerchi_sys-LVtest1  8.0M  4.0K  8.0M   1% /fattest

If the mountflags on both vfat partitions are set to umask=0022 (drwxr-xr-x) or 
umask=0066 (drwx--x--x) the error goes away. If the umask is 0066, the 
directory cannot be listed by ordinary users, so perhaps that can pass the 
security requirements for your organisation...

Cheers,
Tony

Other related posts: