If I mount a simple loop device,
losetup -a
give me the devices opened.
Is something similar possible with cryptsetup
?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityIf I mount a simple loop device,
losetup -a
give me the devices opened.
Is something similar possible with cryptsetup
?
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]~#
for i in $(sudo dmsetup targets | cut -f1 -d' '); do echo $i:; sudo dmsetup ls --target $i; echo; done
Apr 5, 2018 at 9:49
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
lsblk
supports -J
or --json
to output the result in a machine readable format. Which can be useful when doing a reverse lookup of dmcrypt mapper devices (/dev/sda
-> luksloop
for instance by iterating the /dev/sda
children object).