From 115de4c00edbd7a9bfda81b8c08690ce80437b6d Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Tue, 3 Nov 2026 17:17:31 +0100 Subject: [PATCH] Check for the localstorage volume group first The guess for volume groups named by the OS installer (_) matched any device mapper name with an underscore followed later by a hyphen. A localstorage volume for a mount point with a hyphen, such as localstorage-_srv_my--data, was taken for one and got a broken volume group name. Recognize volumes of the target volume group before trying that guess. --- .../el9-diskless/profiles/default/scripts/image2disk.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/confluent_osdeploy/el9-diskless/profiles/default/scripts/image2disk.py b/confluent_osdeploy/el9-diskless/profiles/default/scripts/image2disk.py index abf3a86d..eaeeffaa 100644 --- a/confluent_osdeploy/el9-diskless/profiles/default/scripts/image2disk.py +++ b/confluent_osdeploy/el9-diskless/profiles/default/scripts/image2disk.py @@ -409,13 +409,17 @@ def install_to_disk(imgpath): if fs['device'].startswith('/dev/mapper'): odevname = fs['device'].rsplit('/', 1)[-1] + if split_mapper_name(odevname)[0] == vgname: + # already in the volume group the install creates, as when + # recapturing a node that was installed this way + pass # if node has - then /dev/mapper will double up the hypen - if '_' in odevname and '-' in odevname.split('_', 1)[-1]: + elif '_' in odevname and '-' in odevname.split('_', 1)[-1]: oldvgname = odevname.rsplit('-', 1)[0].replace('--', '-') osname = oldvgname.split('_')[0] nodename = socket.gethostname().split('.')[0] vgname = '{}_{}'.format(osname, nodename) - elif '-' in odevname and split_mapper_name(odevname)[0] != vgname: # unique one + elif '-' in odevname: # unique one vgmap[odevname] = split_mapper_name(odevname)[0] lvmvols[odevname] = fs