Red Hat Bugzilla – Bug 842040
df -P gives new lines when where '\n' is in any of the /proc/mounts fields.
Last modified: 2013-11-21 15:58:36 EST
Description of problem: df -P" file system information is not "always printed on exactly one line" Version-Release number of selected component (if applicable): RHEL 6.2 How reproducible: Easily reproducible [root@dhcp233-121 ~]# mount -o loop cd.iso '/media/Volume > Identifier'/ [root@dhcp233-121 ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup-lv_root 6.5G 3.2G 3.0G 52% / tmpfs 246M 0 246M 0% /dev/shm /dev/vda1 485M 45M 415M 10% /boot /root/cd.iso 348K 348K 0 100% /media/Volume Identifier [root@dhcp233-121 ~]# df -P Filesystem 1024-blocks Used Available Capacity Mounted on /dev/mapper/VolGroup-lv_root 6748936 3290120 3115984 52% / tmpfs 251360 0 251360 0% /dev/shm /dev/vda1 495844 45755 424489 10% /boot /root/cd.iso 348 348 0 100% /media/Volume Identifier [root@dhcp233-121 ~]# Steps to Reproduce: 1.Press enter between "Volume" and "Identifier" so it looks like this: $ genisoimage -V 'Volume Identifier' -o cd.iso /test1/ 2. Either burn to a disk and let nautilus mount it, or for manual mounting the mount point should include a newline. If you want to mount it manually, do this, putting a newline between "Volume" and "Identifier": # mkdir '/media/Volume Identifier' # mount -o loop cd.iso '/media/Volume Identifier'/ 3)df -h Actual results: It prints the information about the file system on two lines: /dev/sr0 348 348 0 100% /media/Volume Identifier [root@dhcp233-121 ~]# df -P Filesystem 1024-blocks Used Available Capacity Mounted on /dev/mapper/VolGroup-lv_root 6748936 3290120 3115984 52% / tmpfs 251360 0 251360 0% /dev/shm /dev/vda1 495844 45755 424489 10% /boot /root/cd.iso 348 348 0 100% /media/Volume Identifier [root@dhcp233-121 ~]# Expected results: The manual says about -P: "The information about each file system is always printed on exactly one line" [root@dhcp233-121 ~]# df -P Filesystem 1024-blocks Used Available Capacity Mounted on /dev/mapper/VolGroup-lv_root 6748936 3290120 3115984 52% / tmpfs 251360 0 251360 0% /dev/shm /dev/vda1 495844 45755 424489 10% /boot /root/cd.iso 348 348 0 100% /media/Volume Identifier [root@dhcp233-121 ~]# Additional info: This is now handled upstream with: http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commit;h=3ed70fd5
A clarification comment. /etc/mtab contains \012 but glibc will convert the \012 back to \n before sending to df. So the patch is needed to stop df outputting erroneous new lines.
(In reply to comment #5) > So the patch is needed to stop df outputting erroneous new lines. You mean a patch to escape special chars back to octal notation?
Sorry. The upstream patch is needed http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commit;h=3ed70fd5 That will convert control chars to to '?' As a side effect it will keep df from outputting \n df will not get octal escapes due to the processing done by glibc df will not output octal escapes for backwards compatibility reasons
Oops, I somehow overlooked the link in comment #0. That should do the job. Thanks!
This request was evaluated by Red Hat Product Management for inclusion in the current release of Red Hat Enterprise Linux. Because the affected component is not scheduled to be updated in the current release, Red Hat is unable to address this request at this time. Red Hat invites you to ask your support representative to propose this request, if appropriate, in the next release of Red Hat Enterprise Linux.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHSA-2013-1652.html