Ali Reza Sajedi wrote: > Hello all, > > I have an encrypted USB drive which I would like to be unlocked and > mounted when it is attached to the system. > > For this purpose I have a perl script called via a dev-rule when the > drive is attached. > > In the script I call the following comand to open the drive: > > system ("cryptsetup luksOpen /dev/sdb1 sdb1 --key-file > /path-to-keyfile/keyfile"); Udev is probably the wrong place to do this, since cryptsetup does some udev magic to make it wait for all outstanding events. And guess what: your script that ran from udev, that called cryptsetup, is making one of those events stay outstanding. :-) You might be able to change the rule, making it call your script differently, but what I'd try is either (a) finding somewhere else to hook this script in (not that I have any good suggestions :-( ), or (b) trying to make the script fork and do the work in the background. > and the following command to mount it on a predefined mountpoint: > > system ("mount -o sync,dirsync /dev/mapper/sdb1 /mnt/usb"); Doesn't your desktop handle automount for you when the /dev/mapper/* device shows up?
Attachment:
signature.asc
Description: OpenPGP digital signature
_______________________________________________ dm-crypt mailing list dm-crypt@xxxxxxxx http://www.saout.de/mailman/listinfo/dm-crypt