[dm-crypt] how to determine the mapped device from the original device

Uwe Menges uwe.menges at web.de
Thu Dec 10 02:20:36 CET 2009


Alvin Thompson wrote:
> I was wondering if it is possible to determine the mapped device from the original device.  For example, if you used the command:
> 
>   cryptsetup luksOpen /dev/sdd1 backup
> 
> Can you later determine the mapped device name ('backup' in this case) if all you know is the device (/dev/sdd1)?

I don't know that, but I use entries in /etc/crypttab like:

backup01 /dev/disk/by-uuid/... /dev/shm/backupkey luks,noauto

and use

# cryptdisks_start backup01

which causes /dev/mapper/backup01 to appear.
Corresponding /etc/fstab entry is:

LABEL=backup01  /backup/disk1 auto noauto,noatime,nodiratime

Maybe this helps you with handling the devices.

Yours, Uwe



More information about the dm-crypt mailing list