19

If I mount a simple loop device,

losetup -a

give me the devices opened. Is something similar possible with cryptsetup?

24

dmsetup is useful for anything device mapper related. For Example:

[root@localhost]~# dmsetup ls --target crypt
luks-90dc732d-e183-4948-951e-c32f3f11b305   (253, 0)
[root@localhost]~# 
| improve this answer | |
  • 2
    Is there any way to list all mappings with their target type? The best I could manage was for i in $(sudo dmsetup targets | cut -f1 -d' '); do echo $i:; sudo dmsetup ls --target $i; echo; done – mwfearnley Apr 5 '18 at 9:49
  • 5
    Thx. Getting the list shouldn't be so cryptic... luksList would be nice. – bvj Apr 18 '19 at 5:31
9

I just looked for the same thing, a list of my luks partitions, though I wanted a mapping to the physical /dev/sdX devices.

I found a solution for that here: https://bbs.archlinux.org/viewtopic.php?id=164798

lsblk --fs
| improve this answer | |
  • This is not that bad to be honest. Thanks! – Konrad Gajewski Jan 18 at 15:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.