From: Roger <rogerx.oss@gmail.com>
To: Ma Begaj <derliebegott@gmail.com>
Cc: dm-crypt@saout.de
Subject: Re: [dm-crypt] Auto Mounting when file accessed?
Date: Wed, 12 Jan 2011 15:57:02 -0900 [thread overview]
Message-ID: <20110113005702.GB4513@localhost2.local> (raw)
In-Reply-To: <AANLkTinczJA-G3E8AK_aRNTdeDm4EHo7bX=T4cO0=s=L@mail.gmail.com>
>On Wed, Jan 12, 2011 at 10:05:00PM +0100, Ma Begaj wrote:
>inotify-tools could probably help you... something like this could
>work, i think;
>
>------------------------------------
>#!/bin/sh
>
># watch for folders
>inotifywait -m -r --format "%e %w%f" /mnt/crypt | while read event file; do
>
> # and mount if not mounted
> if ! df | grep /mnt/crypt >/dev/null ; then
> mount /mnt/crypt
> fi
>done
>------------------------------------
I tried this and, instead of using "mount /mnt/crypt", I designated a script to run instead of using "mount
/mnt/crypt".
I kept getting a superblock/e2fsck error.
My script "mount-crypt" is nearly error proof as it utilizes losetup,
cryptsetup, and then calls e2fsck each time before mounting to /mnt/crypt.
mount-crypt always calls umount-crypt encase losetup is halfway started, and then
always calls e2fsck before mounting to /mnt/crypt.
The other issues are:
1) Using inotify requires to be in a script and needing to be started at startup.
2) It needs to embed password or app-crypt/pinentry
3) pinentry or asking for a passphrase is likely going to only occur on the
terminal inotify script is started from, vs for the terminal wanting access to
file or folder. Think #3 is going to be the real issue because it's calling
mount-crypt from another terminal or it's own bash process. I know the
pinentry gui prompt is likely not an issue though.
...anyways, I likely need to research everything here again and do some more
testing. Technically, everything I'm doing in mount-crypt should likely be
done behind the scenes.
--
Roger
http://rogerx.freeshell.org/
next prev parent reply other threads:[~2011-01-13 1:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-12 5:34 [dm-crypt] Auto Mounting when file accessed? Roger
2011-01-12 21:05 ` Ma Begaj
2011-01-13 0:57 ` Roger [this message]
2011-01-13 1:14 ` Roger
2011-01-13 8:22 ` Aaron Lewis
2011-01-13 9:39 ` Roger
2011-01-13 10:00 ` Roger
2011-01-13 18:25 ` Arno Wagner
2011-01-14 9:12 ` Ma Begaj
2011-01-12 23:13 ` Arno Wagner
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=20110113005702.GB4513@localhost2.local \
--to=rogerx.oss@gmail.com \
--cc=derliebegott@gmail.com \
--cc=dm-crypt@saout.de \
/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.