Print blkid scan failure.

If old util-linux is used, blkid scan can fail because disk
is already locked for OPAL.
Do the same for other internal blkid issue.

Also add some debug messages to be clear what's going on.
This commit is contained in:
Milan Broz
2023-08-26 17:53:29 +02:00
parent 464fe987f9
commit 1969b6be2f
4 changed files with 32 additions and 7 deletions

View File

@@ -1329,8 +1329,11 @@ static int check_broken_luks_signature(const char *device)
size_t count;
r = tools_detect_signatures(device, PRB_ONLY_LUKS, &count, ARG_SET(OPT_BATCH_MODE_ID));
if (r < 0)
if (r < 0) {
if (r == -EIO)
log_err(_("Blkid scan failed for %s."), device);
return -EINVAL;
}
if (count) {
log_err(_("Device %s contains broken LUKS metadata. Aborting operation."), device);
return -EINVAL;