Util-Linux package development
 help / color / mirror / Atom feed
* question about findmnt --target
@ 2015-03-17 15:08 Ruediger Meier
  2015-03-17 16:34 ` Karel Zak
  0 siblings, 1 reply; 10+ messages in thread
From: Ruediger Meier @ 2015-03-17 15:08 UTC (permalink / raw)
  To: util-linux

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-03-18 22:05 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-17 15:08 question about findmnt --target Ruediger Meier
2015-03-17 16:34 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox