Question
How to mount encrypted volumes from command line on linux (debian based) ?
Mount a linux partition encrypted with LUKS using terminal
Install Crypsetup:
sudo apt-get install cryptsetup
To decrypt the volume:
sudo cryptsetup luksOpen /dev/sda1 my_encrypted_volume
Mount:
sudo mkdir /media/my_device
sudo mount /dev/mapper/my_encrypted_volume /media/my_device
Unmount:
sudo umount /media/my_device
sudo cryptsetup luksClose my_encrypted_volume
To automatically put it in the /media
location, use the udisks tool
sudo udisks --mount /dev/mapper/my_encrypted_volume
Errors
mount: unknown filesystem type 'LVM2_member'
Solution
Run:sudo apt-get install lvm2 sudo lvscan
Then activate all LVM you seesudo vgchange -ay
Then re-run the mount:sudo mount /dev/mapper/my_encrypted_volume /media/my_device
Comments
Another example of error :…
Another example of error :
Error unlocking /dev/sdb2: Error spawning command-line `cryptsetup luksOpen "/dev/sdb2" "luks-ac0dc77b-68a4-...." ': Failed to execute child process "cryptsetup" (No such file or directory) (g-exec-error-quark, 8)
Solution :
Install cryptsetup
sudo apt-get install cryptsetup
Add new comment