So, I have an external USB drive encrypted using LUKS and it has been working perfectly fine for several months and I haven't rebooted this machine for quite some time. After the most recent reboot I'm unable to unlock the encrypted drive even after providing correct passphrase. I have 2 more encrypted drives attached to the same machine and they are still working fine.
I'm on Ubuntu 20.04.1 LTS. any help to fix this issue would be appreciated.
here is the output of cryptsetup luksOpen
command:
sudo cryptsetup luksOpen /dev/sdc1 myhdd --debug
# cryptsetup 2.4.3 processing "cryptsetup luksOpen /dev/sdc1 myhdd --debug"
# Running command open.
# Locking memory.
# Installing SIGINT/SIGTERM handler.
# Unblocking interruption on signal.
# Allocating context for crypt device /dev/sdc1.
# Trying to open and read device /dev/sdc1 with direct-io.
# Initialising device-mapper backend library.
# Trying to load any crypt type from device /dev/sdc1.
# Crypto backend (OpenSSL 3.0.2 15 Mar 2022 [default][legacy]) initialized in cryptsetup library version 2.4.3.
# Detected kernel Linux 5.15.0-56-generic x86_64.
# Loading LUKS2 header (repair disabled).
# Acquiring read lock for device /dev/sdc1.
# Opening lock resource file /run/cryptsetup/L_8:33
# Verifying lock handle for /dev/sdc1.
# Device /dev/sdc1 READ lock taken.
# Trying to read primary LUKS2 header at offset 0x0.
# Opening locked device /dev/sdc1
# Verifying locked device handle (bdev)
# LUKS2 header version 2 of size 16384 bytes, checksum sha256.
# Checksum:d156c881c137deae83632f10d50639db4b533f243a02513f8dc33d436c48855b (on-disk)
# Checksum:d156c881c137deae83632f10d50639db4b533f243a02513f8dc33d436c48855b (in-memory)
# Trying to read secondary LUKS2 header at offset 0x4000.
# Reusing open ro fd on device /dev/sdc1
# LUKS2 header version 2 of size 16384 bytes, checksum sha256.
# Checksum:617bc2d9c7d826b8e3c80cb4443103ac08f606e3b5eb6b893352a06d8ea8c2e6 (on-disk)
# Checksum:617bc2d9c7d826b8e3c80cb4443103ac08f606e3b5eb6b893352a06d8ea8c2e6 (in-memory)
# Device size 14000518577664, offset 16777216.
# Device /dev/sdc1 READ lock released.
# PBKDF argon2id, time_ms 2000 (iterations 0), max_memory_kb 1048576, parallel_threads 4.
# Activating volume myhdd using token (any type) -1.
# dm version [ opencount flush ] [16384] (*1)
# dm versions [ opencount flush ] [16384] (*1)
# Detected dm-ioctl version 4.45.0.
# Detected dm-crypt version 1.23.0.
# Device-mapper backend running with UDEV support enabled.
# dm status myhdd [ opencount noflush ] [16384] (*1)
No usable token is available.
# Interactive passphrase entry requested.
Enter passphrase for /dev/sdc1:
# Activating volume myhdd [keyslot -1] using passphrase.
# dm versions [ opencount flush ] [16384] (*1)
# dm status myhdd [ opencount noflush ] [16384] (*1)
# Keyslot 0 priority 1 != 2 (required), skipped.
# Trying to open LUKS2 keyslot 0.
# Running keyslot key derivation.
# Reading keyslot area [0x8000].
# Acquiring read lock for device /dev/sdc1.
# Opening lock resource file /run/cryptsetup/L_8:33
# Verifying lock handle for /dev/sdc1.
# Device /dev/sdc1 READ lock taken.
# Reusing open ro fd on device /dev/sdc1
# Device /dev/sdc1 READ lock released.
# Verifying key from keyslot 0, digest 0.
# Loading key (64 bytes, type logon) in thread keyring.
# dm versions [ opencount flush ] [16384] (*1)
# dm status myhdd [ opencount noflush ] [16384] (*1)
# Calculated device size is 27344730079 sectors (RW), offset 32768.
# DM-UUID is CRYPT-LUKS2-32d4637c09d14e93a5abd925ba5a5a5b-myhdd
# Udev cookie 0xd4d06c8 (semid 10) created
# Udev cookie 0xd4d06c8 (semid 10) incremented to 1
# Udev cookie 0xd4d06c8 (semid 10) incremented to 2
# Udev cookie 0xd4d06c8 (semid 10) assigned to CREATE task(0) with flags DISABLE_LIBRARY_FALLBACK (0x20)
# dm create myhdd CRYPT-LUKS2-32d4637c09d14e93a5abd925ba5a5a5b-myhdd [ opencount flush ] [16384] (*1)
# dm reload (253:7) [ opencount flush securedata ] [16384] (*1)
device-mapper: reload ioctl on myhdd (253:7) failed: Invalid argument
# Udev cookie 0xd4d06c8 (semid 10) decremented to 1
# Udev cookie 0xd4d06c8 (semid 10) incremented to 2
# Udev cookie 0xd4d06c8 (semid 10) assigned to REMOVE task(2) with flags DISABLE_LIBRARY_FALLBACK (0x20)
# dm remove myhdd [ opencount flush securedata ] [16384] (*1)
# Uevent not generated! Calling udev_complete internally to avoid process lock-up.
# Udev cookie 0xd4d06c8 (semid 10) decremented to 1
# dm versions [ opencount flush ] [16384] (*1)
# dm status myhdd [ opencount noflush ] [16384] (*1)
# Udev cookie 0xd4d06c8 (semid 10) decremented to 0
# Udev cookie 0xd4d06c8 (semid 10) waiting for zero
# Udev cookie 0xd4d06c8 (semid 10) destroyed
# Requesting keyring logon key for revoke and unlink.
# Releasing crypt device /dev/sdc1 context.
# Releasing device-mapper backend.
# Closing read only fd for /dev/sdc1.
# Unlocking memory.
Command failed with code -4 (wrong device or file specified).