Device mapper interface and HAL

W. Michael Petullo mike at
Sat Sep 25 00:55:42 PDT 2004

I have been experimenting will encrypted media and hal.  I am
interested in seeing, for example, encrypted USB flash drives treated
as transparently as regular filesystems by a system based around hal
and gnome-keyring.

I wrote a quick proof of concept patch vs. fstab-sync that is now
available at
I wouldn't recommend using it, but writing it was useful in ironing
out a few ideas.

Anyway, at this point I would like to see hald manage dm-crypt'ed logical
volumes.  Again, I have a rough setup working.  However, though the
dm-crypt kernel module seems to issue hotplug events when one creates
a new logical volume, the kernel does not create a "device" link in

Hald seems to rely on this link because it uses
sysfs_get_classdev_device() to determine a devices parent.

For example,

/sys/block/hda/device is a link to

But /sys/block/dm-0/device does not exist.

I got around this by hard coding sysfs_get_classdev_device() with a check
to see if clsdev->path = "/sys/block/dm-2" and returning an appropriate
value if this is the case.  Obviously this is not acceptable, but it
did allow me to verify that things should eventually work cleanly.

What is responsible for creating this device link?  The kernel?  Can
someone point out some code that creates this link?  Should a dm-crypt
volume's device link point to the physical disk that is a logical version
of (ie: dm-0/device points to the same place that sda1/device does)?

Once hal manages dm-crypt devices, it should be quite easy to set things up
with a script like fstab-sync.


hal mailing list
hal at

More information about the Hal mailing list