[dm-crypt] force luksClose

Benjamin Eberhardt eberhab at gmail.com
Tue Dec 25 13:17:28 CET 2012


Hi,

thank you very much for your replies. I tried to reproduce the problem
which I had once in order to supply more details, but so far the
procedure you described works very well (identifying the culprit and
luksClose). Ill get back to you if the problem should occur again.

Merry Christmas :)
Benjamin


On 29 November 2012 15:53, Milan Broz <gmazyland at gmail.com> wrote:
> On 11/29/2012 02:43 PM, Matthias Schniedermeyer wrote:
>
>> IOW. It's a problem of finding the culprit who holds the mountpoint
>> open.
>
> Exactly. You cannot remove open (in-use) device-mapper device.
>
> You can it replace with "error" target though (this will detach
> underlying device from mapping.).
>
> Just run "dmsetup remove -f <name>"
> instead of cryptsetup remove/luksClose <name>"
>
> But the dead DM device will still be in system. I can easily add such
> force option to cryptsetup as well but it will not help much.
>
> The correct way is to force unmout fs (or whatever use this device)
> and then remove crypt mapping (see lsblk, lsof etc).
>
> Milan
>
> p.s.
> There is a request to add "auto" removal flag for device-mapper devices
> (automatic remove after last close, similar to loop auto removal).
>
> Once this option will be in kernel cryptsetup will support it too.
> But this will not help with your situation anyway.


More information about the dm-crypt mailing list