Got access to a luks2 encrypted USB boot drive that borked

Sat Aug 20 2022 00:00:00 GMT+0000 (Coordinated Universal Time)

Preliminary notes. I wasn't exactly sure what I was doing here. Maybe it was already mounted and that was the problem. Anyway, files saved.

A USB boot disk with luks2 and LVM refused to boot. Needed to save the files from it.

I connected it to another computer.

Used this to figure out its /dev/sd(letter)(number):

sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL

It was /dev/sdc6. Opened it into a logical volume name that I made up, "my_encrypted_volume":

sudo cryptsetup luksOpen /dev/sdc6 my_encrypted_volume

Made a local mount point in the home directory

mkdir -p mnt/rescue

Mounted it there:

sudo mount /dev/mapper/my_encrypted_volume mnt/rescue

And that did not work for me, it may work for you. I got an error message about:

mount: unknown filesystem type 'LVM2_member'

I figured out its LVM(?) name by issuing:

sudo pvscan

Then took that name, e.g.: "root-vg" and issued:

sudo vgchange -a n root-vg
sudo vgchange -a y root-vg

…to make Linux mark it as inactive, then active again. Got this info from this page:

https://svennd.be/mount-unknown-filesystem-type-lvm2_member/

And then it could be mounted and then accessed under $HOME/mnt/rescue. Copied files off of it with:

rsync -rh --progress mnt/rescue/path/to/files /media/username/mybackudisk/backups/

The lsblk dance I got from https://askubuntu.com/questions/182446/how-do-i-view-all-available-hdds-partitions .