克隆后无法访问 LUKS 设备

克隆后无法访问 LUKS 设备

我使用 clonezilla (partclone.org) 克隆了一个使用 LUKS 加密的分区

现在,当我尝试访问设备上的 LUKS 数据时出现以下错误。

sudo cryptsetup luksDump /dev/sde3 --debug
# cryptsetup 2.4.3 processing "cryptsetup luksDump /dev/sde3 --debug"
# Running command luksDump.
# Locking memory.
# Installing SIGINT/SIGTERM handler.
# Unblocking interruption on signal.
# Allocating context for crypt device /dev/sde3.
# Trying to open and read device /dev/sde3 with direct-io.
# Initialising device-mapper backend library.
# Trying to load any crypt type from device /dev/sde3.
# Crypto backend (OpenSSL 3.0.2 15 Mar 2022 [default][legacy]) initialized in cryptsetup library version 2.4.3.
# Detected kernel Linux 5.19.0-32-generic x86_64.
# PBKDF pbkdf2-sha256, time_ms 2000 (iterations 0).
# Reading LUKS header of size 1024 from device /dev/sde3
# Invalid stripes count 0 in keyslot 4.
LUKS keyslot 4 is invalid.
Device /dev/sde3 is not a valid LUKS device.
# Releasing crypt device /dev/sde3 context.
# Releasing device-mapper backend.
# Closing read only fd for /dev/sde3.
# Unlocking memory.
Command failed with code -1 (wrong or missing parameters).

我有两个分区的副本,所以我尝试修复 LUKS 标头在其中一个分区上,但当我使用密码时无法解锁。

sudo cryptsetup repair /dev/sdd3
WARNING: Device /dev/sdd3 already contains a 'gpt' partition signature.

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

Are you sure? (Type 'yes' in capital letters): YES
LUKS keyslot 4 is invalid.
Keyslot 4: offset repaired (0 -> 2024).
Keyslot 4: stripes repaired (0 -> 4000).
Keyslot 4: salt wiped.
Keyslot 5: offset repaired (0 -> 2528).
Keyslot 5: stripes repaired (0 -> 4000).
Keyslot 5: salt wiped.
Keyslot 6: offset repaired (16777216 -> 3032).
Keyslot 6: stripes repaired (0 -> 4000).
Keyslot 6: bogus partition signature.
Keyslot 6: salt wiped.
Keyslot 7: offset repaired (33554432 -> 3536).
Keyslot 7: stripes repaired (0 -> 4000).
Keyslot 7: salt wiped.

sudo cryptsetup luksOpen /dev/sdd3 sda3_crypt
Enter passphrase for /dev/sdd3: 
No key available with this passphrase.

这是未修改 LUKS 标头的磁盘。运行文件显示它被检测为正常的 DOS/MBR 分区。

ubuntu@ubuntu:~$ sudo file -s /dev/sde3
/dev/sde3: DOS/MBR boot sector; partition 1 : ID=0xee, start-CHS (0x0,0,2), end-CHS (0x3ff,255,63), startsector 1, 3871987711 sectors

这是我修复 LUKS 标头的磁盘,它被正确识别为 LUKS 设备,但在提供密码时无法解锁。

ubuntu@ubuntu:~$ sudo file -s /dev/sdd3
/dev/sdd3: LUKS encrypted file, ver 1 [aes, xts-plain64, sha256] UUID: 8377a83b-f8be-442c-8ef6-a1548bb95756

我可以做些什么来修复 LUKS 标头并访问磁盘上的信息?

相关内容