[pkg-cryptsetup-devel] Bug#586286: Bug#586286: device-mapper: ioctl: unable to remove open device temporary-cryptsetup-3433

Milan Broz mbroz at redhat.com
Fri Jul 9 12:37:25 UTC 2010


On 07/09/2010 02:26 PM, Jonas Meurer wrote:
> But then still the problem is, how should hal distinguish temporary
> cryptsetup devices reliably, when '/dev/dm-X' is used? Milan, is there
> any better/cheaper solution than a lookup for symlinks in /dev/mapper/*?

this is infamous change which was reguired by udev
(/dev/mapper/xyz is now symlink to /dev/dm-X node)

HAL cat translate it to real name:
- with recent kernel (I think >2.6.31, not sure now) you can simple
read /sys/block/dm-X/dm/name
also DM UUID should start with CRYPT-TEMP-*

inside udev rule it should have defined in some variable also (DM_NAME, DM_UUID)

There is similar code in util-linux-ng (mount) which prefers /dev/mapper
name before displaying /dev/dm-X.

I think using /sys/blocks/*/dm/name is simple - if you can ignore old kernels:)

Milan





More information about the pkg-cryptsetup-devel mailing list