How to Open and Unlock a LUKS Disk on Another Linux Machine

Unlock and mount a LUKS USB or moved disk on another Linux host: cryptsetup open by device, UUID=, or /dev/disk/by-uuid, ext4 or LVM inside LUKS, read-only rescue mount, and close the mapper.

Published

Updated

Read time 11 min read

Reviewed byDeepak Prasad

Unlock a LUKS encrypted USB or moved disk on another Linux system with cryptsetup

You pulled a LUKS encrypted drive from one machine—USB enclosure, spare SSD, or a disk moved after a failure—and need the files on a different Linux box. The partition still shows crypto_LUKS in blkid; nothing is readable until you install cryptsetup, open a device-mapper node, and mount the filesystem inside.

Typical rescue cases:

  • Copy data off a laptop disk before reinstall.
  • Read a USB backup on a desktop.
  • Recover files when the original host will not boot (live ISO on the same machine).

This walkthrough unlocks an external-style volume on Ubuntu. The lab uses /dev/sdc1 on a 5 GiB virtual disk—the same device name as the encrypt a disk partition with LUKS guide, reformatted for this retest on July 2026. LUKS UUID e2e306a9-d94e-45d9-b209-4c9975fcede5; ext4 label secure-data inside. For command syntax in one place, see the cryptsetup command cheat sheet.

IMPORTANT
This guide covers manual rescue unlock on another Linux host—cryptsetup open, mount, copy, close. It does not migrate or re-encrypt a root filesystem the rescue machine boots from (encrypt root with LUKS). It also does not configure crypttab on the rescue host; use one-shot open unless you deliberately want permanent auto-mount there (mount LUKS at boot covers the source machine).

Tested on: Ubuntu 26.04 LTS (Resolute Raccoon); kernel 7.0.0-27-generic; cryptsetup 2.8.4


What you need

Before you plug in the disk, confirm you have:

You need How to get it Lab example
LUKS passphrase or key file From the machine that created the volume (your secret)
LUKS partition lsblk, sudo blkid -t TYPE=crypto_LUKS /dev/sdc1
LUKS container UUID UUID= in blkid, or sudo cryptsetup luksUUID DEV e2e306a9-d94e-45d9-b209-4c9975fcede5
Unused mapper name You choose; avoid names already on the host rescue_data
Mount point Empty directory /mnt/rescue-data

Also:

  • cryptsetup installed on the rescue host (or on the live ISO session).
  • A LUKS header backup if the header may be damaged—do not run luksFormat on a disk you need to recover.

Quick reference

Step Command
Install tools sudo apt install cryptsetup
List disks lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINT,MODEL
Find LUKS partitions sudo blkid -t TYPE=crypto_LUKS
LUKS UUID only sudo cryptsetup luksUUID /dev/sdc1
Open by device path sudo cryptsetup open /dev/sdc1 rescue_data
Open by LUKS UUID sudo cryptsetup open UUID=e2e306a9-d94e-45d9-b209-4c9975fcede5 rescue_data
Open by udev UUID path sudo cryptsetup open /dev/disk/by-uuid/e2e306a9-d94e-45d9-b209-4c9975fcede5 rescue_data
Mount ext4 (read-only rescue) sudo mount -o ro /dev/mapper/rescue_data /mnt/rescue-data
Unmount and close sudo umount /mnt/rescue-data && sudo cryptsetup close rescue_data

Pick a fresh mapper name (rescue_data in the lab). Avoid names already used on the host, such as ubuntu--vg-ubuntu--lv.


Install cryptsetup

On Ubuntu or Debian:

bash
sudo apt update
sudo apt install -y cryptsetup

Confirm the binary is on your PATH:

bash
cryptsetup --version

Sample output:

text
cryptsetup 2.8.4 flags: UDEV BLKID KEYRING FIPS KERNEL_CAPI HW_OPAL

Notes:

  • Unlock and mount steps are the same on Fedora and other Linux hosts—install cryptsetup with your distribution package manager when apt is not available.
  • Many Ubuntu and Fedora live images already ship the package.
  • On a minimal rescue image, enable networking and install from repositories before attaching the encrypted disk.

Identify the LUKS partition

Plug in the USB disk or attach the moved drive, then list block devices:

bash
lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINT,MODEL

Look for a part line with crypto_LUKS under the expected size and model:

text
sdc                           5G disk                              VBOX HARDDISK
└─sdc1                        5G part  crypto_LUKS

Filter LUKS signatures directly:

bash
sudo blkid -t TYPE=crypto_LUKS

Sample output:

text
/dev/sdc1: UUID="e2e306a9-d94e-45d9-b209-4c9975fcede5" TYPE="crypto_LUKS" PARTLABEL="primary" PARTUUID="b2ec5a76-8585-4e6b-9926-3ca5094fcea1"

Read the LUKS container UUID alone:

bash
sudo cryptsetup luksUUID /dev/sdc1

Sample output:

text
e2e306a9-d94e-45d9-b209-4c9975fcede5

What the fields mean:

  • UUID= in blkid — LUKS container UUID (use as UUID=<uuid> device parameter or in /dev/disk/by-uuid/… paths).
  • Not the ext4 filesystem UUID inside—you get that from blkid on the mapper after open.
  • You need the LUKS passphrase or key file from the machine that created the volume.
WARNING
Double-check size, model, and partition layout before any write-capable command. /dev/sdX letters can change between boots; run lsblk and blkid every time you reconnect the disk.

Open by device path

Choose an unused mapper name and run cryptsetup open on the LUKS partition:

bash
sudo cryptsetup open /dev/sdc1 rescue_data

Enter the passphrase when prompted. Verify the mapper exists:

bash
lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINT /dev/sdc

Sample output:

text
NAME            SIZE TYPE  FSTYPE      MOUNTPOINT
sdc               5G disk
└─sdc1            5G part  crypto_LUKS
  └─rescue_data   5G crypt ext4

The crypt line under sdc1 is the decrypted mapper—ready to mount.

Check the inner filesystem type:

bash
sudo blkid /dev/mapper/rescue_data

Sample output:

text
/dev/mapper/rescue_data: LABEL="secure-data" UUID="9a2a62ff-52cb-4974-97cc-9581100b978e" BLOCK_SIZE="4096" TYPE="ext4"

Wrong passphrase test (mapper is not created)—lab automation only; do not put real passphrases in shell commands (see note below):

bash
sudo cryptsetup close rescue_data
printf '%s' 'wrongpass' | sudo cryptsetup open /dev/sdc1 rescue_data --key-file=-

Sample output:

text
No key available with this passphrase.

Re-open with the correct passphrase before mount:

bash
sudo cryptsetup open /dev/sdc1 rescue_data

Type the passphrase at the interactive prompt. For real rescue work, prefer that prompt over piping secrets into --key-file=-—passphrases in shell commands can remain in shell history or terminal scrollback. The printf pattern above is for lab automation only.


Open by LUKS UUID

cryptsetup open does not use a separate --uuid flag. You can pass the LUKS UUID as the device parameter in UUID=<uuid> form (documented in cryptsetup(8)), or open through the stable udev symlink.

Close any existing mapper on that volume first:

bash
sudo cryptsetup close rescue_data

Option A — UUID= device parameter

bash
sudo cryptsetup open UUID=e2e306a9-d94e-45d9-b209-4c9975fcede5 rescue_data

Verified on cryptsetup 2.8.4 with the lab disk above.

Option B — /dev/disk/by-uuid/ path

Confirm the symlink points at your partition:

bash
ls -l /dev/disk/by-uuid/e2e306a9-d94e-45d9-b209-4c9975fcede5

Sample output:

text
lrwxrwxrwx 1 root root 10 Jul  5 22:55 /dev/disk/by-uuid/e2e306a9-d94e-45d9-b209-4c9975fcede5 -> ../../sdc1

Open through that path:

bash
sudo cryptsetup open /dev/disk/by-uuid/e2e306a9-d94e-45d9-b209-4c9975fcede5 rescue_data

Both options avoid relying on changing /dev/sdX names when the disk renumbers on the rescue host.

Unlock with a key file (either device form):

bash
sudo cryptsetup open --key-file=/path/to/keyfile \
  UUID=e2e306a9-d94e-45d9-b209-4c9975fcede5 rescue_data

Store key files with restrictive permissions (chmod 600) and prefer a dedicated path—not your shell history.

If the source host used auto-mount at boot, the passphrase or key file is the same one crypttab references—not necessarily the host OS login password.


Open Clevis Tang-bound disks on a rescue host

When the disk was bound with network-bound disk encryption (Clevis and Tang), a passphrase slot may still exist, or you may rely on Tang policy.

On the rescue machine:

  • Install clevis and clevis-luks.
  • Ensure the host can reach the Tang server URL from the bind (not 127.0.0.1 unless Tang runs on that rescue host).
  • Run sudo clevis luks unlock -d /dev/sdc1 -n rescue_data instead of plain cryptsetup open when only the Clevis slot is available.

If a passphrase slot remains, cryptsetup open still works without Clevis or Tang.


Mount read-only when rescuing data

If the disk may be failing, or you only need to copy files off a machine that will not boot, mount read-only first. That avoids accidental writes while you inspect or rsync data.

bash
sudo mkdir -p /mnt/rescue-data
sudo mount -o ro /dev/mapper/rescue_data /mnt/rescue-data

Use a normal read-write mount only when you trust the disk and need to modify files:

bash
sudo umount /mnt/rescue-data
sudo mount /dev/mapper/rescue_data /mnt/rescue-data

Mount the filesystem (ext4 / xfs)

After cryptsetup open, check what sits inside the mapper—not every LUKS volume is a plain ext4 filesystem.

bash
sudo blkid /dev/mapper/rescue_data

On the lab disk the type is ext4. Create a mount point and mount the mapper—not /dev/sdc1:

bash
sudo mkdir -p /mnt/rescue-data
sudo mount /dev/mapper/rescue_data /mnt/rescue-data

Confirm the mount:

bash
mount | grep rescue_data

Sample output:

text
/dev/mapper/rescue_data on /mnt/rescue-data type ext4 (rw,relatime)

Check free space and list files:

bash
df -h /mnt/rescue-data
ls -la /mnt/rescue-data

Sample output:

text
Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/rescue_data  4.9G  1.3M  4.6G   1% /mnt/rescue-data
total 28
drwxr-xr-x 3 root root  4096 Jul  5 22:55 .
drwxr-xr-x 4 root root  4096 Jul  5 22:56 ..
-rw-r--r-- 1 root root    14 Jul  5 22:55 lab-check.txt
drwx------ 2 root root 16384 Jul  5 22:55 lost+found

Read the marker file:

bash
cat /mnt/rescue-data/lab-check.txt

Sample output:

text
rescue lab ok

Filesystem notes:

  • Use the TYPE from blkid /dev/mapper/rescue_data—ext4, xfs, or LVM2_member (see LVM section below).
  • For xfs: sudo mount -t xfs /dev/mapper/rescue_data /mnt/rescue-data.

Copy files with rsync, cp, or your file manager.


Mount LVM volumes inside a LUKS disk

Many Linux installations—especially older root layouts—use LVM inside LUKS: disk → partition → LUKS → LVM physical volume → logical volumes (root, home, swap).

After cryptsetup open, check the mapper type:

bash
sudo blkid /dev/mapper/rescue_data

If you see TYPE="LVM2_member", the mapper is not the final filesystem. Mounting it directly often fails with unknown filesystem type 'LVM2_member'.

Install LVM tools and activate volume groups:

bash
sudo apt install -y lvm2
sudo vgscan
sudo vgchange -ay
sudo lvs

Sample output (names vary by source machine):

text
LV   VG        Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root vgubuntu  -wi-a-----  <size>
  swap vgubuntu  -wi-a-----  <size>

Mount the logical volume that holds your data—not the LUKS mapper:

bash
sudo mkdir -p /mnt/rescue-data
sudo mount -o ro /dev/vgubuntu/root /mnt/rescue-data

Replace vgubuntu/root with the VG/LV names from lvs. Use -o ro for rescue copies when you do not need to write.

When finished, unmount the LV, deactivate the source volume group, then close LUKS:

bash
sudo umount /mnt/rescue-data
sudo vgchange -an vgubuntu
sudo cryptsetup close rescue_data

Replace vgubuntu with the source disk's VG name from sudo lvs or sudo vgs. Avoid plain vgchange -an on a normal rescue host because it may try to deactivate other active volume groups on that machine.

Moved disks with LUKS root often follow this pattern—see encrypt root with LUKS for how the source system was laid out.


Close and disconnect

Unmount before closing the mapper so the kernel flushes pending writes:

bash
sudo umount /mnt/rescue-data

Close the mapper:

bash
sudo cryptsetup close rescue_data

Verify only the encrypted container remains:

bash
lsblk -o NAME,TYPE,FSTYPE,MOUNTPOINT /dev/sdc

Sample output:

text
NAME   TYPE FSTYPE      MOUNTPOINT
sdc    disk
└─sdc1 part crypto_LUKS

You can safely remove the USB device or move the disk to another machine.


Live ISO and rescue environments

Ubuntu, Fedora, and most installer ISOs boot a full desktop or shell where you repeat the same steps: terminal → identify disk → open → mount under /mnt → copy data.

Workflow on a live session:

  1. Boot the ISO and choose Try without installing.
  2. Attach the encrypted disk; wait for udev to create /dev/disk/by-uuid/… nodes.
  3. Install cryptsetup if cryptsetup: command not found.
  4. Follow identify → open → mount above.
  5. Copy rescued files to another USB stick or network storage on the live system.
  6. Unmount, cryptsetup close, then shut down.

