partedUtil getptbl on the device returns the error: "Error: Can't have a partition outside the disk!"partedUtil fixGpt fail with a read error or boundary mismatch[root@###############:~] partedUtil fixGpt /vmfs/devices/disks/naa.################################
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: Input/output error during read on /dev/disks/naa.################################
Retry/Ignore/Cancel? Retry
Error: Input/output error during read on /dev/disks/naa.################################
Retry/Ignore/Cancel? Ignore
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.################################) diskSize (7498891264##) AlternateLBA (22496673791##) LastUsableLBA (22496673758##)
Fix/Ignore/Cancel? Fix
Retry/Ignore/Cancel? Retry
Error: Input/output error during read on /dev/disks/naa.################################
VMware vSphere vCenter 8.x
VMware vSphere ESXi 8.x
The issue is caused by residual or corrupted GPT (GUID Partition Table) metadata on the LUN that is incompatible with the current physical disk geometry. This typically occurs when a LUN is repurposed without being properly wiped, resulting in the backup GPT header existing beyond the current end of the disk and preventing datastore creation.
e device[root@###############:~] partedUtil getptbl /vmfs/devices/disks/naa.################################Error: Input/output error during read on /dev/disks/naa.################################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.################################) diskSize (7498891264##) AlternateLBA (22496673791##) LastUsableLBA (22496673758##)Warning: The available space to /dev/disks/naa.################################ appears to have shrunk. This may happen if the disk size has reduced. The space has been reduced by (14997782528 ## 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 (7498891264##) AlternateLBA (22496673791##) LastUsableLBA (22496673758##)Error: Can't have a partition outside the disk!Unable to read partition table for device /vmfs/devices/disks/naa.################################
Invalid Partition Boundaries: The error "Can't have a partition outside the disk!" confirms that the pre-existing partition data on the LUN claims a capacity larger than what the storage array is currently providing to the host.
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.################################) diskSize (7498891264##) AlternateLBA (22496673791##) LastUsableLBA (22496673758##)Fix/Ignore/Cancel? FixError: Can't have a partition outside the disk!Unable to read partition table on device /vmfs/devices/disks/naa.################################
The clean-state method was performed after the "fixGpt" command failed with the “partition outside the disk” error, which resolved the issue.
This process effectively wipes the disk's metadata, removing all existing partition records and boundary information. By doing so, the disk is returned to a raw, "empty" state that allows the ESXi host to correctly recognize the available capacity and create a new partition table matching the current LUN size
After running this command, the disk will appear as "Empty" in the vSphere Client, and we would be able to create a new datastore.
partedUtil mklabel /vmfs/devices/disks/naa.64cd############09ee06 gpt
Note:
If you don't need the data and just want the disk back, you must wipe the label.
This command cannot be undone. Verify every parameter before running. All existing data on the LUN will be permanently lost.
This is often necessary when the fixGpt command fails due to the "partition outside the disk" error.
Once the label is wiped, run the below command to check the partition table.
partedUtil getptbl /vmfs/devices/disks/naa.################################
Create Datastore: Return to the vSphere Client and proceed with creating the new datastore. The partition configuration should now be visible and selectable
Partition configuration will be then listed when you create a new datastore