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 1d037VPu93T0 for ; Thu, 29 Aug 2013 07:50:11 +0200 (CEST) Received: from mail-ea0-x22b.google.com (mail-ea0-x22b.google.com [IPv6:2a00:1450:4013:c01::22b]) (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 Aug 2013 07:50:10 +0200 (CEST) Received: by mail-ea0-f171.google.com with SMTP id n15so3352084ead.2 for ; Wed, 28 Aug 2013 22:50:10 -0700 (PDT) Message-ID: <521EE10F.4040602@gmail.com> Date: Thu, 29 Aug 2013 07:50:07 +0200 From: Milan Broz MIME-Version: 1.0 References: <1377358818.1313.21.camel@ryx.lan> <20130826082310.GA10172@citd.de> In-Reply-To: <20130826082310.GA10172@citd.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dm-crypt] u?mount (8) helper script for luks encrypted disks List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Matthias Schniedermeyer Cc: dm-crypt@saout.de, Debian Cryptsetup Team , Steffen Vogel On 26.8.2013 10:23, Matthias Schniedermeyer wrote: > Personally i "solved" this by renaming /bin/mount to /bin/mount.orig > and putting a shell-script as /bin/mount that checks if i want to mount > a /dev/mapper/XXX and does the setup of XXX before it calls > /bin/mount.orig. Underlying device construction can be very complex task sometimes (it can be combination of lvm, mdraid, multipath, partitions and whatever.) So while it works for your use case, it will not work for other. > "Back then" when i implemented that about 1.5 years ago i tried to > explain to Karel Zak (util-linux maintainer) that a generic "premount" > and "postumount" command in (u)mount could solve this generic problem. > The Problem that all cryptographic-setups need (at least) one more step > to setup(/tear-down) a device. But that didn't happen and i didn't try > to open the issue again. For that particular case, LUKS tear down, I think we had a better approach. Just implement auto removal on last device close (similar to loop device autoclear flag.) For more info see https://bugzilla.redhat.com/show_bug.cgi?id=873734 Milan p.s. Be very careful with shell scripts in mount helpers here. It will run under the same UID as mount, which means root for LUKS here.