I often redeploy my VMware Cloud Foundation (VCF) lab environment for a variety of reasons, from testing customer scenarios to testing the next version of our software. Because I have fully automated the ESX installation and configuration process in my lab, reinstalling ESX is a trivial task that takes less than 5 minutes from power-on to a fully configured system ready for VCF.
When reinstalling ESX, especially on systems configured with NVMe Tiering, vSAN, and local VMFS storage, the real challenge is clearing the existing partitions so the system is ready for a fresh installation. Traditionally, this can involve several manual steps and, in some cases, booting from a Linux live CD to remove stubborn partitions.
Given how frequently I redeploy my environment, I have developed the following workflow that consistently cleans up the various storage configurations without requiring a separate live CD environment. As I was performing yet another ESX reinstallation while writing this post, I realized I had never documented my workflow, so I thought I would share it in case it helps others.
Step 1 - Power off all virtual machines, then log in to the ESX Host Client and permanently delete the virtual machines.
Step 2 - Place the ESX host into Maintenance Mode. For vSAN-enabled hosts, select No Data Migration.
Step 3 - If NVMe Tiering is enabled on the ESX host, delete the NVMe Tiering partition.
For ESX 9.1, use the following command:
esxcli memtier config delete
For ESX 9.0, use the following command:
esxcli system tierdevice -d /vmfs/devices/disks/<disk>
Step 4 - If the ESX host has been configured with vSAN ESA, use the vdq utility to identify the vSAN disk and then clear the vSAN partition.
vdq -q
esxcli vsan storagepool remove -d /vmfs/devices/disks/<disk>
Step 5 - Identify the ESX installation device by running the following command. Look for the storage device that contains the ESX partition layout, including the two bootbank partitions, and make a note of the device name.
ls -l /vmfs/devices/disks

We can inspect the device to confirm the ESX partition by using the following command:
partedutil getptbl /vmfs/devices/disks/<disk>
![]()
Finally, we will delete partition 1,5,6 & 8 which will be the minimum to be able to reboot and reinstall ESX whether that is manual or through automated process.
partedutil delete /vmfs/devices/disks/<disk> X
Nice William, thanks for sharing
I had been using the
clearpart --overwritevmfs --drives=t10.NVMe____CTxxxxxxxxxxx_________xxxxxxxxxx command per drive.
Has this been removed in ESX 9.1. I know it was/is working with ESX 9.0. Hmmm going to have to go take a host out of my lab and test with just the clearpart command.
And the clearpart command still works just fine in ESX 9.1 still and can be used in the kickstart script. Just as an FYI. I pulled out one host and tried it and then went to a SSH session and verified that all partitions were completely cleared including both VSAN and MemoryTiering partitions.
Good tip, I didn’t want to depend on KS being only method since folks might still install by hand, etc.