Skip to main content
Drupal 8

Main navigation

  • Home
    • Question And Answer
    • NEWS
    • Projects
  • Tutorials - Drupal
    • Android
    • Other
User account menu
  • Log in

Breadcrumb

  1. Home

Mount LUKS encrypted volumes from command line

By editor , 30 May, 2018
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

  • Linux
  • Add new comment
Mount a LUKS Encrypted partition on Linux boot

Comments1

Plain text

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

Anonymous (not verified)

8 years 5 months ago

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

  • Reply

Links

  • Drupal.org
  • Drupal core release cycle
  • Drupal events with ease
  • Unit test with Drupal using PHPUnit (Drupal 10)
  • Tokens for file upload url
  • Tips for Docker
  • CKEditor inline image files usage for custom forms.
  • Install Docker on Linux Mint
  • Install PHP 8.1
  • Drupal Security Best Practices
  • Order and sort items with tabledrag
  • Add a custom service YAML container
  • Apply a patch with composer