Red Hat Bugzilla – Bug 1305431
[RFE] df command is not showing backing file for loop mounts
Last modified: 2016-07-13 08:40:39 EDT
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?
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?
Adding Karel Zak (util-linux - mount upstream maintainer) to cc. Karel, what do you think?
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.
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.