Bug 1305431 - [RFE] df command is not showing backing file for loop mounts
[RFE] df command is not showing backing file for loop mounts
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: coreutils (Show other bugs)
All Linux
medium Severity medium
: rc
: 7.3
Assigned To: Kamil Dudka
: FutureFeature
Depends On:
  Show dependency treegraph
Reported: 2016-02-08 03:41 EST by Birol Bilgin
Modified: 2016-07-13 08:40 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-07-13 08:40:39 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Birol Bilgin 2016-02-08 03:41:21 EST
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?

8. Does the customer have any specific timeline dependencies?

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

10. List any affected packages or components.

11. Would the customer be able to assist in testing this functionality if implemented?
Comment 2 Ondrej Vasik 2016-02-08 17:37:31 EST
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 02:29:21 EST
Adding Karel Zak (util-linux - mount upstream maintainer) to cc. Karel, what do you think?
Comment 7 Ondrej Vasik 2016-05-27 08:58:56 EDT
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 08:40:39 EDT
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.

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