From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.saout.de ([127.0.0.1]) by localhost (mail.saout.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UsMCF3LauuCK for ; Thu, 29 Nov 2012 15:53:08 +0100 (CET) Received: from mail-ee0-f50.google.com (mail-ee0-f50.google.com [74.125.83.50]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mail.saout.de (Postfix) with ESMTPS for ; Thu, 29 Nov 2012 15:53:07 +0100 (CET) Received: by mail-ee0-f50.google.com with SMTP id b45so8569314eek.37 for ; Thu, 29 Nov 2012 06:53:07 -0800 (PST) Message-ID: <50B776CF.60501@gmail.com> Date: Thu, 29 Nov 2012 15:53:03 +0100 From: Milan Broz MIME-Version: 1.0 References: <20121129134313.GA14313@citd.de> In-Reply-To: <20121129134313.GA14313@citd.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [dm-crypt] force luksClose List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Matthias Schniedermeyer Cc: dm-crypt@saout.de, Benjamin Eberhardt 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 " instead of cryptsetup remove/luksClose " 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.