HAL + LUKS

Jakub Schmidtke sjakub at gmail.com
Sat Oct 13 00:16:56 PDT 2007


Hi.

I wasn't able to login into bugzilla, so I write here.
I have some issues while dealing with LUKS-encrypted removable USB drives.
First thing, is that when I use some user frontends for mapping those volumes
using cryptsetup support in HAL, it happens sometime, that HAL 
adds /dev/mapper/temporary-cryptsetup-* device. Apparently this device is 
created by cryptsetup while checking if provided password is correct. If it 
is, new device, /dev/mapper/luks_crypto_* is created. It is also detected by 
HAL, but ignored, because the same volume is already present (under temporary 
name). After that, temporary device is removed. This way correct device path 
is not added, and when I try to access that volume using KDE's mediamanager, 
HALs returns an error, because /dev/mapper/temporary-cryptsetup-* does not 
longer exist. I have created a small patch for ignoring devices with that 
name (attached).

Another problem I had is with some of USB devices. Some of them, when I 
use 'Safely remove' action of KDE's mediamanager, are umounted and powered 
off. And their icons disappears from KDE's list of drives. If they are 
encrypted, they are also unmapped (cryptsetup luksClose). But some of mine 
USB drives are not powered down. I only get KDE's error, something 
like: "Media was umounted but could not be removed.". I am able to mount them 
again. But the problem is, that they don't get unmapped by cryptsetup, so 
they are still present as /dev/mapper/luks_crypto_*. I use another 
application, that calls 'teardown' method on such devices. It unmaps the 
volume properly, but the drive is still visible in KDE's media list (but it 
is not accessible, attempt to mount it raises an error, that the device 
path - /dev/mapper/luks_* - does not exist). I have no idea why that happens 
(especially when it happens only for some of my USB flash drives while others 
work fine. I also have one external USB HDD case, which works fine, and 
external USB harddrive - Seagate Freeagent - that doesn't, and can't be 
powered down using 'safely remove') and what might be a problem, but for some 
reason HAL still thinks that device is still there - and lshal confirms that.

My patch resolved the 'temporary device' problem. As for the second one, I 
have no idea what to do about it. But I am willing to help if any other 
information or tests are needed.


Jakub Schmidtke

-------------- next part --------------
A non-text attachment was scrubbed...
Name: cryptsetup_temp.patch
Type: text/x-diff
Size: 641 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/hal/attachments/20071013/2ff8e99a/attachment.patch 


More information about the hal mailing list