GNU bug report logs - #10363
/etc/mtab -> /proc/mounts symlink affects df(1) output for /

Previous Next

Package: coreutils;

Reported by: jidanni <at> jidanni.org

Date: Sun, 25 Dec 2011 00:44:02 UTC

Severity: normal

Tags: fixed

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 10363 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Jim Meyering <jim <at> meyering.net>
Cc: 10363 <at> debbugs.gnu.org, coreutils <at> gnu.org
Subject: Re: bug#10363: df vs. long-named /dev/disk/by-uuid/... file system
	device names
Date: Thu, 29 Dec 2011 16:02:08 +0000
On 12/29/2011 02:09 PM, Jim Meyering wrote:
> On systems with recent kernel/tools, a symlink from /etc/mtab to
> /proc/mounts, and a by-UUID mount (i.e., soon, nearly everyone),
> you will see something like the following when running "df -hT":
> 
>   Filesystem                                             Type      Size  Used Avail Use% Mounted on
>   rootfs                                                 rootfs     11G  1.9G  8.0G  19% /
>   /dev/disk/by-uuid/828fc648-9f30-43d8-a0b1-f7096a2edb66 ext4       11G  1.9G  8.0G  19% /

Ouch.

BTW, this is the first mail I've gotten about 10363?

I guess this is the right thing to do.
I.E. have higher level paths in /proc/mounts, allowing
tools that require lower level paths to traverse the links
and pick the appropriate one.

The highest level path needs to be available to do this,
so I suppose this is appropriate in /proc/mounts,
even though it might not be the most appropriate for
human consumption, as can be seen above.

The patch looks good.
I guess "9" is the only questionable bit.
On my Fedora 16 system I have in /proc/mounts:

  /dev/mapper/vg_tp1-lv_root ...... /

That's a fairly informative name, whereas the links further
resolve to a fairly generic:

  /dev/dm-2

Hmm, I was contemplating using the old wrap limit of 19,
but apart from not handling the above, using a width
is inconsistent.  Perhaps it's better to always resolve?
I.E. always print the base device.  It seems that one
can work back from this anyway:

$ findmnt --source /dev/dm-2
TARGET SOURCE                     FSTYPE OPTIONS
/      /dev/mapper/vg_tp1-lv_root ext4   rw,relatime,...

cheers,
Pádraig.




This bug report was last modified 6 years and 223 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.