Cannot format hard disk with VMFS5 after removing it from RAID array

Today I tried to install the new NexentaStor 4.0.1 on my x3650 M2 with local harddisks. To get the best performance my plan was to pass-through all local disks to the VM. For that I had to remove all RAID arrays that are currently configured across my 8 internal drives. After deleting the RAID arrays I started the host. When my host was up and running I tried to format one of the disks an got the following error message.

Call “HostDatastoreSystem.QueryVmfsDatastoreCreateOptions” for object “ha-datastoresystem” on ESXi “xxx.xxx.xxx.xx″ failed.

I have done this with several other disks and it looked like that only 3 had the problem. I enabled SSH and connected to the host.

There i used this command to list all the available devices:

ls -lha /vmfs/devices/disks/

This was the shortened output

formatvmfsfailed_01

As you can see there is a partition on the disks I couldn’t format.

The following command had shown me some information about the device.

partedUtil getptbl /vmfs/devices/disks/naa.5000c50023397a33

This was the output:

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.5000c50023397a33) diskSize (286748000) AlternateLBA (570310655) LastUsableLBA (570310622)
Warning: The available space to /dev/disks/naa.5000c50023397a33 appears to have shrunk. This may happen if the disk size has reduced. The space has been reduced by (283562656 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 (286748000) AlternateLBA (570310655) LastUsableLBA (570310622) NewLastUsableLBA (286747966)
Error: Can’t have a partition outside the disk!
Unable to read partition table for device /vmfs/devices/disks/naa.5000c50023397a33

It looks like that after deleting the RAID array not all VMFS partition table information was deleted too, so I had to clear it manually.

To do this simply create a normal msdos partition on the affected disks with this command:

partedUtil setptbl /vmfs/devices/disks/naa.5000c50023397a33 msdos

After setting a new partition I was able to format the disk with VMFS5.

 

 

22 Responses

  1. SARAVANAN says:

    Thanks. Helped me to resolve my issue. It worked.

  2. Björn says:

    Thanks, that did it! 🙂

  3. andy says:

    Perfect !! You are great. Worked completely.

  4. Robert says:

    Hey thanks a million for publishing this. I have spent over 3 hours trying to get this working before coming across your article.

  5. Teun says:

    Thanks you saved me from a restless night 🙂

  6. Paa says:

    It helps me to resolve the some issue with ESXi 6.0.0 and a HP Proliant ML310e Gen8 v2 with RAID 1

     

     

  7. Albert says:

    It works. Thank you so much!

  8. Carlos Martinez says:

    Funcionó a la perfección, Muchas gracias

  9. Diogo Nascimento says:

    Man you awesome! Save my day.

  10. Dean says:

    This worked a charm on my HP MicroServer Gen8 G1610T! Thanks very much!

  11. reza says:

    perfect, it work. many thanks

  12. Jas says:

    Thanks a lot for helpful post. It resolved my issue.

  13. Cong says:

    Awsome, it’s worked ! Thanks so much 😉

  14. ALI says:

    great piece of information … well done

  15. Vahric says:

    First i found how to down console at the installation time

    Then first i used partedUtil

    And thanks for such solution no need to play with multiple live cd , thanks  Manfred

  16. EOS says:

    Nice. This worked for me . Thanks 🙂

  17. Robert says:

    Thank you, I had an ssd setup as a dell perc h700 cachecade as I wanted to see what difference it made but after playing thought I’d rather just have the ssd as this is only a esxi box for labs. Couldn’t get the drive to add as a datastore even tried diskparted.

  18. Dennis Lankhuijzen says:

    Thanks! Worked for me….

Leave a Reply