Problem: VMware sees an old partition table on a SAN volume that has been
shrunk or re-created smaller.

When scanning for the volume / refreshing the storage system on the host,
VMware identifies the volume as a snapshot and mounts it read-only, e.g. with a
volume label like "snap-25c13b31-OriginalVolumeName".

Attempting to use "add storage" to reformat the volume fails.

When SSHing to the host to examine the volume, errors like the following occur:

/dev/disks # partedUtil getptbl naa.2023000023400000
Error: The primary GPT table states that the backup GPT is located beyond the end of disk. This may happen if the disk has shrunk or partition table is corrupted. Fix, by writing backup table at the end? This will also fix the last usable sector appropriately as per the new reduced size. diskPath (/dev/disks/naa.2023000023400000) diskSize (15728640000) AlternateLBA (17578328063) LastUsableLBA (17578328030)
Warning: The available space to /dev/disks/naa.2023000023400000 appears to have shrunk. This may happen if the disk size has reduced. The space has been reduced by (1849688064 blocks). You can fix the GPT to correct the available space or continue with the current settings ? This will also move the backup table at the end if it is not at the end already. diskSize (15728640000) AlternateLBA (17578328063) LastUsableLBA (17578328030) NewLastUsableLBA (15728639966)
Error: Can't have a partition outside the disk!
Unable to read partition table for device naa.2023000023400000

/dev/disks # partedUtil fix naa.2023000023400000
Error: The primary GPT table states that the backup GPT is located beyond the end of disk. This may happen if the disk has shrunk or partition table is corrupted. Fix, by writing backup table at the end? This will also fix the last usable sector appropriately as per the new reduced size. diskPath (/dev/disks/naa.2023000023400000) diskSize (15728640000) AlternateLBA (17578328063) LastUsableLBA (17578328030)
Warning: The available space to /dev/disks/naa.2023000023400000 appears to have shrunk. This may happen if the disk size has reduced. The space has been reduced by (1849688064 blocks). You can fix the GPT to correct the available space or continue with the current settings ? This will also move the backup table at the end if it is not at the end already. diskSize (15728640000) AlternateLBA (17578328063) LastUsableLBA (17578328030) NewLastUsableLBA (15728639966)
Error: Can't have a partition outside the disk!

/dev/disks # partedUtil fixGpt naa.2023000023400000

FixGpt tries to fix any problems detected in GPT table.
Please ensure that you don't run this on any RDM (Raw Device Mapping) disk.
Are you sure you want to continue (Y/N): y
Error: The primary GPT table states that the backup GPT is located beyond the end of disk. This may happen if the disk has shrunk or partition table is corrupted. Fix, by writing backup table at the end? This will also fix the last usable sector appropriately as per the new reduced size. diskPath (/dev/disks/naa.2023000023400000) diskSize (15728640000) AlternateLBA (17578328063) LastUsableLBA (17578328030)
Fix/Ignore/Cancel? Fix
Error: Can't have a partition outside the disk!
Unable to read partition table on device naa.2023000023400000


Also, since the 'dd' command in VMware's shell doesn't have write functions
implemented, you cannot use dd to zero out the beginning of the volume. The
following command will work to reset the partition table, however:

partedUtil mklabel naa.2023000023400000 gpt