Creating a encrypted partition does not use the whole device
Environment:
- System: ArchLinuxArm on a Raspberry Pi 4
- Cryptsetup version: 2.2.0
- Kernel version: 4.19.67-1-ARCH
I'm trying to encrypt a 6TB HDD using cryptsetup with chacha20-random as cipher and poly1305 as integrity method. Opening the mapper leads to a partition with the size of 1.2TB, so much smaller than the original disk. Using the default cipher results in a partition matching the size of the hard disk.
Command used to encrypt the partition: (See the attached log)
sudo cryptsetup -v luksFormat --type luks2 --pbkdf argon2id --cipher chacha20-random --integrity poly1305 --debug --integrity-no-wipe /dev/sda --verbose
Command to open the encrypted partition: (See the attached log)
sudo cryptsetup open /dev/sda encrypted_backup --debug
Output of cryptesetup status
sudo cryptsetup status /dev/mapper/encrypted_backup
/dev/mapper/encrypted_backup is active.
type: LUKS2
cipher: chacha20-random
keysize: 256 bits
key location: keyring
integrity: poly1305
device: /dev/sda
sector size: 512
offset: 0 sectors
size: 2523195936 sectors
mode: read/write
Output of integritysetup status
:
sudo integritysetup status /dev/mapper/encrypted_backup_dif
/dev/mapper/encrypted_backup_dif is active and is in use.
type: INTEGRITY
tag size: 28
integrity: (none)
device: /dev/sda
sector size: 512 bytes
interleave sectors: 32768
size: 2523195936 sectors
mode: read/write
failures: 0
journal size: 67088384 bytes
journal watermark: 50%
journal commit time: 10000 ms
Output of lsblk
:
lsblk /dev/sda
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 5.5T 0 disk
└─encrypted_backup_dif 253:0 0 1.2T 0 crypt
└─encrypted_backup 253:1 0 1.2T 0 crypt