Cleaning a Disk using DiskPart

Cleaning a Disk Using DiskPart in PXE Boot

Purpose

This procedure fully erases a disk using DiskPart from a PXE boot environment. It is typically used when re-imaging fails or when a disk needs to be completely cleaned and prepared for new use.

⚠️ Warning: This process permanently deletes all data and the operating system from the disk. Do not perform this on the active boot drive unless you intend to wipe it completely.

Reasons to Perform This Procedure

  • Imaging is failing with a device preparation error.

  • Re-imaging attempts are not resolving the issue.

  • You need to fully erase the disk, including the operating system.

Prerequisites

  • Device BIOS password (if configured).

  • Confirmation that all important data on the device has been backed up or is no longer needed.

  • PXE boot capability enabled on the device.

Step-by-Step Instructions

Part 1: Wiping the Disk

  1. Enter BIOS

    • Power on the computer and press F12 or Delete repeatedly (varies by device).

  2. Authenticate

    • Enter the BIOS password, if prompted.

  3. Select PXE Boot (IPv4)

    • Navigate to PXE IPv4 and press Enter.

  4. Choose “Disk Cleanup”

    • After a brief load period, a menu will appear. Select Disk Cleanup.

  5. Open DiskPart

    • When the administrator terminal appears, type:

      diskpart
      
  6. List Available Disks

    • Enter:

      list disk
      
    • Normally, only Disk 0 should appear.

  7. Select the Target Disk

    • Enter:

      select disk 0
      
  8. Clean the Disk

    • Enter:

      clean
      
    • This removes all partitions and data from the disk.

  9. Exit DiskPart

    • Type exit to close DiskPart.

    • At this point, the disk is clean and should allow imaging without issue.


Part 2: Re-Creating a Partition (If Needed)

If the device still cannot be imaged, create a new partition manually.

  1. Repeat steps 1–7 from Part 1.

  2. Create a Primary Partition

    create partition primary
    
  3. Select the Volume

    select volume 0
    
  4. Assign a Drive Letter

    assign letter=C
    
  5. Format with NTFS

    format fs=NTFS
    

    (Formatting may take several minutes depending on disk size.)

  6. Exit DiskPart

    • Type exit.

The device should now have a clean, formatted disk that is ready for re-imaging.

Was this helpful?
0 reviews