Re: find device of a known mountpoint

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

 





On 03/31/2017 11:19 AM, Karel Zak wrote:
On Fri, Mar 31, 2017 at 11:00:24AM +0200, Rüdiger Meier wrote:
$ truncate -s100M /tmp/img
$ losetup /dev/loop0  /tmp/img
$ mkfs.ext2  /dev/loop0

$ mkdir /tmp/mnt
$ ln -s /tmp  /tmp/xyz/symlink

$ mount /dev/loop0 /tmp/xyz/symlink/mnt
$ mount | grep loop
/dev/loop0 on /tmp/mnt type ext2 ...


I need a command which outputs "/dev/loop0" when "/tmp/xyz/symlink/mnt" is
given.

  $ findmnt -no SOURCE /tmp/xyz/symlink/mnt
  /dev/loop0

Thank's. Now I remember that you have told me that already one day. :)


Note that for bind mounts there is nothing like primary (original)
and secondary mountpoints. It's two ways to the same filesystem.

Yep in this case the problem was only duplicate mountpoints when you mount something on a subdir a shared bind mount. I'll send a petch for one libmount test. I really hate that systemd defaults to shared ...

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