[dm-crypt] Auto Mounting when file accessed?

Aaron Lewis the.warl0ck.1989 at gmail.com
Thu Jan 13 09:22:17 CET 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I didn't follow this thread , but if you just want an simple device
auto-mounter and un-mounter , you should try out kernel auto mounter
rather than a simple script.

On 01/13/2011 09:14 AM, Roger wrote:
>> 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
>> ------------------------------------
> 
> 
> Oh, and one more big thing, a user can use:
> 
> vi /mnt/crypt/blah.txt, and vi will still open a file even though mounting has
> been called for.  Same goes for any other command used on /mnt/crypt before
> it's mounted.
> 
> And I think this is where dbus/udev would step in and hold or wait command and
> mount before proceeding with the command on the filesystem.
> 


- -- 
Best Regards,
Aaron Lewis - PGP: 0xDFE6C29E ( http://keyserver.veridis.com )
Finger Print: 9482 448F C7C3 896C 1DFE 7DD3 2492 A7D0 DFE6 C29E
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJNLrY5AAoJECSSp9Df5sKeD/4P/j5I3a1/ACIV9CAl69U4QFoz
z3PwQGOnNtky6lCMHeZllymcBdt7S5Mz8fTuDf6IKt9uygjO49fjphVCXDcpIVg8
lZyJ0+cmWjOADIwgXmUzEQn3llYOcUFd03lo6HQ2w9katnoPGENZR735QDmT5HVi
K+IXiaEj+golmKdl1Q+RAqBfmYpIJzvLS9QO294Dus5b3dS6UoVWbzy1LQRvvj9R
+Af3LthvWcxF17rwUJUuhL8D2B2UqfPYf+gSinCh700BaK3Q7ej71h6u03I0bqpk
GpBXemNp1BiliEsrZXpqjBYwbMSd5Q7KSGRXB4RU8Q1k/hWbqiW1gZf4gDscE1Gq
zV3oYg7vZ1fhbfXyTjJ7nD2cUwzCDOFILR1aaT40CBuaQzv5rUyajgCbYaxehXtv
3WRWg333DDJdDWClw0ztXBmTzv0uKsNTVJysgwVQK65VeUiZv/hPK59FbrZZohBI
GGe9QeDQoDXs/Q6+P9LIJQuBgBeNWZfNp61QR0Yyh2mlwaRgjKriVSdZQ+M0WSus
AArpQILdcZbixXhQyqmNMQt8ATqsRDq3YrIg8gG5EaGrQI4UXDddLINcBCMv9wYU
/2OziNznhd4WS4TcniQG7ispALih2UX48237GnxLVY5u4586z2v4ib+gOX4pgJEl
Ps2v3jp2kGQkkSOAor1+
=FOmr
-----END PGP SIGNATURE-----


More information about the dm-crypt mailing list