How to mount LUKS encrypted disk in Raspbian

Amritanshu Pandey
Jul 27, 2017 · 1 min read
  1. Install cryptsetup:
    sudo apt install cryptsetup
  2. Find the full path of your device (e.g. /dev/sda1):
    sudo fdisk -l
  3. Unlock encrypted volume and create a mapper:
    sudo cryptsetop luksOpen /dev/sda1 my_disk_mapper
  4. You can find the status of the mapper created in previous step using following command:
    sudo cryptsetup -v my_disk_mapper
  5. Finally mount the mapper to gain access to your data:
    sudo mount /dev/mapper/my_disk_mapper /your/mount_point

How to unmount and lock LUKS encrypted partition:

  1. First unmount the volume:
    sudo umount /your/mount_point
  2. Lock the partition using cryptsetup:
    sudo cryptsetup luksClose /dev/mapper/my_disk_mapper

This post was originally written on my blog at https://www.amritanshu.in/how-to-mount-luks-encrypted-disk-in-raspbian/

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade