volume.is_mounted wrong for luks partitions

David Zeuthen david at fubar.dk
Sun Apr 16 11:34:21 PDT 2006


On Sun, 2006-04-16 at 14:29 -0400, David Zeuthen wrote:
> Another thing is that we really want to get away from looking at
> symlinks and use e.g. dm_task_get_deps to figure out that the device
> mapper volume really stems from the LUKS encrypted physical volume.

Replying to myself, actually it seems that the latest kernels have this
bit of info

 # tree /sys/block/dm-0
 /sys/block/dm-0
 |-- dev
 |-- holders
 |-- range
 |-- removable
 |-- size
 |-- slaves
 |   `-- sda2 -> ../../../block/sda/sda2
 |-- stat
 `-- uevent

 # tree /sys/block/sda/sda2/
 /sys/block/sda/sda2/
 |-- dev
 |-- holders
 |   `-- dm-0 -> ../../../../block/dm-0
 |-- size
 |-- start
 |-- stat
 `-- uevent

Now just need to figure out when this was introduced (does anyone know?)
and whether it's sufficient to look at the slaves/ subdirectory. Then
write a small patch to use this :-)

    David




More information about the hal mailing list