[Method Improvement] Update `DiskSetup.sh` to Ensure That `parted` or `wipefs` Are Consistently Used for Clearing Pattition Tables
@ferricoxide is already working on this.
Since Aug 29, 2025.
- Dominant language
- Shell
- Stars
- 3
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
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:
wipefs -a "${CHROOTDEV}"
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:
(Example from Azure)[...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...] - 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.