1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

fsadm: add luks specific error message for small devices

This commit is contained in:
Ondrej Kozina 2017-10-23 15:31:44 +02:00
parent 888dd33148
commit 6df7917581

View File

@ -581,6 +581,10 @@ resize_luks() {
error "New size is not sector alligned"
fi
if [ $((NEWBLOCKCOUNT - CRYPT_DATA_OFFSET)) -lt 1 ]; then
error "New size is smaller than minimum ($(((CRYPT_DATA_OFFSET + 1) * 512)) bytes) for LUKS device $VOLUME"
fi
NEWCBLOCKCOUNT=$((NEWBLOCKCOUNT - CRYPT_DATA_OFFSET))
NEWFSIZE=$(( NEWCBLOCKCOUNT * 512))