Cannot delete partition on ESXi host.
search cancel

Cannot delete partition on ESXi host.

book

Article ID: 378584

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

You are unable to delete partitions from the ESXi host UI, even after the host was recently rebooted. 

Attempting to alter either the partition table, or the partitions themselves with the partedUtil command from the ESXI CLI, errors with read-only errors similar to those below.

#partedUtil delete /dev/disks/naa.<disk id> 2
Error: Read-only file system during write on /dev/disks/naa.<disk id>
Unable to delete partition 2 from device /dev/disks/naa.<disk id> 

Environment

ESXi host with a disk that cannot be used because there are partitions that cannot be deleted because they are marked as read-only. 

Cause

This may happen if the disk was used to create a datastore during the installation process or if it is used for a core dump location or for system logs. 

Resolution



  1. Confirm that the host is not using the disk for system logs, or for a core dump location.

  2. Confirm the partition is not Set Up a File as Core Dump Location. This command will list the core dump partition: esxcli system coredump partition list

  3. Check that the device is not Configured for syslog on ESXi by running this command: esxcli system syslog config get

  4. Once you have confirmed the disk is not in use by the ESXi host proceed with the following steps. 

  5.  ** WARNING ** Modifying or deleting partitions using the PartedUtil tool will result in permanent data loss. Do not used on the ESXi system partition.

  6. Boot from ESXi ISO disk.

  7. When you get to this screen press Alt+F1 to get the command prompt: Then enter your login, for the password just hit enter it should be blank. 

  8. Then use the partedUtil tool to either delete the partitions or clear out the partition table.
    partedUtil delete <diskName> <partNum>
    partedUtil mklabel <diskName> <partNum> gpt