How to tell where a LUKS device is mapped to

Dave Smith dave at
Mon Aug 9 17:42:26 MDT 2010

I want to relate two related LUKS-related puzzles.

Puzzle 1: Finding where a LUKS device is mapped.

I have a device that is known to be LUKS formatted. Let's call it 
/dev/sda3. I verify that it is LUKS formatted as follows:

 > cryptsetup isLuks /dev/sda3
 > echo $?

Now I want to find out whether it's open. My first guess is to look in 
/dev/mapper, and sure enough, there are multiple devices in there that 
could be candidates.

 > ls -l /dev/mapper
total 0
crw-rw---- 1 root root  10, 59 2010-08-07 11:39 control
brw-rw---- 1 root disk 252,  0 2010-08-09 17:11 
brw-rw---- 1 root disk 252,  0 2010-08-09 17:15 

How can I tell which of the two /dev/mapper devices corresponds to 

Puzzle 2: The Reverse

I have a mountpoint, /mnt/foo, that I think might be mounted to a LUKS 
device. I use 'df' to find where it's mounted, as follows:

 > df -h /mnt/foo
Filesystem            Size  Used Avail Use% Mounted on
                       236M  2.1M  222M   1% /mnt/foo

That looks like a candidate to me. How do I find out which physical 
device that comes from?

Thanks in advance!


More information about the PLUG mailing list