Describe the bug
With RHEL 9, in particular, use of the:
dd if=/dev/zero of="${CHROOTDEV}" bs=512 count=1000 > /dev/null 2>&1 || \
Is contraindicated. Better methods are:
parted -sf "${CHROOTDEV}" rm "${PART_NUM}"
Or:
The parted -sf ... method is used in the script, but not universally.
Severity
- Moderately Broken (Trivial work-around)
To Reproduce
Steps to reproduce the behavior:
- Run AMIgen9
- Observe script-outputs
- Note that outputs include a block like:
[...ELIDED...]
logger -i -t DiskSetup.sh -p kern.crit -s -- 'Clearing existing partition-tables...'
[[ NONE =~ ^[0-9]+$ ]]
dd if=/dev/zero of=/dev/sda bs=512 count=1000
partprobe /dev/sda
[...ELIDED...]
(Example from Azure)
- Build-script may or may not error-exit after this output
Expected behavior
All partitions should be removed using either parted -s <DEVICE> rm <TARGET_SLICE> or, per updated guidance from Red Hat, wipefs -a <DEVICE> .
Deviance Description
Previous efforts to remove/replace use of the dd-based method seem to be incomplete.
Screenshots
Additional context
Fix Suggestions
Update all actions attempting to clear the target-device's partitions to us the parted or wipefs method.
Describe the bug
With RHEL 9, in particular, use of the:
Is contraindicated. Better methods are:
Or:
wipefs -a "${CHROOTDEV}"The
parted -sf ...method is used in the script, but not universally.Severity
To Reproduce
Steps to reproduce the behavior:
Expected behavior
All partitions should be removed using either
parted -s <DEVICE> rm <TARGET_SLICE>or, per updated guidance from Red Hat,wipefs -a <DEVICE>.Deviance Description
Previous efforts to remove/replace use of the
dd-based method seem to be incomplete.Screenshots
Additional context
Fix Suggestions
Update all actions attempting to clear the target-device's partitions to us the
partedorwipefsmethod.