From: Ruediger Meier <sweet_f_a@gmx.de>
To: util-linux@vger.kernel.org
Subject: question about findmnt --target
Date: Tue, 17 Mar 2015 16:08:58 +0100 [thread overview]
Message-ID: <201503171608.58423.sweet_f_a@gmx.de> (raw)
Hi,
I wonder what is the correct way to find a mount which is mounted to a
certain target directory. findmnt --target will also find a mount if
you specify a subdirectory of a mountpoint:
$ mkdir /tmp/bla
$ findmnt --target /tmp/bla
TARGET SOURCE FSTYPE OPTIONS
/tmp /dev/mapper/vg0-tmpdirs[/tmp] ext4 ....
The man page let me think that --target should not find the parent
directory.
man findmnt:
[...]
findmnt [options] device|mountpoint
findmnt [options] [--source] device [--target] mountpoint
[...]
The device may be specified by [...]. Note that a device name may be
interpreted as a mountpoint (and vice versa) if the --target
or --source options are not specified.
[...]
-T, --target dir
Explicitly define the mount target (mountpoint directory).
I'm asking because even our test-suite is using findmnt wrong, for
example tests/ts/mount/move:
[...]
# move
$TS_CMD_MOUNT --move $DIR_A $DIR_B
# check the move
$TS_CMD_FINDMNT --kernel --target "$DIR_B" &> /dev/null
[ "$?" == "0" ] || ts_die "Cannot find binded $DIR_B"
[...]
This findmnt line will never fail I guess.
cu,
Rudi
next reply other threads:[~2015-03-17 15:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-17 15:08 Ruediger Meier [this message]
2015-03-17 16:34 ` question about findmnt --target Karel Zak
2015-03-17 17:14 ` Ruediger Meier
2015-03-17 19:25 ` Karel Zak
2015-03-18 13:50 ` Ruediger Meier
2015-03-18 22:05 ` Karel Zak
2015-03-18 7:33 ` Bernhard Voelker
2015-03-18 10:17 ` Karel Zak
2015-03-18 10:39 ` Ruediger Meier
2015-03-18 11:22 ` Karel Zak
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=201503171608.58423.sweet_f_a@gmx.de \
--to=sweet_f_a@gmx.de \
--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