Nung221
Contributor
Contributor

Fix corrupted secondary GPT table

Hi,

I will start by saying im not a professional with ESXi, and started using it as a hobby. After a while of using it I setup a freenas vm for a network drive. That is the problem I now have, is with the device I had my freenas storage placed on. On Friday, I was preparing to swap out my current disk (was going to download data off and then upload onto new network drive) but encountered a problem after restarting my ESXi host. Removing the drive from the host and attaching to a Linux machine showed the drives SMART status is BAD (crap drive, barely a year old) I've look around for 2 days now trying to find a solution and trying different things including: creating an image of the drive and attempting to extract the vmdk off the drive using Linux etc. I've managed to get some data off using testdisk, however I would love to get it all back, hopefully with the help of some of you fine people.

I've consulted https://communities.vmware.com/thread/595178

and have run partedUtil fixGpt on that drive. The message I was recieving before while using partedUtil getptbl was as follows:

Error: The primary GPT table on '/dev/disks/naa.6782...' is OK, but secondary is corrupt. Fix secondary table? This will move secondary at the end in case it is not at the end already. It will also set LastUsableLBA to use all the space at the end. diskSize (975699968) AlternateLBA (975699967) LastUsableLBA (975699934)

and after running the fixGpt cmd it changed to this:

gpt

60734 255 63 975699968

1 2048 975699934 AA31E02A400F11DB9590000C2911D1B8 vmfs 0

I did notice, and please let me know if this is nothing, that running partedUtil getptbl on the same disk path with the :1 at the end results in the following output

unknown

60734 255 63 975697887

and would assume that unknown should also be gpt. Unlike the other thread, I guess I don't have a backup, nor do I even know how you'd back it up.

I can see the drive and when running esxcfg-volume -l before running the fixgpt I used to see a drive that could be mounted (even though i couldnt access it) but now it does not show up.

I honestly have no clue what else to do, so hopefully yall have some suggestions... Let me know if you need any info I can get it as soon as I see the reply.

Running ESXi 6.5

9 Replies
khaliqamar
Enthusiast
Enthusiast

Fix corrupted GPT table

here you can find some more information on this problem

0 Kudos
Nung221
Contributor
Contributor

Thank you for the suggestion, however i've already consulted this thread, as mentioned in my post.

On another note, over the night, i've learned that the :1 on the device id means the partition. Sorry... newb problems. When I return home, I will try to recreate the partition table for the first and only partition on the disk. Hopefully that results in some success, if that is even what I need to do. Question: Is there any reason that the VMFS partition would go from what I assume was GPT to unknown?

0 Kudos
continuum
Immortal
Immortal

this looks good:

gpt

60734 255 63 975699968

1 2048 975699934 AA31E02A400F11DB9590000C2911D1B8 vmfs 0
do NOT run any further commands before you tried to mount this one
> Question: Is there any reason that the VMFS partition would go from what I assume was GPT to unknown?
if you run partedUtil setptbl against a partition the result should be invalid so that maybe expected result hopefully


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
Nung221
Contributor
Contributor

When attempting esxcli storage filesystem list it does not return the disk im trying to mount.

In vSphere Client it only gives me the option to reformat the drive. It doesn't seem to see the vmfs partition.

Is there another way to mount?

0 Kudos
continuum
Immortal
Immortal

Can you create a VMFS header dump like I describe here:
Create a VMFS-Header-dump using an ESXi-Host in production | VM-Sickbay
If I see such a dump I can give you a detailed suggestion.


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
Nung221
Contributor
Contributor

Sadly, it gets 20MB in and then outputs Error input/output error. The only thing that comes from the file with strings.exe is the following:

PERC 6

snap-7751dbf4-594bd520-fcb3cbca-fce7-782bcb314f10

naa.6782bcb04c1e1000ff00003c03d0a5c0:1

KY@m

rx+

FreeNas

^B%

If you have any suggestion as to how I could get further, but im sure the disk itself is trashed. I do still have a full image I got using testdisk. I looked around trying to find how I could restore the image to a disk but was unsuccessful. Do you think that would make a difference?

0 Kudos
continuum
Immortal
Immortal

> Sadly, it gets 20MB in and then outputs Error input/output error.
Not good. This means that you cant do anything with regular ESXi.
I have a ugly workaround which requires to extract the VMFS metadata with a Linux LiveCD CD.
If the data is important - call me via skype.
Ulli


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
Nung221
Contributor
Contributor

I would love to do this. Please see skype when you can. Thanks. Let me know when you have time.

0 Kudos
continuum
Immortal
Immortal

was not able to make it ESXi - readable.
Anyway - copying the most important vmdk out via ddrescue now ....
Ulli


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...