mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-11 02:40:01 +01:00
Add LUKS2 error message hint when device too small.
If we format LUKS2 device with parameters unsuitable for current metadata device size we usually fail during header areas wipe. It was not clear what the reason actually was.
This commit is contained in:
@@ -1809,6 +1809,8 @@ static int _crypt_format_luks2(struct crypt_device *cd,
|
||||
if (r < 0) {
|
||||
log_err(cd, _("Cannot wipe header on device %s."),
|
||||
mdata_device_path(cd));
|
||||
if (dev_size < LUKS2_hdr_and_areas_size(cd->u.luks2.hdr.jobj))
|
||||
log_err(cd, _("Device %s is too small."), device_path(crypt_metadata_device(cd)));
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user