All of lore.kernel.org
 help / color / mirror / Atom feed
From: Milan Broz <gmazyland@gmail.com>
To: ".. ink .." <mhogomchungu@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 07:29:53 +0200	[thread overview]
Message-ID: <52202DD1.4040808@gmail.com> (raw)
In-Reply-To: <CAFnMBaS=uVRYj7t4U-HkDD30bXshLpQyq1TbyKncoPwTvixHDA@mail.gmail.com>

Well, if you want use such mount helper script, you can.

But I do no think this should be part of upstream package.

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.)

In shell script, I would use lsblk to detect it (that should have all
"known" tricks included :)

> 2. If its
> encrypted mapper path,then unmount the mapper and then call
> cryptsetup to unmap the mapper.If its not encrypted then just
> unmount.

Not sure if it works for lazy umount (device is still in use).

Also udev can perform blkid "scan on close" blocking the device
but this one problem should be already solved inside libdevmapper
(retrying removal).

Milan

  reply	other threads:[~2013-08-30  5:29 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 [this message]
2013-08-30  5:58           ` .. ink ..
2013-08-30  6:23             ` Milan Broz
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=52202DD1.4040808@gmail.com \
    --to=gmazyland@gmail.com \
    --cc=dm-crypt@saout.de \
    --cc=mhogomchungu@gmail.com \
    /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.