GNOME Bugzilla – Bug 525346
Can't mount encrypted volumes
Last modified: 2008-04-20 17:26:52 UTC
Please describe the problem: [ forwarded from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=467200 ] I am no longer able to mount an encrypted volume. The last time I tried was a couple of months ago, when it worked. When I insert the device, I am prompted for my passphrase. Even through I enter it correctly, I am prompted again. If I enter it a second time, the prompt goes away, and a device-mapper mapping is created for the device, but the volume does not get mounted. In fact, the '300 GB volume' icon disappears from computer:/// entirely! Some digging around lead to the gnome-mount utility. If I manually deactivate the device-mapper mapping and try to use it, I get the following errors: $ gnome-mount -t -d /dev/sda1 gnome-mount 0.7 Enter password to unlock encrypted data for /dev/sda1: Setup clear-text device for /dev/sda1. Clear text device is /dev/dm-2. Mounting. ** (gnome-mount:6191): WARNING **: /org/freedesktop/Hal/devices/volume_part_1_size_0 does not have a mountable filesystem O RLY? # file -s /dev/dm-2 /dev/dm-2: Linux rev 1.0 ext3 filesystem data (large files) Well, let's try to mount it again: $ gnome-mount -t -d /dev/dm-2 gnome-mount 0.7 GConf Error: Bad key or directory name: "/system/storage/default_options/(null)/fstype_override": `(' is an invalid character in key/directory names ** (gnome-mount:6233): WARNING **: Mount failed for /org/freedesktop/Hal/devices/volume_part_1_size_0 org.freedesktop.DBus.Error.UnknownMethod : Method "Mount" with signature "ssas" on interface "org.freedesktop.Hal.Device.Volume" doesn't exist Let's try manually: # mount /dev/dm-2 /mnt; echo $? 0 Success! Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information: Also filed with hal at <https://bugs.freedesktop.org/show_bug.cgi?id=15285>.
This is most likely a bug with either cryptsetup itself or how cryptsetup is integrated into Debian. The root problem is that cryptsetup creates an intermediate dm device before creating the real one (check with udevmonitor). Am pretty sure your udev rules don't handle that correctly. Try adding rules to ignore the temporary node (match on the dm name) and I think it'll work.
David, can you give me some more details about this problem? I didn't get any response from the maintainers of the cryptsetup problem and I would really, really like to fix it. I find the whole situation very confusing... no one seems to know whether the bug is in gnome-mount, gnome-volume-manager, hal, crypsetup or udev... :)
Created attachment 109553 [details] udevmonitor log Output of 'udevmonitor' when plugging in the encrypted disk
So, I added this to my udev rules and now I can mount things again! # ignore device mapper nodes # http://bugzilla.gnome.org/show_bug.cgi?id=525346 KERNEL="dm-[0-9]*", OPTIONS+="ignore_device" The difference to the output of udevmonitor is very very subtle; I'll attach the output of 'udevmonitor' both before and after this change.
Created attachment 109555 [details] udevmonitor before
Created attachment 109556 [details] udevmonitor after the difference is very subtle; the order of a single event is different.
FYI, I've recommended that this rule be added to Debian's udev rules. If you wish to comment, see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=476874.