From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from huffman.acsalaska.net (huffman.acsalaska.net [209.112.173.250]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.saout.de (Postfix) with ESMTPS for ; Thu, 13 Jan 2011 02:31:43 +0100 (CET) Date: Wed, 12 Jan 2011 16:14:17 -0900 From: Roger Message-ID: <20110113011417.GD4513@localhost2.local> References: <20110112053435.GB5368@localhost2.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [dm-crypt] Auto Mounting when file accessed? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ma Begaj Cc: dm-crypt@saout.de, Roger >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. -- Roger http://rogerx.freeshell.org/