How to access a dmcrypt-encrypted partition from outside your system

Updated . Posted . Visible to the public.

This is for you when you want to mount a dmcrypt encrypted partition manually, e.g. from a live CD.

First, open the dmcrypted partition (You need to provide some name. It may, but does not need to, be your LVM group name):

cryptsetup luksOpen /dev/sda5 some_name

Since your encryption container most likely contains an LVM group (root + swap for example), enable the logical volume manager (replace LVM_NAME with your volume group's name):

vgchange -ay LVM_NAME

After that, you can your access (mount, fsck, ...) LVM partitions at locations like /dev/mapper/LVM_NAME-root

To mount, create some mount-point (like mkdir /mnt/ext-root), and then

mount /dev/mapper/LVM_NAME-root /mnt/ext-root

GRUB

It is possible that GRUB (your system loader) will pick up on the new LVM group and add an entry to your boot menu.

To revert this

  • make sure the encrypted partition is no longer open
  • run vgscan
  • run update-grub
Arne Hartherz
Last edit
Tobias Kraze
Keywords
decrypt
License
Source code in this card is licensed under the MIT License.
Posted by Arne Hartherz to makandra dev (2012-05-07 13:16)