[dm-crypt] How to find out about mapped device name?

.. ink .. mhogomchungu at gmail.com
Tue Feb 5 00:50:16 CET 2013


On Mon, Feb 4, 2013 at 6:32 PM, David Li <w.david.li at gmail.com> wrote:

> Hi Experts,
>
> I have already called luksFormat on a raw block dev and luksOpen to set up
> mapped device in /dev/mapper. Is there a command to find out about the
> mapping between the raw dev and mapped dev?
>
>
>
"cryptsetup status /dev/mapper/mapped_device" will give you the info at the
"device" field.

"readlink /dev/mapper/mapped_device" will give you something like
"../dm-1"..That address says the dm device is "/dev/dm-1"

take the "dm-1" component,add around it to gave a path
"/sys/block/dm-1/slaves/" and then go to the folder and you will see an
entry that will look like "sdc5".This entry will tell you the "raw device"
is "/dev/sdc5.

The first way require root's privileges.
The second way is hacky but does not
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.saout.de/pipermail/dm-crypt/attachments/20130204/d5b2a177/attachment.html>


More information about the dm-crypt mailing list