Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sudo apt-get install cryptsetup lvm2
- # insert kernel modules that we will need
- sudo modprobe dm-crypt
- sudo modprobe dm-mod
- # unlock the sda2 partition and call it MYTAG
- sudo cryptsetup luksOpen /dev/sda2 MYTAG
- Enter LUKS passphrase:
- key slot 0 unlocked.
- Command successful.
- # now that we have unlocked the encryption, deal with the lvm
- sudo vgscan # scan for all volume groups
- Reading all physical volumes. This may take a while...
- Found volume group "vg1" using metadata type lvm2
- # make the vg1 volume group active; if you don't give it a volume group as
- # an argument it'll make them all active
- sudo vgchange -ay [vg1]
- sudo lvscan # list logical volumes and their /dev path
- ACTIVE '/dev/vg1/lvswap' [2.00 GB] inherit
- ACTIVE '/dev/vg1/lvroot' [10.00 GB] inherit
- ACTIVE '/dev/vg1/lvdata' [60.00 GB] inherit
- # mount a logical volume; don't do this if you need to run fsck on it
- sudo mkdir /media/root
- sudo mount /dev/vg1/lvroot /media/root
- # to reverse the process and unmount everything, do the following
- sudo umount /media/root
- # the following command will issue a somewhat confusing message
- sudo vgchange -an [vg1]
- 0 logical volume(s) in volume group "vg1" now active
- sudo cryptsetup luksClose MYTAG
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement