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.
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:
cryptsetupinstalled on the rescue host (or on the live ISO session).- A LUKS header backup if the header may be damaged—do not run
luksFormaton 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:
sudo apt update
sudo apt install -y cryptsetupConfirm the binary is on your PATH:
cryptsetup --versionSample output:
cryptsetup 2.8.4 flags: UDEV BLKID KEYRING FIPS KERNEL_CAPI HW_OPALNotes:
- Unlock and mount steps are the same on Fedora and other Linux hosts—install
cryptsetupwith your distribution package manager whenaptis 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:
lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINT,MODELLook for a part line with crypto_LUKS under the expected size and model:
sdc 5G disk VBOX HARDDISK
└─sdc1 5G part crypto_LUKSFilter LUKS signatures directly:
sudo blkid -t TYPE=crypto_LUKSSample output:
/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:
sudo cryptsetup luksUUID /dev/sdc1Sample output:
e2e306a9-d94e-45d9-b209-4c9975fcede5What the fields mean:
UUID=in blkid — LUKS container UUID (use asUUID=<uuid>device parameter or in/dev/disk/by-uuid/…paths).- Not the ext4 filesystem UUID inside—you get that from
blkidon the mapper afteropen. - You need the LUKS passphrase or key file from the machine that created the volume.
/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:
sudo cryptsetup open /dev/sdc1 rescue_dataEnter the passphrase when prompted. Verify the mapper exists:
lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINT /dev/sdcSample output:
NAME SIZE TYPE FSTYPE MOUNTPOINT
sdc 5G disk
└─sdc1 5G part crypto_LUKS
└─rescue_data 5G crypt ext4The crypt line under sdc1 is the decrypted mapper—ready to mount.
Check the inner filesystem type:
sudo blkid /dev/mapper/rescue_dataSample output:
/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):
sudo cryptsetup close rescue_data
printf '%s' 'wrongpass' | sudo cryptsetup open /dev/sdc1 rescue_data --key-file=-Sample output:
No key available with this passphrase.Re-open with the correct passphrase before mount:
sudo cryptsetup open /dev/sdc1 rescue_dataType 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:
sudo cryptsetup close rescue_dataOption A — UUID= device parameter
sudo cryptsetup open UUID=e2e306a9-d94e-45d9-b209-4c9975fcede5 rescue_dataVerified on cryptsetup 2.8.4 with the lab disk above.
Option B — /dev/disk/by-uuid/ path
Confirm the symlink points at your partition:
ls -l /dev/disk/by-uuid/e2e306a9-d94e-45d9-b209-4c9975fcede5Sample output:
lrwxrwxrwx 1 root root 10 Jul 5 22:55 /dev/disk/by-uuid/e2e306a9-d94e-45d9-b209-4c9975fcede5 -> ../../sdc1Open through that path:
sudo cryptsetup open /dev/disk/by-uuid/e2e306a9-d94e-45d9-b209-4c9975fcede5 rescue_dataBoth options avoid relying on changing /dev/sdX names when the disk renumbers on the rescue host.
Unlock with a key file (either device form):
sudo cryptsetup open --key-file=/path/to/keyfile \
UUID=e2e306a9-d94e-45d9-b209-4c9975fcede5 rescue_dataStore 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
clevisandclevis-luks. - Ensure the host can reach the Tang server URL from the bind (not
127.0.0.1unless Tang runs on that rescue host). - Run
sudo clevis luks unlock -d /dev/sdc1 -n rescue_datainstead of plaincryptsetup openwhen 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.
sudo mkdir -p /mnt/rescue-data
sudo mount -o ro /dev/mapper/rescue_data /mnt/rescue-dataUse a normal read-write mount only when you trust the disk and need to modify files:
sudo umount /mnt/rescue-data
sudo mount /dev/mapper/rescue_data /mnt/rescue-dataMount the filesystem (ext4 / xfs)
After cryptsetup open, check what sits inside the mapper—not every LUKS volume is a plain ext4 filesystem.
sudo blkid /dev/mapper/rescue_dataOn the lab disk the type is ext4. Create a mount point and mount the mapper—not /dev/sdc1:
sudo mkdir -p /mnt/rescue-data
sudo mount /dev/mapper/rescue_data /mnt/rescue-dataConfirm the mount:
mount | grep rescue_dataSample output:
/dev/mapper/rescue_data on /mnt/rescue-data type ext4 (rw,relatime)Check free space and list files:
df -h /mnt/rescue-data
ls -la /mnt/rescue-dataSample output:
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+foundRead the marker file:
cat /mnt/rescue-data/lab-check.txtSample output:
rescue lab okFilesystem notes:
- Use the
TYPEfromblkid /dev/mapper/rescue_data—ext4, xfs, orLVM2_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:
sudo blkid /dev/mapper/rescue_dataIf 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:
sudo apt install -y lvm2
sudo vgscan
sudo vgchange -ay
sudo lvsSample output (names vary by source machine):
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:
sudo mkdir -p /mnt/rescue-data
sudo mount -o ro /dev/vgubuntu/root /mnt/rescue-dataReplace 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:
sudo umount /mnt/rescue-data
sudo vgchange -an vgubuntu
sudo cryptsetup close rescue_dataReplace 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:
sudo umount /mnt/rescue-dataClose the mapper:
sudo cryptsetup close rescue_dataVerify only the encrypted container remains:
lsblk -o NAME,TYPE,FSTYPE,MOUNTPOINT /dev/sdcSample output:
NAME TYPE FSTYPE MOUNTPOINT
sdc disk
└─sdc1 part crypto_LUKSYou 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:
- Boot the ISO and choose Try without installing.
- Attach the encrypted disk; wait for udev to create
/dev/disk/by-uuid/…nodes. - Install
cryptsetupifcryptsetup: command not found. - Follow identify → open → mount above.
- Copy rescued files to another USB stick or network storage on the live system.
- 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.

