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:41:22 +0200	[thread overview]
Message-ID: <de1756bf-3e8f-f2db-60ae-179067ff35f4@gmx.de> (raw)
In-Reply-To: <cabd1dc9-8eff-8000-ed3b-39c0463ae376@gmx.de>

On 03/31/2017 12:03 PM, Rüdiger Meier wrote:
>
>
> 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. :)

BTW is there also a way to get "findmnt -n -o SOURCE" working if the
argument is not a mount point but a regular file on another mount
point? (In opposite of my initial question.)

I don't like that all these questions here are answered using "df".
http://unix.stackexchange.com/questions/90252/how-to-get-mount-point-of-filesystem-containing-given-file

http://unix.stackexchange.com/questions/128471/determine-what-device-a-directory-is-located-on


cu,
Rudi

  reply	other threads:[~2017-03-31 10:41 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
2017-03-31 10:41     ` Rüdiger Meier [this message]
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=de1756bf-3e8f-f2db-60ae-179067ff35f4@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.