Bug 1325347 - Missing values with df command
Summary: Missing values with df command
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: coreutils
Version: 6.8
Hardware: x86_64
OS: Linux
urgent
urgent
Target Milestone: rc
: ---
Assignee: Kamil Dudka
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
: 1323843 1328521 (view as bug list)
Depends On:
Blocks: 1214472
TreeView+ depends on / blocked
 
Reported: 2016-04-08 13:36 UTC by Peter Pols
Modified: 2016-07-13 14:50 UTC (History)
7 users (show)

Fixed In Version: coreutils-8.4-43.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-13 14:50:03 UTC
Target Upstream Version:


Attachments (Terms of Use)
6.8 beta anaconda kickstart file (5.73 KB, text/plain)
2016-04-11 12:12 UTC, Peter Pols
no flags Details
mount command output (458 bytes, text/plain)
2016-04-11 12:13 UTC, Peter Pols
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1152615 0 unspecified CLOSED df incorrectly reports free space when filesystem is double-mounted 2021-02-22 00:41:40 UTC

Internal Links: 1152615

Description Peter Pols 2016-04-08 13:36:23 UTC
With Snapshot3 the df command only shows "-" for the size values of the FS.

Examples:
 
Filesystem     1K-blocks  Used Available Use% Mounted on
/dev/sda8              -     -         -    - /
tmpfs           16366788   288  16366500   1% /dev/shm
 
or
 
Filesystem           Type   Size  Used Avail Use% Mounted on
/dev/mapper/vg_jsbx2560m1-lv_root
                     -         -     -     -    - /
tmpfs                tmpfs   60G  300k   60G   1% /dev/shm
/dev/sda1            ext4   500M   43M  431M   9% /boot
/dev/mapper/vg_jsbx2560m1-lv_home
                     -         -     -     -    - /home

Comment 2 Kamil Dudka 2016-04-08 14:00:54 UTC
Could you please provide some steps to reproduce it and the exact version of the coreutils package?

Comment 3 Peter Pols 2016-04-08 14:10:03 UTC
1. Install EL6.8 x86_64 snapshot3
2. Boot 6.8 snapshot3
3. Login as root
4. Type df or df -h or ..
 
coreutils-8.4-42.el6.x86_64

Comment 4 Ondrej Vasik 2016-04-08 17:40:06 UTC
Can you please provide strace of this failing command ? Is there some specific filesystem type on these mounts?

