Bug 1305431

Summary: [RFE] df command is not showing backing file for loop mounts
Product: Red Hat Enterprise Linux 7 Reporter: Birol Bilgin <bbilgin>
Component: coreutilsAssignee: Kamil Dudka <kdudka>
Status: CLOSED WONTFIX QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2CC: kdudka, kzak
Target Milestone: rcKeywords: FutureFeature
Target Release: 7.3   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-13 12:40:39 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:

Description Birol Bilgin 2016-02-08 08:41:21 UTC
1. Proposed title of this feature request

 List backing file with df command on loop mounts

2. Who is the customer behind the request?

Account name: Turkcell #1175262

SRM customer: no

TAM customer: yes

Strategic Customer: yes
 

3. What is the nature and description of the request?

 Prior to rhel 7 df command showed backing files on loop mounts,
 because command reads /etc/mtab this file
 with rhel 7 is symlink to /proc/self/mounts so is shows the loop device
 Customer wants the old behavior implemented for df.  

4. Why does the customer need this? (List the business requirements here)
 Customer has script depends on this functionality.
 

5. How would the customer like to achieve this? (List the functional requirements here)
 Either df command resolves this and pronts the backing file,
 or run df command with a flag to achieve this
 

6. For each functional requirement listed in question 5, specify how Red Hat

and the customer can test to confirm the requirement is successfully implemented.
 
 

7. Is there already an existing RFE upstream or in Red Hat bugzilla?
 No
 

8. Does the customer have any specific timeline dependencies?
 N/A
 

9. Is the sales team involved in this request and do they have any additional input?
 N/A
 

10. List any affected packages or components.
 coreutils
 df
 

11. Would the customer be able to assist in testing this functionality if implemented?
 yes

Comment 2 Ondrej Vasik 2016-02-08 22:37:31 UTC
Old behaviour of RHEL 6, where df read list of mounts from /etc/mtab can't be restored, as you mentioned, it is now symlink to /proc/mounts .

Because this dir contains many duplicities, deduplication is implemented there. However - this is not issue you refer to. Command df provides just the information provided by kernel on expected place. However, command mount from util-linux shows the backing file on both rhel 6 and rhel 7. I think this might be question for kernel developers why they don't show origin of loopback device in /proc/mounts.

Can you please be more clear on the usecase?

Comment 3 Ondrej Vasik 2016-02-09 07:29:21 UTC
Adding Karel Zak (util-linux - mount upstream maintainer) to cc. Karel, what do you think?

Comment 7 Ondrej Vasik 2016-05-27 12:58:56 UTC
Based on discussion with Karel, this is not going to be changed on coreutils side. 
Karel proposes using losetup tool to list loop device backing file instead of df. We can't revert the /etc/mtab changes - so the only option here is to update the scripts that relied on the old behaviour and change them in portable way. I think this bugzilla will end up WONTFIX at the end, but setting condnack design for now.

Comment 8 Kamil Dudka 2016-07-13 12:40:39 UTC
We cannot change the output of df for RHEL-7 because it could break existing solutions of our customers.  Even if we did, this bug would recur in the next major version of RHEL because the requested behavior is neither available in upstream nor in Fedora any more.

Please consider using losetup instead of df for querying the backing file.