wrong luks header backup file size after conversion to LUKS2
"T.Gavrylko" <[email protected]> Thu, 15 Feb 2024 21:20:51 +0100
| Newsgroups | dev.linux.lists.cryptsetup |
|---|---|
| Message-ID | <CAActgDYkiaypy4Q7tsR5VaARMUT6L96jwCAet+KdYD=P5f_0OQ@mail.gmail.com> |
Hi,
Recently I successfully converted LUKS1 partition to LUKS2 and created
a header backup after the conversion.
LUKS1 root partition was created by opensuze tumbleweed installer
The length of this header backup file is wrong: 2097152 bytes what is
corresponding to the LUKS1 header size.
ls -l
-r-------- 1 root root 2097152 Feb 15 20:01 nvme0n1p9.img
Command used to create header backup
sudo cryptsetup luksHeaderBackup /dev/nvme0n1p9 --header-backup-file
/tmp/HBAK/nvme0n1p9.img
Used cryptsetup versions for header backup - 2.7.0 tumbleweed and
cryptsetup 2.4.3 Linux Mint:
sudo cryptsetup --version
cryptsetup 2.7.0 flags: UDEV BLKID KEYRING FIPS KERNEL_CAPI PWQUALITY HW_OPAL
Commands used for conversion from LUKS1 to LUKS2:
cryptsetup 2.4.3
sudo cryptsetup convert /dev/nvme0n1p9 --type luks2
sudo cryptsetup luksConvertKey /dev/nvme0n1p9 --pbkdf argon2id
luksDump:
sudo cryptsetup luksDump /dev/nvme0n1p9
LUKS header information
Version: 2
Epoch: 8
Metadata area: 16384 [bytes]
Keyslots area: 2064384 [bytes]
UUID: 3d6055ea-4ab5-4dd0-8f3b-93f51dcc6ddd
Label: 1n1p9-OS-R
Subsystem: (no subsystem)
Flags: (no flags)
Data segments:
0: crypt
offset: 2097152 [bytes]
length: (whole device)
cipher: aes-xts-plain64
sector: 512 [bytes]
Keyslots:
0: luks2
Key: 512 bits
Priority: normal
Cipher: aes-xts-plain64
Cipher key: 512 bits
PBKDF: argon2id
Time cost: 9
Memory: 1048576
Threads: 4
Salt: 04 80 c1 a7 63 01 d6 c5 79 87 56 c6 1a a8 63 66
35 20 5a 1e 8b 00 8e ec 21 db 13 4d f8 0f 34 6f
AF stripes: 4000
AF hash: sha256
Area offset:290816 [bytes]
Area length:258048 [bytes]
Digest ID: 0
3: luks2
Key: 512 bits
Priority: normal
Cipher: aes-xts-plain64
Cipher key: 512 bits
PBKDF: argon2id
Time cost: 9
Memory: 1048576
Threads: 4
Salt: 32 45 1d b6 b9 64 f6 60 0c cd 5d b7 5c 3b fd f7
79 64 51 12 5a 9d 33 4c 1c cd 4b 03 6a ad ef b0
AF stripes: 4000
AF hash: sha256
Area offset:32768 [bytes]
Area length:258048 [bytes]
Digest ID: 0
Tokens:
Digests:
0: pbkdf2
Hash: sha256
Iterations: 328913
Salt: 3d 3b d9 a5 ba 75 86 7f 7d 12 66 c1 01 58 2e b2
58 e0 b4 c0 4f 26 4f 65 4f 69 1a 7f f7 94 d4 3f
Digest: 00 2e 58 47 d4 9c e7 df e4 17 c1 06 c8 e4 10 53
e9 16 4d 89