From: Karel Zak <kzak@redhat.com>
To: Linda Walsh <lkml@tlinx.org>
Cc: util-linux@vger.kernel.org
Subject: Re: mount --no-canonical seems broken.
Date: Mon, 20 May 2013 09:40:01 +0200 [thread overview]
Message-ID: <20130520074001.GE16493@x2.net.home> (raw)
In-Reply-To: <517729C7.2030806@tlinx.org>
On Tue, Apr 23, 2013 at 05:39:35PM -0700, Linda Walsh wrote:
> Well my main concern has been how lvm volumes are renamed.
>
> i.e. /dev/Vol-group/Log-vol ->
> /dev/mapper/Vol--group-Log--vol
The /dev/mapper/<name> is the canonical name, this is only
user-friendly name that is possible to generate by utils in userspace,
because the <name> is exported by /sys/block/dm-<n>/dm/name to
userspace.
Things like /dev/Vol-group/Log-vol are LVM specific and
there is no way how to convert /dev/dm-<n> to this format. This is
reason why mount(8) canonicalizes the names to /dev/mapper/<name>.
> I have backup and file-system utils that use the values in fstab, and it
> looks for those values in the output of mount (and df).
The ideal solution is to use utils which are able to convert
symlinks/tags/whatever to canonical device names. It's mistake to
assume that fstab matches with /proc/mounts.
Use
$ findmnt --fstab --canonicalize --evaluate
to get canonical paths and evaluated tags.
> I've been using the mount --no-canonicalize to mount my lvm volumes --
> and also going back and doing the "mount -f --nocanonicalize ..." to get the
> ones mounted at boot time.
> Recently it was changed back to a symlink and on top of that -- whether
> it is a file or a symlink, mount doesn't seem to show the "non-canon" name
> (i.e. /dev/Vol/Log...)
> (though oddly enough -- "df" does!)...
The problem is that "mount" (without options) prints always canonicalized
paths (and in this case --no-canonicalize has no effect, this option
is used for mounting only). It means if you have non-canonical paths
in /etc/mtab then "mount" still prints canonical paths. I can fix it
and make the output sensitive to --no-canonicalize option too.
Anyway, use findmnt, it provides but complete control on the output.
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
next prev parent reply other threads:[~2013-05-20 7:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-22 22:30 mount --no-canonical seems broken Linda Walsh
2013-04-23 12:36 ` Karel Zak
2013-04-24 0:39 ` Linda Walsh
2013-04-25 6:15 ` Linda Walsh
2013-05-20 7:40 ` Karel Zak [this message]
2013-05-20 23:30 ` Linda Walsh
2013-05-21 9:47 ` Karel Zak
2013-05-21 19:31 ` Linda Walsh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130520074001.GE16493@x2.net.home \
--to=kzak@redhat.com \
--cc=lkml@tlinx.org \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox