This is an automated archive.
The original was posted on /r/homelab by /u/WiFiKyle80211 on 2024-01-24 06:10:30+00:00.
Hey homelabbers, how hosed am I?
TLDR: After my ESXi hypervisor failed to boot, I initially re-installed ESXi v8 which re-partitioned one of my Datastores for OSDATA. v8 wouldn't bring up network interfaces, so I backed down to v7 (original OS) which is running, but missing my Datastore.
So, I'm running ESXi (free version) on a Dell R620 at home. I have the hypervisor installed on an internal USB. Today I lost power and the server would no longer boot, giving Error 33, due a corrupted disk.
I'm away from home this week, so not having physical access I ended up re-installing ESXi 6.7 on the same USB drive as a temporary solution since I need it running for some stuff I'm working on. Once 6.7 was installed, I was able to see all my Datastores and register a few VMs. Soon though I realized 6.7 was not the version I had on their previously since some VMs failed to register. (It was apparently v7.0.3 I found out later)
After some poor decisions in a rush to get this running, I opted to to go with ESXi v8. I did read the KB about phasing out installations to USB and how you can opt to use an existing VMFS Datastore for OSDATA if you choose to still install the hypervisor on the USB. During the installation, I initially selected one of my datastores, but did not proceed with that after I found that dedicating space for OSDATA off the USB is optional.
I got v8 installed, but for whatever reason now I couldn't get any network connectivity running. That's when I found the version I had previously been running (7.0.3), so I started over and loaded 7.0.3.
Now with v7 running, that disk has no datastore. I tried going through the process detailed here () but ran into some issues, for one the partition is definitely due to v8 partitioning it for OSDATA. The Previous Datastore was named 'Databank'. Also, the partition appears to be locked anyway. Any advice on how to recover my datastore? or am I out of luck?
Current Datastores (Databank missing)
Databank and Primary are RAID disks managed by PERC H710
Databank is on the Device listed with 10TB
Current Partitions shown on device
And finally, this is the output I got when I followed the guide linked above:
[root@esx:~] partedUtil getptbl /vmfs/devices/disks/naa.6848f690e95b95002b565919089b8487
gpt
1458999 255 63 23438819328
7 2048 268435455 4EB2EA3978554790A79EFAE495E21F8D vmfsl 0
[root@esx:~] offset="128 2048"; for dev in `esxcfg-scsidevs -l | grep "Console Device:" | awk {'print $3'}`; do disk=$dev; echo $disk; partedUtil getptbl $disk; { for i in `echo $offset`; do echo
"Checking offset found at $i:"; hexdump -n4 -s $((0x100000+(512*$i))) $disk; hexdump -n4 -s $((0x1300000+(512*$i))) $disk; hexdump -C -n 128 -s $((0x130001d + (512*$i))) $disk; done; } | grep -B 1
-A 5 d00d; echo "---------------------"; done
/vmfs/devices/disks/mpx.vmhba32:C0:T0:L0
gpt
7480 255 63 120176640
1 64 204863 C12A7328F81F11D2BA4B00A0C93EC93B systemPartition 128
5 208896 8595455 EBD0A0A2B9E5443387C068B6B72699C7 linuxNative 0
6 8597504 16984063 EBD0A0A2B9E5443387C068B6B72699C7 linuxNative 0
7 16986112 120176606 4EB2EA3978554790A79EFAE495E21F8D vmfsl 0
---------------------
...
---------------------
/vmfs/devices/disks/naa.6848f690e95b95002697603f1ac1c929
gpt
364602 255 63 5857345536
1 2048 5857343488 AA31E02A400F11DB9590000C2911D1B8 vmfs 0
Checking offset found at 2048:
0200000 d00d c001
0200004
1400000 f15e 2fab
1400004
0140001d 50 72 69 6d 61 72 79 00 00 00 00 00 00 00 00 00 |Primary.........|
0140002d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
---------------------
/vmfs/devices/disks/naa.6848f690e95b95002b565919089b8487
gpt
1458999 255 63 23438819328
7 2048 268435455 4EB2EA3978554790A79EFAE495E21F8D vmfsl 0
Checking offset found at 2048:
0200000 d00d c001
0200004
1400000 f15f 2fab
1400004
0140001d 4f 53 44 41 54 41 2d 36 35 62 30 37 61 37 31 2d |OSDATA-65b07a71-|
0140002d 35 36 63 62 63 39 35 34 2d 61 34 37 30 2d 62 63 |56cbc954-a470-bc|
---------------------
...
---------------------
[root@esx:~] partedUtil getUsableSectors /vmfs/devices/disks/naa.6848f690e95b95002b565919089b8487
34 23438819294
[root@esx:~]
[root@esx:~] partedUtil setptbl /vmfs/devices/disks/naa.6848f690e95b95002b565919089b8487 gpt "1 2048 23438819294 AA31E02A400F11DB9590000C2911D1B8 0"
gpt
0 0 0 0
1 2048 23438819294 AA31E02A400F11DB9590000C2911D1B8 0
Error: Read-only file system during write on /dev/disks/naa.6848f690e95b95002b565919089b8487
SetPtableGpt: Unable to commit to disk