plus3it / plus3it/amigen9

[Method Improvement] Update `DiskSetup.sh` to Ensure That `parted` or `wipefs` Are Consistently Used for Clearing Pattition Tables

Open
#54 0 comments 0 reactions 1 assignee View on GitHub

@ferricoxide is already working on this.

Since Aug 29, 2025.

bug
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:

  1. Run AMIgen9
  2. Observe script-outputs
  3. 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)
  4. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.