You do not need to edit /etc/crypttab on the rescue machine for a one-time copy—cryptsetup open is manual unlock only.

When the LUKS header is damaged but you have a header backup, see LUKS header backup and restore before forcing a format. luksFormat writes a new header and destroys access to existing data on the partition.


Troubleshooting

Symptom Likely cause Fix
Device rescue_data already exists Mapper name already in use from an earlier open Pick another mapper name or sudo cryptsetup close rescue_data
Not a valid LUKS device Wrong partition selected, damaged header, or non-LUKS disk Run sudo cryptsetup isLuks /dev/sdX1 and sudo cryptsetup luksDump /dev/sdX1; wiped or BitLocker disks are not LUKS
No key available with this passphrase Wrong passphrase, keyboard layout, or key slot Retry passphrase; check Caps Lock and layout on live ISO; use --key-file if the source host used a keyfile slot
unknown filesystem type on mount Mapper is LVM, xfs, btrfs—not ext4 sudo blkid /dev/mapper/rescue_data; for LVM2_member see Mount LVM volumes inside a LUKS disk
cryptsetup open fails with correct passphrase Detached LUKS header on source system sudo cryptsetup open --header /path/to/header.img /dev/sdX1 rescue_data; without the detached header file, the data area alone cannot be unlocked
clevis luks unlock fails on moved disk Tang unreachable or wrong URL in bind Fix network; use passphrase slot if one remains; see Clevis and Tang NBDE
Disk not visible in live ISO USB power, cable, or enclosure issue Try another port; check sudo dmesg | tail and lsblk
Command not found: cryptsetup Package missing from live image Install cryptsetup (see Install cryptsetup) or use a different rescue ISO
Passphrase works at home, fails on rescue PC only Keyboard layout, charset, or stuck key Type passphrase in a text editor on the rescue host; add a second LUKS passphrase from the original machine if layouts differ

For header damage, use LUKS header backup and restore before destructive recovery attempts.


References


Summary

On the rescue Linux host, install cryptsetup, find the crypto_LUKS partition with lsblk and blkid, then cryptsetup open on /dev/sdX1, UUID=<luks-uuid>, or /dev/disk/by-uuid/<luks-uuid>. Mount ext4 on the mapper, or activate LVM and mount the logical volume when blkid shows LVM2_member. Prefer read-only mount for rescue copies. Unmount, deactivate LVM if used, and cryptsetup close before disconnecting. Clevis-bound disks need Tang reachability or a remaining passphrase slot.


Frequently Asked Questions

1. Can I open a LUKS disk on Windows or macOS?

This guide covers Linux with cryptsetup. Other operating systems need different tools and often lack native LUKS support. Boot a Linux live ISO or use a Linux VM with USB passthrough for a reliable rescue path.

2. Why did my disk move from /dev/sdb to /dev/sdc?

Linux assigns sd names in detection order. Another USB adapter, reboot, or extra disk can renumber devices. Prefer UUID= device parameters, /dev/disk/by-uuid/ paths, or blkid output over bare /dev/sdX names.

3. Do I mount /dev/sdc1 or /dev/mapper/name?

Mount the mapper device after cryptsetup open, for example /dev/mapper/rescue_data. The partition /dev/sdc1 is still encrypted ciphertext until the mapper exists.

4. Must I install cryptsetup on a live ISO?

Many Ubuntu and Fedora live environments include cryptsetup. If open fails with command not found, install the package from the live session repositories or use a persistent rescue image that ships cryptsetup.

5. Can I unlock a Clevis Tang-bound disk on another machine?

Only if that machine can reach the Tang server and has clevis installed. Run clevis luks unlock on the LUKS partition, then mount the mapper. A plain cryptsetup open with passphrase still works when a passphrase slot remains. See network-bound disk encryption with Clevis and Tang for the bind setup.

6. Passphrase works on the original PC but not on the rescue machine?

Check keyboard layout and Caps Lock on the live session—special characters can differ from your daily driver. LUKS2 Argon2 unlock can also fail on hosts with very low RAM. Try typing the passphrase into a text editor first, or unlock with --key-file if the source host used a keyfile slot.

7. Why do I see LVM2_member after unlocking the LUKS disk?

The decrypted mapper contains an LVM physical volume, not a filesystem. Install lvm2, run vgscan and vgchange -ay, then mount the logical volume under /dev//.
Deepak Prasad

R&D Engineer

Founder of GoLinuxCloud with more than 15 years of expertise in Linux, Python, Go, Laravel, DevOps, Kubernetes, Git, Shell scripting, OpenShift, AWS, Networking, and Security. With extensive …