Re: What about a premount/postumount option for mount?

Matthias Schniedermeyer
2012-02-28T14:44:39Z

On 28.02.2012 14:59, Karel Zak wrote:
> On Sat, Feb 11, 2012 at 01:30:16PM +0100, Matthias Schniedermeyer wrote:
> > This solution would also make for e.g. "loop-aes" more easily usable,
> > currently one has to use a patched version of mount/losetup. With a
>
> Do you know that the latest cryptsetup is able to map loop-aes images
> by dm-crypt?

Which is exactly the problem i'm trying to solve:
Moving from loop-aes to dm-crypt, without reencrypting the discs and
retaining "autofs"ability.
The latter, as far as i can determine, is currently not possible without
patching something.

On my test-machine i build a crude version of "premount/postumount". I
did that by "diverting" (A Debian specific package-manager thing)
/bin/mount to /bin/mount.orig (Same for umount) and putting a
shell-script for /bin/mount that checks for /dev/mapper/... and sets it
up on mount and then execs /bin/mount.orig. Same for umount, only it
does the "loopaesClose" after running umount.orig.

This solution works more or less satisfactory, only the robustness isn't
optimal.