Mount LUKS encrypted volumes from command line | Drupal 8

Mount LUKS encrypted volumes from command line

Submitted by editor on Wed, 05/30/2018 - 15:57
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 see
sudo vgchange -ay

Then re-run the mount:
sudo mount /dev/mapper/my_encrypted_volume /media/my_device

Tags

Comments

Anonymous (not verified)

Tue, 06/05/2018 - 10:51

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

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.