NickLabs

Nick Labs
技術測試&軟件安裝記錄
  1. 首頁
  2. VMware
  3. ESXi
  4. 正文

ESXi 恢復損壞或錯誤刪除的 VMFS GPT Partition Table

2020-12-30 4738點熱度 0人按讚 0則留言

以下是在VMware ESXi 恢復損壞或錯誤刪除的 VMFS GPT Partition Table

準備工作

啟用並登錄ESXi SSH:
https://kb.vmware.com/s/article/2004746

恢復GPT Partition Table

1. 找出需要處理Partition Table問題的Datastore:

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.vmhba0:C0:T1:L0
gpt
13054 255 63 209715200
1 2048 209713152 AA31E02A400F11DB9590000C2911D1B8 vmfs 0
Checking offset found at 2048:
0200000 d00d c001                              
0200004
1400000 f15e 2fab                              
1400004
0140001d  44 69 73 6b 31 00 00 00  00 00 00 00 00 00 00 00  |Disk1...........|
0140002d  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
---------------------
/vmfs/devices/disks/mpx.vmhba0:C0:T2:L0
gpt
13054 255 63 209715200
Checking offset found at 2048:
0200000 d00d c001                              
0200004
1400000 f15e 2fab                              
1400004
0140001d  44 69 73 6b 32 00 00 00  00 00 00 00 00 00 00 00  |Disk2...........|
0140002d  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
---------------------

發現 Disk2 少了一行 1 2048 209713152 AA31E02A400F11DB9590000C2911D1B8 vmfs 0

2. 找出 Disk2 的 ending sector

partedUtil getUsableSectors /vmfs/devices/disks/mpx.vmhba0:C0:T2:L0

輸出結果:

[root@localhost:~] partedUtil getUsableSectors /vmfs/devices/disks/mpx.vmhba0:C0:T2:L0
34 209715166

209715166 就是 Disk2 的 ending sector

3. 恢復 GPT Partition Table

partedUtil setptbl /vmfs/devices/disks/mpx.vmhba0:C0:T2:L0 gpt "1 2048 209715166 AA31E02A400F11DB9590000C2911D1B8 0"

4. 再看看需要處理Partition Table問題的Datastore:

---------------------
/vmfs/devices/disks/mpx.vmhba0:C0:T1:L0
gpt
13054 255 63 209715200
1 2048 209713152 AA31E02A400F11DB9590000C2911D1B8 vmfs 0
Checking offset found at 2048:
0200000 d00d c001                              
0200004
1400000 f15e 2fab                              
1400004
0140001d  44 69 73 6b 31 00 00 00  00 00 00 00 00 00 00 00  |Disk1...........|
0140002d  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
---------------------
/vmfs/devices/disks/mpx.vmhba0:C0:T2:L0
gpt
13054 255 63 209715200
1 2048 209715166 AA31E02A400F11DB9590000C2911D1B8 vmfs 0
Checking offset found at 2048:
0200000 d00d c001                              
0200004
1400000 f15e 2fab                              
1400004
0140001d  44 69 73 6b 32 00 00 00  00 00 00 00 00 00 00 00  |Disk2...........|
0140002d  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
---------------------


發現 Disk2 也有 1 2048 209713152 AA31E02A400F11DB9590000C2911D1B8 vmfs 0 了

完成

現在可以在 Datastore 找到 Disk2 了

標籤: datastore esxi recovery vmfs5 vmfs6 vmware 分區表
最後更新:2020-12-30

Nick

技術測試&軟件安裝記錄

按讚
< 上一篇

文章留言

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回覆

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料。

Nick

技術測試&軟件安裝記錄

最新 熱度 隨機
最新 熱度 隨機
Windows Server 2025 手動搭建 Abiotic Factor 服務器 Windows Server 2025 手動搭建 ARK Survival Ascended 服務器 Ubuntu Linux 手動搭建 Killing Floor 2 服務器 Ubuntu Linux 手動搭建 Palworld 服務器 Debian Linux 手動搭建 ARK: Survival Evolved 服務器 Debian Linux 手動搭建 Project Zomboid 服務器
在Headless情況下設置Raspberry Pi的SSH和VNC遠程桌面 Debian Linux 手動搭建 7 Days to Die 服務器 ESXi 恢復損壞或錯誤刪除的 VMFS GPT Partition Table CentOS 8 安裝與設定 Nginx, MySQL, PHP (LNMP) Debian Linux 手動搭建 Valheim 服務器 Debian Linux 手動搭建 ARK: Survival Evolved 服務器
分類
  • CentOS
  • Debian
  • ESXi
  • Linux
  • Raspberry Pi
  • Ubuntu
  • VMware
  • Windows
最近評論
Nick 發佈於 4 年前(07月13日) 請提供一下報錯內容
鍋地魔帝鍋 發佈於 4 年前(05月25日) 您好,我試著安裝瓦爾海姆在 GCP Server裡,並上傳地圖, 爬了網路上很多文就卡在一個地方 b...
贊助

COPYRIGHT © 2024 nicklabs.org. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang