AndrewKMitchell.com The online home of Andrew Kenton Mitchell

Accessing LUKS encrypted Volume Groups (and other filesystems)

As a consultant you often get called in only when something has gone very wrong. Sadly this more often then not means that someone has lost access to data the need.

I have begun to notice that with many of the Linux clients I support that there is a common misconception as to the accessibility of LUKS encrypted filesystems if a problem occurs. First and foremost, LUKS is not a filesystem like most are a custom.  LUKS is encryption of the underling filesystems which most people are a custom to.

This means that before a filesystem which is encrypted using LUKS can be accessed it must be unlocked. This can be done as follows:

cryptsetup /dev/sda1 home

The above command unlocks physical device /dev/sda1 and creates a device pointer of /dev/mapper/home if the correct passphrase is entered.  Once the device pointer has been created, you can mount the filesystem.

if your physical device contains Volume Groups, don’t forget to activate them:

vgchange -a y [VolumeGroupName]

If you don’t know the applicable values of [VolumeGroupName] use:

vgdisplay

Once the VolumeGroup is active the Logical Volumes inside it may be mounted, unusually as /dev/VolumeGroupName/LogicalVolumeName device pointers.

If you don’t know the applicable values of LogicalVolumeName use:

lvdisplay

From this point if everything went according to plan, your data should be accessible baring any issues with physical hardware.

Your email is never shared.
Required fields are marked *