From 651bd7656603f6532ba6ae71f26bc4baa2e01353 Mon Sep 17 00:00:00 2001 From: Robert Church Date: Mon, 28 Nov 2022 19:55:12 -0600 Subject: [PATCH] Ensure magic strings that are visible for libblkid are erased In the case when the root disk partition table is wiped but individual partitions are not wiped correctly, this will leave previous physical volume metadata intact on the disk. When a new LVM partition is created and assigned as a newly created physical volume the old LVM metadata on the disk partition will prevent the cgts-vg volume group from being created. This update will wipe all the magic strings present in the new physical volume partition established by the kickstart by executing 'wipefs -a' prior to creating the cgts-vg. Test Plan: PASS - Successfully install an ISO with this change on a system that did not cleanup the LVM metatadata from a previous install. Log in to the installed system and confirm that the cgts-vg is properly configured. Change-Id: I63f4235a27cb40a4283f0f4c34f63564a4f18cdd Partial-Bug: #1998204 Signed-off-by: Robert Church --- kickstart/files/kickstart.cfg | 4 ++++ kickstart/files/miniboot.cfg | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/kickstart/files/kickstart.cfg b/kickstart/files/kickstart.cfg index a36fc106..5e7a74a3 100644 --- a/kickstart/files/kickstart.cfg +++ b/kickstart/files/kickstart.cfg @@ -1810,6 +1810,10 @@ ilog "LV_SZ_ROOT (cgts--vg-root--lv) : ${LV_SZ_ROOT} MB" ilog "LV_SZ_SCRATCH (cgts--vg-scratch--lv) : ${LV_SZ_SCRATCH} MB" ilog "LV_SZ_VAR (cgts--vg-var--lv) : ${LV_SZ_VAR} MB" +ilog "Wipe any previous signatures from the platform physical volume ${pv_part}" +wipefs -a ${pv_part} +[ ${?} -ne 0 ] && report_failure_with_msg "Failed to wipe signatures from ${pv_part}, rc=${?}" + ilog "Create ${vg} 'cgts-vg' ${pv_part} ; $STOR_DEV_FDS" exec_no_fds "$STOR_DEV_FDS" "vgcreate -y --force cgts-vg ${pv_part} 2>/dev/null" 5 0.5 [ ${?} -ne 0 ] && report_failure_with_msg "Failed to create ${vg} 'cgts-vg' ${pv_part}" diff --git a/kickstart/files/miniboot.cfg b/kickstart/files/miniboot.cfg index 39d29a30..1e0e4457 100644 --- a/kickstart/files/miniboot.cfg +++ b/kickstart/files/miniboot.cfg @@ -1900,6 +1900,10 @@ ilog "LV_SZ_ROOT (cgts--vg-root--lv) : ${LV_SZ_ROOT} MB" ilog "LV_SZ_SCRATCH (cgts--vg-scratch--lv) : ${LV_SZ_SCRATCH} MB" ilog "LV_SZ_VAR (cgts--vg-var--lv) : ${LV_SZ_VAR} MB" +ilog "Wipe any previous signatures from the platform physical volume ${pv_part}" +wipefs -a ${pv_part} +[ ${?} -ne 0 ] && report_failure_with_msg "Failed to wipe signatures from ${pv_part}, rc=${?}" + ilog "Create ${vg} 'cgts-vg' ${pv_part} ; $STOR_DEV_FDS" exec_no_fds "$STOR_DEV_FDS" "vgcreate -y --force cgts-vg ${pv_part} 2>/dev/null" 5 0.5 [ ${?} -ne 0 ] && report_failure_with_msg "Failed to create ${vg} 'cgts-vg' ${pv_part}"