question about findmnt --target

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux