VMware Cloud Community
mitch55500
Contributor
Contributor

How do I recreate my Datastore partition table?

Hello everyone, 

Following an update that I shouldn't have done, I lost access to my Datastore and my VMs...

I would have to recreate the partition table. But, my knowledge being limited, I don't know how to do it.

This is what I still have:

 

[root@esxi:~] fdisk -l /vmfs/devices/disks/naa.600508b1001cfb2546e6f86b467733ae

***
*** The fdisk command is deprecated: fdisk does not handle GPT partitions.  Please use partedUtil
***

Found valid GPT with protective MBR; using GPT

Disk /vmfs/devices/disks/naa.600508b1001cfb2546e6f86b467733ae: 1875319472 sectors, 2275M
Logical sector size: 512
Disk identifier (GUID): 08081081-c930-4d44-a16e-2ffa7be63285
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 1875384974

Number  Start (sector)    End (sector)  Size Name
     1              64            8191 4064K
     2         7086080        15472639 4095M
     3        15472640      1875384974  886G
     5            8224          520191  249M
     6          520224         1032191  249M
     7         1032224         1257471  109M
     8         1257504         1843199  285M
     9         1843200         7086079 2560M

 

mitch55500_0-1675617495096.png

Could someone help me step by step?

Thanks in advance.

Reply
0 Kudos
7 Replies
a_p_
Leadership
Leadership

What kind of update? Form/to which version? Did you stay on the new version, or did you revert to the old one?

You can use partedUtil getptbl /vmfs/devices/disks/naa.... to list the partitions instead of using fdisk.
Partition 3 should be the VMFS partition.

As a side note: Please consider pasting the command's text output rather than a tiny screenshot.

André

Reply
0 Kudos
mitch55500
Contributor
Contributor

I do this.


You can use partedUtil getptbl /vmfs/devices/disks/naa.... to list the partitions instead of using fdisk.
Partition 3 should be the VMFS partition.


 

Here you are :

[root@esxi:~] partedUtil getptbl /vmfs/devices/disks/naa.600508b1001cfb2546e6f86b467733ae
Error: Function not implemented during read on /dev/disks/naa.600508b1001cfb2546e6f86b467733ae
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.600508b1001cfb2546e6f86b467733ae) diskSize (1875319472) AlternateLBA (1875385007) LastUsableLBA (1875384974)
Warning: The available space to /dev/disks/naa.600508b1001cfb2546e6f86b467733ae 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 (1875319472) AlternateLBA (1875385007) LastUsableLBA (1875384974) NewLastUsableLBA (1875319438)
Error: Can't have a partition outside the disk!
Unable to read partition table for device /vmfs/devices/disks/naa.600508b1001cfb2546e6f86b467733ae

 This is not good?

 

Reply
0 Kudos
a_p_
Leadership
Leadership

What exactly did you do, i.e. what kind of update was it?

André

Reply
0 Kudos
mitch55500
Contributor
Contributor

This : 

 

   esxcli system maintenanceMode set --enable true
    esxcli network firewall ruleset set -e true -r httpClient
    cd /tmp
    wget http://downloads.hpe.com/pub/softlib2/software1/pubsw-linux/p1749737361/v98767/hpvsa-5.5.0-88.zip
    unzip hpvsa-5.5.0-88.zip
    cp scsi-hpvsa-5.5.0-88OEM.550.0.0.1331820.x86_64.vib /var/log/vmware/
    esxcli software vib remove -n scsi-hpvsa -f
    esxcli software vib install -v file:scsi-hpvsa-5.5.0-88OEM.550.0.0.1331820.x86_64.vib --force --no-sig-check --maintenance-mode
    esxcli system module set --enabled=false --module=vmw_ahci
    reboot 

In fact, if I can recover my VMs, that could be sufficient.

 

Reply
0 Kudos
mitch55500
Contributor
Contributor

Anyone can help me?

@a_p_  I can recover my VMs?

Reply
0 Kudos
EsxTest
Contributor
Contributor

I have exactly the same problem.
HP DL380p Gen8 Server - HPE Smart Array P420i - RAID-5 volume
I noticed this when upgrading from ESXi 6.0.2 to 7.0.3 but I think the problem was already there.
Suggested solution:

partedUtil fixGpt /vmfs/devices/disks/naa.600508b1001c2ae149275f04ed006297

but I get the error:

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: Function not implemented during read on /dev/disks/naa.600508b1001c2ae149275f04ed006297
Retry/Ignore/Cancel?

Have you found a solution?
Thank you in advance

Reply
0 Kudos
EsxTest
Contributor
Contributor

I found the solution (working for me!) and I recevered old datastore.
Probably the problem was because new ESXi install is in another harddrive and previous install was in the same drive of the datastore
So, I list the datastore with command:

esxcli storage vmfs snapshot list
[root@localhost:~] esxcli storage vmfs snapshot list
512ffa9c-b397085c-5a0f-d89d6729b62c
Volume Name: SAS_15RPM
VMFS UUID: 512ffa9c-b397085c-5a0f-d89d6729b62c
Can mount: true
Reason for un-mountability:
Can resignature: true
Reason for non-resignaturability:
Unresolved Extent Count: 1

after, I get the VMFS UUID and:

esxcfg-volume -M 512ffa9c-b397085c-5a0f-d89d6729b62c
Persistently mounting volume 512ffa9c-b397085c-5a0f-d89d6729b62c

And old datastore is added and works perfectly.

Reply
0 Kudos