Score:0

Invalid encrypted volume

lb flag

Something went wrong when I unplugged the external USB drive. When I manually mount the encrypted volume which was used on my QNAP NAS (QNAP HS-210) it throws an error:

LUKS keyslot 0 is invalid

QNAP NAS is gone and now I'm using Ubuntu 22.04 as nas.

~# blkid | grep LUKS
/dev/sde1: UUID="7a3bde^Ra-07bq-4a37-bd88-77780956cdfc" TYPE="crypto_LUKS"
~# lsblk | grep sde1
└─sde1        8:65   1 234.4G  0 part
~/# fdisk -l | grep sde1
/dev/sde1          32 491519999 491519968 234.4G  c W95 FAT32 (LBA)
~# cryptsetup --version
cryptsetup 2.4.3
~# cryptsetup luksDump /dev/sde1
LUKS keyslot 0 is invalid.
Device /dev/sde1 is not a valid LUKS device.

~/# cryptsetup repair /dev/sde1

WARNING!
========
Really try to repair LUKS device header?

Are you sure? (Type 'yes' in capital letters): yes
Operation aborted.

At first glance, sde1 UUID appears to be corrupt, and it cannot be decrypted or repaired. Is there really no other option to restore my data from the encrypted USB stick with invalid LUKS?

I know the encryption string (password), that I used when setting up thе encryption. I also have the .key file.

 ~# cryptsetup luksAddKey /dev/sde1 -d /data-hdd/documents/flaska.key
 LUKS keyslot 0 is invalid.
 Device /dev/sde1 is not a valid LUKS device.

Screenshot of the USB drive:

Screenshot of the USB drive


debug

    # cryptsetup 2.4.3 processing "cryptsetup --debug luksDump /dev/sdd1"
    # Running command luksDump.
    # Locking memory.
    # Installing SIGINT/SIGTERM handler.
    # Unblocking interruption on signal.
    # Allocating context for crypt device /dev/sdd1.
    # Trying to open and read device /dev/sdd1 with direct-io.
    # Initialising device-mapper backend library.
    # Trying to load any crypt type from device /dev/sdd1.
    # 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-67-generic x86_64.
    # PBKDF pbkdf2-sha256, time_ms 2000 (iterations 0).
    # Reading LUKS header of size 1024 from device /dev/sdd1
    # Invalid offset 67109000 in keyslot 0 (beyond data area offset 2048).
    LUKS keyslot 0 is invalid.
    Device /dev/sdd1 is not a valid LUKS device.
    # Releasing crypt device /dev/sdd1 context.
    # Releasing device-mapper backend.
    # Closing read only fd for /dev/sdd1.
    # Unlocking memory.
    Command failed with code -1 (wrong or missing parameters).
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.