Comment 5 Kamil Dudka 2016-04-11 07:50:27 UTC
(In reply to Peter Pols from comment #3)
> 1. Install EL6.8 x86_64 snapshot3
> 2. Boot 6.8 snapshot3
> 3. Login as root
> 4. Type df or df -h or ..
>  
> coreutils-8.4-42.el6.x86_64

I am not able to reproduce the problem on a fresh installation of the latest RHEL-6.8:

[root@el6 ~]# rpm -q coreutils
coreutils-8.4-42.el6.x86_64

[root@el6 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_el6-lv_root
                       18G  2.0G   15G  13% /
tmpfs                 1.9G     0  1.9G   0% /dev/shm
/dev/vda1             477M   75M  377M  17% /boot


Could you please elaborate on the first step?  How exactly do you install it?

Please attach the output of "mount" on the affected system.

Comment 6 Peter Pols 2016-04-11 12:11:39 UTC
The problem exists since 6.8beta (2.6.32-621.el6).
 
The installation (how/exactly) is visible with the anaconda-ks.cfg (see attechment).

Comment 7 Peter Pols 2016-04-11 12:12:49 UTC
Created attachment 1145947 [details]
6.8 beta anaconda kickstart file

Comment 8 Peter Pols 2016-04-11 12:13:41 UTC
Created attachment 1145949 [details]
mount command output

Comment 9 Peter Pols 2016-04-11 12:19:04 UTC
The problem exists on all seen primergy installations with various FS (ext3/ext4).

Comment 10 Kamil Dudka 2016-04-11 13:14:51 UTC
Comment on attachment 1145949 [details]
mount command output

> /tmp on /tmp type none (rw,bind)
> /var/tmp on /var/tmp type none (rw,bind)
> /home on /home type none (rw,bind)

This ^^^ is the cause.  The above directories are for some reason bind-mounted to themselves.  I am able to trigger the bug on my el6 machine by the following command:

# mount --bind /home /home

Comment 11 Kamil Dudka 2016-04-11 13:23:35 UTC
Unfortunately, the problem does not seem to be limited to bind mounts to self.  The more common use of bind mounts also causes problems to df:

[root@el6 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_el6-lv_root
                       18G  2.0G   15G  13% /
tmpfs                 1.9G     0  1.9G   0% /dev/shm
/dev/vda1             477M   75M  377M  17% /boot

[root@el6 ~]# mkdir /mnt/root
[root@el6 ~]# mount --bind / /mnt/root
[root@el6 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_el6-lv_root
                         -     -     -    - /
tmpfs                 1.9G     0  1.9G   0% /dev/shm
/dev/vda1             477M   75M  377M  17% /boot

Comment 13 Kamil Dudka 2016-04-11 15:22:49 UTC
The following upstream commit fixes the bug:

http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=ed1a495b

Comment 14 Kamil Dudka 2016-04-11 18:01:47 UTC
Unfortunately, the above patch fixes only the common case (without -a).  If -a is used, the output of df for bind-mounted entries still differs from rhel-6.7.

In order to fix it properly, gnulib/mountlist patches are needed but they rely on /proc/self/mountinfo, which could lead to unexpected side effects.  This is the first gnulib commit where df starts to work properly:

http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=3fb6e360

I am afraid the only safe way to fix this is to revert the fix for bug #1152615.

Comment 17 Ondrej Vasik 2016-04-18 14:14:18 UTC
*** Bug 1323843 has been marked as a duplicate of this bug. ***

Comment 18 Kamil Dudka 2016-04-19 15:08:42 UTC
*** Bug 1328521 has been marked as a duplicate of this bug. ***

Comment 19 Chris Tatman 2016-04-20 01:33:26 UTC
Hi Samuel,

Can you guys please pull the coreutils package from the link I sent you and test asap?

Thanks!

--Chris

Comment 20 samuel.miller 2016-04-20 14:13:28 UTC
Chris, 

I also sent you an email that the provided rpm has a dependency of coreutils-8.4-43.el6.x86_64.rpmendency. If you could please provide this package. I was unable to find this package on any of the yum repositories.

Comment 21 samuel.miller 2016-04-20 15:05:27 UTC
Sorry I had a bad paste. The dependency is 
"error: Failed dependencies:
        coreutils-libs = 8.4-43.el6 is needed by coreutils-8.4-43.el6.x86_64"

Comment 22 samuel.miller 2016-04-20 17:35:15 UTC
After applying 
coreutils-libs-8.4-43.el6.x86_64
coreutils-8.4-43.el6.x86_64
df command is now listing root volume correctly. 

[root@ictm1620s01h2 scratch]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/rootvg-root
                         -     -     -    - /
tmpfs                  32G  296K   32G   1% /dev/shm
/dev/sda1             190M   40M  141M  23% /boot

[root@ictm1620s01h2 scratch]# rpm -Uvh --nodeps coreutils-libs-8.4-43.el6.x86_64.rpm
warning: coreutils-libs-8.4-43.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                ########################################### [100%]
   1:coreutils-libs         ########################################### [100%]
[root@ictm1620s01h2 scratch]# rpm -Uvh --replacefiles coreutils-8.4-43.el6.x86_64.rpm
warning: coreutils-8.4-43.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                ########################################### [100%]
   1:coreutils              ########################################### [100%]
[root@ictm1620s01h2 scratch]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/rootvg-root
                       87G  7.9G   75G  10% /
tmpfs                  32G  296K   32G   1% /dev/shm
/dev/sda1             190M   40M  141M  23% /boot

Comment 23 Kamil Dudka 2016-04-20 18:15:57 UTC
(In reply to samuel.miller from comment #22)
> After applying 
> coreutils-libs-8.4-43.el6.x86_64
> coreutils-8.4-43.el6.x86_64
> df command is now listing root volume correctly. 

Thanks for confirmation!

Comment 24 samuel.miller 2016-04-25 13:58:20 UTC
Is this patch targeted for Rhel 6.8 GA release?

Comment 25 Kamil Dudka 2016-04-25 14:18:41 UTC
(In reply to samuel.miller from comment #24)
> Is this patch targeted for Rhel 6.8 GA release?

This bug is fixed by reverting the patch for bug #1152615 and the revert is already committed.  This bug will not appear in any released RHEL-6 package.

Comment 26 Peter Pols 2016-04-28 08:57:03 UTC
Confirmation. Bug is fixed with Rhel 6.8 RC and coreutils-8.4-43.el6.

Comment 27 Kamil Dudka 2016-07-13 14:50:03 UTC
This bug has never affected any released version of RHEL-6 coreutils.  Closing.


Note You need to log in before you can comment on or make changes to this bug.