All of lore.kernel.org
 help / color / mirror / Atom feed
From: Milan Broz <gmazyland@gmail.com>
Cc: "dm-crypt@saout.de" <dm-crypt@saout.de>
Subject: Re: [dm-crypt] u?mount (8) helper script for luks encrypted disks
Date: Fri, 30 Aug 2013 08:23:19 +0200	[thread overview]
Message-ID: <52203A57.6060606@gmail.com> (raw)
In-Reply-To: <CAFnMBaQ5m_txJKATjJqdWsvsTjs7=oUZBj7xzrW8v0mQA316Fg@mail.gmail.com>

On 30.8.2013 7:58, .. ink .. wrote:
>
>     On 30.8.2013 1:56, .. ink .. wrote:
>
>         On unmounting.
>         1. Look at the path to be unmounted,if it starts with "/dev/mapper/"
>         then it could an mdraid path or a cryptsetup mapper path or
>         something else.Its easy to check which one is it.
>
>
>     Nope.
>
>     You have /dev/VG/LV or /dev/mpath/NAME (aka friendly mpath names) etc.
>     These are symlinks, or on non-udev system directly device nodes.
>
>     If you want to check for dm device, you should check for major
>     number of device. Ditto for MD (note md can be some fake
>     raid as well as replacement for dmraid.)
>
>
> checking for major:minor number does not work on devices with btrfs[1]

Yes. But I thought you want to check if underlying device is DM device,
then major is DM major number always.

>
> What i do in my project to identify lvm path is to check if the path exists in both "/dev/abc/def" and "/dev/mapper/abd-def".formats.

That will _usually_ work but the cost of duplicating lvm/mpath naming
logic in your program (I think multipath has this configurable also).

>
> mdraid paths are usually in "/dev/mdX" or "/dev/md/X" format.

Yes. But once this will change, you will have to update all programs
which have this logic hardcoded.


But again, it it works for you, that's fine but maintaining
such script upstream means thinking about generic solution.

> [1] http://article.gmane.org/gmane.comp.file-systems.btrfs/2851

Yes, I know about it, util-linux maintainer complained several times about
it as well.

Milan

  reply	other threads:[~2013-08-30  6:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-24 15:40 [dm-crypt] u?mount (8) helper script for luks encrypted disks Steffen Vogel
2013-08-26  8:23 ` Matthias Schniedermeyer
2013-08-29  5:50   ` Milan Broz
2013-08-29 23:16     ` Matthias Schniedermeyer
2013-08-29 23:56       ` .. ink ..
2013-08-30  5:29         ` Milan Broz
2013-08-30  5:58           ` .. ink ..
2013-08-30  6:23             ` Milan Broz [this message]
2013-08-30  7:59         ` Matthias Schniedermeyer
2013-08-30  8:24           ` .. ink ..
2013-08-30  8:58             ` Matthias Schniedermeyer

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=52203A57.6060606@gmail.com \
    --to=gmazyland@gmail.com \
    --cc=dm-crypt@saout.de \
    /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.