Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1325347

Summary: Missing values with df command
Product: Red Hat Enterprise Linux 6 Reporter: Peter Pols <peter.pols>
Component: coreutilsAssignee: Kamil Dudka <kdudka>
Status: CLOSED CURRENTRELEASE QA Contact: qe-baseos-daemons
Severity: urgent Docs Contact:
Priority: urgent    
Version: 6.8CC: agk, ctatman, kdudka, martin.wilck, peter.pols, samuel.miller, William.Kuzeja
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: coreutils-8.4-43.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-13 14:50:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1214472    
Attachments:
Description Flags
6.8 beta anaconda kickstart file
none
mount command output none

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.