All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rüdiger Meier" <sweet_f_a@gmx.de>
To: Karel Zak <kzak@redhat.com>
Cc: util-linux@vger.kernel.org
Subject: Re: find device of a known mountpoint
Date: Fri, 31 Mar 2017 12:03:02 +0200	[thread overview]
Message-ID: <cabd1dc9-8eff-8000-ed3b-39c0463ae376@gmx.de> (raw)
In-Reply-To: <20170331091925.mpwmxxk4da4lsegr@ws.net.home>



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

  reply	other threads:[~2017-03-31 10:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-31  9:00 find device of a known mountpoint Rüdiger Meier
2017-03-31  9:19 ` Karel Zak
2017-03-31 10:03   ` Rüdiger Meier [this message]
2017-03-31 10:41     ` Rüdiger Meier
2017-03-31 10:54       ` Karel Zak
2017-03-31 11:20         ` Rüdiger Meier
2017-03-31 10:09   ` [PATCH] test: fix mountpoint device check in libmount/loop Ruediger Meier
2017-03-31 10:57     ` Karel Zak
2017-03-31 11:01     ` Rüdiger Meier

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=cabd1dc9-8eff-8000-ed3b-39c0463ae376@gmx.de \
    --to=sweet_f_a@gmx.de \
    --cc=kzak@redhat.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.