ESXi installation failed with error "partedUtil failed with message: Error: The primary GPT table states that the backup GPT is located beyond the end of disk"

ESXi installation failed with error "partedUtil failed with message: Error: The primary GPT table states that the backup GPT is located beyond the end of disk"

Sometimes installation of VmWare ESXi failed (between 5% and 8%) with the following error:

"partedUtil failed with message: 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. ... Error: Can't have a partition outside the disk! Unable to read partition table for device..."


ESXi installation failed with error "partedUtil failed with message: Error: The primary GPT table states that the backup GPT is located beyond the end of disk" (2)

This issue may occure if you just created RAID array and created logical disks (LUN), but didnt create any partitions and didn't format them. The most strange, that this error may happen when you created RAID10, and RAID5 array does not generate the error and ESXi installs normal.

Anyway, you should try the following solution: boot with any iso-image, where you can create partitions and format them. There just create any partition and format it. In my case I did this with Windows Server 2008 R2 installation image (mostly because I could load disk controller drivers there). 

After that ESXi installed without any errors.

vmware (en)

  • Hits: 100708
Add comment

Comments  
!!!!!!!!!!!
you saved my day! Thanks a lot with this issue.
gdisk might be enough
Thanks for your hint, I had the same problem on a DL360G5 with raid50 performed by P410 controller, several attemps to install vmware esxi 6.0 failed with the same error.

I booted then a live linux iso (deft8) and then used the command "gdisk" which reported an erroneus GPT, which was easy to fix using the following commands:

===============================

deft8 ~ % gdisk /dev/sda
GPT fdisk (gdisk) version 0.8.5

Warning! Disk size is smaller than the main header indicates! Loading
secondary header from the last sector of the disk! You should use 'v' to
verify disk integrity, and perhaps options on the experts' menu to repair
the disk.
Warning! One or more CRCs don't match. You should repair the disk!

Partition table scan:
MBR: not present
BSD: not present
APM: not present
GPT: damaged

Found invalid MBR and corrupt GPT. What do you want to do? (Using the
GPT MAY permit recovery of GPT data.)
1 - Use current GPT
2 - Create blank GPT

Your answer: 2

Command (? for help): p
Disk /dev/sda: 46883828912 sectors, 21.8 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): F9F7FE7D-3541-4078-91BE-DCBF41759FAC
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 46883828878
Partitions will be aligned on 2048-sector boundaries
Total free space is 46883828845 sectors (21.8 TiB)

Number Start (sector) End (sector) Size Code Name

Command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): Y
OK; writing new GUID partition table (GPT) to /dev/sda.
The operation has completed successfully.
deft8 ~ %

===============================

No need to create a partition, after fixing the GPT the esxi installed without problems ;-)
Hope this helps others, too.
Nice solution too
Hi!

Thanks for another fix. I'm too bad in linux so I even didnt try this way.

I'm wondering, if ESXi distrib have built-in gdisk or some similar command...
RE: ESXi installation failed with error "partedUtil failed with message: Error: The primary GPT table states that the backup GPT is located beyond the end of disk"
Linux method worked like a charm for me! Thanks
This works!
I started off by trying the Windows format solution but no luck for me.
But doing what Sergio wrote did the trick! :)
Thanks!
Thanks man, I used Gparted on a USB drive to format the RAID1 created with a SmartArray P420i. After that it installed without any issues.
alternatively
delete the logical partition from raid utility bios
Yes! It works!
Thanks so much for this, worked like a charm on a DL180G6, SmartArray P420.
alternatively2
another fix - without booting anything else
somewhere during ESXi installer,
note the /dev/disks/* identifier of the disk you want to fix
press alt-f1.
login root/
partedUtil --help
note the /dev/disks/* identifier
press alt+f1 during esxi installer
root/[no password]
partedUtil --help
partedUtil mklabel [/dev/disks/whatever] msdos
this overwrites the borked partition table, which we might have encountered.

[tested on dl380 gen10, P408i-a and 2x480gb ssd's with raid1]
Gratitude
Thanks a ton Dear. Save My Day. I did this with Bootable
Windows Server 2012 USB.
Thank you
After a night without solution, you just saved me. I used Windows server 2016 usb.
Easy fix
Fast init your virtual disk when you set them up and you don't have to boot into anything else.
Mr
Thank you so much! This was the easy fix!
You saved me in the Future!
had this problem on a Dell Host, Used a random Windows 10 DVD from Fujitsu in the Dell Machine, hoping it will not burn down on me. Formatted all Partitions and BAM! Worked
finally worked
the linux step worked for me. I had been trying all day
Thank you
Quoting Kamal K SHARMA:
Thanks a ton Dear. Save My Day. I did this with Bootable
Windows Server 2012 USB.


Perfect, that worked right in the installer, you are amazing!
Solution without booting
Problem:

partedUtil getptbl /vmfs/devices/disks/naa.600508b1001c2bac8b8d1f8ed64c48d8
Error: Function not implemented during read on /dev/disks/naa.600508b1001c2bac8b8d1f8ed64c48d8
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.600508b1001c2bac8b8d1f8ed64c48d8) diskSize (3906963632) AlternateLBA (3907029167) LastUsableLBA (3907029134)
Warning: The available space to /dev/disks/naa.600508b1001c2bac8b8d1f8ed64c48d8 appears to have shrunk. This may happen if the disk size has reduced. The space has been reduced by (65536 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 (3906963632) AlternateLBA (3907029167) LastUsableLBA (3907029134) NewLastUsableLBA (3906963598)
gpt
243197 255 63 3906963632

Solution:
partedUtil mklabel /vmfs/devices/disks/naa.600508b1001c2bac8b8d1f8ed64c48d8 msdos

After fix

partedUtil getptbl /vmfs/devices/disks/naa.600508b1001c2bac8b8d1f8ed64c48d8
msdos
243197 255 63 3906963632
MrHappy
Used adamb's fix worked like a charm!!!
Thanks
Thank you!
Amazing Workaround
Amazing Workaround, Booted with Windows ISO, partitioned the drives and formatted. Installed ESXi worked like a charm

Related Articles