Read more

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

Arne Hartherz
May 07, 2012Software engineer at makandra GmbH

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

Illustration web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
Read more Show archive.org snapshot

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
Posted by Arne Hartherz to makandra dev (2012-05-07 15:16)