Mapping encrypted volume groups to disk partitions

I’m about to try installing a Fedora 12 test image onto the spare disk partition in this computer, but it’s taken me a while to work out which partition actually is spare. The reason: most of my filesystems are in logical volumes on LUKS-encrypted devices.

So, for my own reference as much as anything else, here is how to map an encrypted logical volume back to an actual disk partition.

Take a look at the mounted devices with “mount”.  In my case, I can see that /dev/mapper/vg_worm01-LogVol00 is mounted at the filesystem root /.  This logical volume belongs to a volume group vg_worm01 (it’s right there in the name).

Next, take a look at which physical volumes are collected into this volume group using “pvdisplay”.  For me, that’s just one: /dev/dm-1.

Finally, “cryptsetup status /dev/dm-1” says which actual device underlies the whole lot: /dev/sda3.






3 responses to “Mapping encrypted volume groups to disk partitions”

  1. Yanko avatar

    lvdisplay -m

  2. tim avatar

    Yanko: thanks. I still need to use cryptsetup to map /dev/dm-x to actual disk partitions though.

  3. tim avatar

    New method: “dmsetup ls –tree”