Hi Alex,
I just tested your new version 1.74 thanks for investigating into the problem!
First the bad news:
On my Windows 7 64bit (Lenovo X201) the new option doesn't help to fix that problem. The numbers of the gpt are still messed up after writing an image back. This happens to SD Cards as well as to USB-Sticks.
The good news:
In order to narrow that problem down (I thought it is a problem of the OS Windows 7) I used a Linux VM (within Virtual Box) on my Windows 7 host. I passed the USB Device using the extension pack to the VM.
Within the VM I used 'dd' to dump my source image back to a SD Card (as well as an USB Stick). When 'dd' finished the writing process I could see the following output from kernel in my syslog:
Code: Select all
Nov 9 16:17:43 sol kernel: [40711.142290] GPT:Primary header thinks Alt. header is not at the end of the disk.
Nov 9 16:17:43 sol kernel: [40711.142297] GPT:30894079 != 61734911
Nov 9 16:17:43 sol kernel: [40711.142297] GPT:Alternate GPT header not at the end of the disk.
Nov 9 16:17:43 sol kernel: [40711.142298] GPT:30894079 != 61734911
Nov 9 16:17:43 sol kernel: [40711.142298] GPT: Use GNU Parted to correct GPT errors.
Nov 9 16:17:43 sol kernel: [40711.142315] sdd: sdd1 sdd5 sdd6 sdd7 sdd8 sdd9
Nov 9 16:55:17 sol kernel: [42965.876403] GPT:Primary header thinks Alt. header is not at the end of the disk.
Nov 9 16:55:17 sol kernel: [42965.876407] GPT:30894079 != 61734911
Nov 9 16:55:17 sol kernel: [42965.876407] GPT:Alternate GPT header not at the end of the disk.
Nov 9 16:55:17 sol kernel: [42965.876408] GPT:30894079 != 61734911
Nov 9 16:55:17 sol kernel: [42965.876408] GPT: Use GNU Parted to correct GPT errors.
Nov 9 16:55:17 sol kernel: [42965.876424] sdd: sdd1 sdd5 sdd6 sdd7 sdd8 sdd9
It can be seen, that the source image contains the correct partitions (1,5 to 9) but due to some little space difference of the original source drive compared to the destination drive the gpt header is not at the end of the new disk. So far that is not a problem. If you now fix that error as recommended using 'parted' or 'gparted' everything is fine and you're done. The new drive regardless if SD Card or USB Stick will boot an ESXi hypervisor as expected.
BUT:
If you don't correct that gpt error and disconnect the USB device from the VM so that it is passed back to the Windows 7 host and after that (without any further action) connect the device back to the Linux VM you can see the following output from kernel:
Code: Select all
Nov 9 16:56:58 sol kernel: [43066.348328] scsi 5:0:0:0: Direct-Access JetFlash Transcend 32GB 1.00 PQ: 0 ANSI: 6
Nov 9 16:56:58 sol kernel: [43066.361045] sd 5:0:0:0: [sdd] 61734912 512-byte logical blocks: (31.6 GB/29.4 GiB)
Nov 9 16:56:58 sol kernel: [43066.366923] sd 5:0:0:0: [sdd] Write Protect is off
Nov 9 16:56:58 sol kernel: [43066.372798] sd 5:0:0:0: [sdd] Write cache: disabled, read cache: disabled, doesn't support DPO or FUA
Nov 9 16:56:58 sol kernel: [43066.510941] sdd: sdd1 sdd2 sdd3 sdd4 sdd5 sdd6
Nov 9 16:56:58 sol kernel: [43066.544906] sd 5:0:0:0: [sdd] Attached SCSI removable disk
The gpt table now contains partitions (1 to 6) and with that you will not be able to boot an ESXi hypervisor. You will get the well known error when trying to boot
Code: Select all
BANK5: not a VMware boot bank
BANK6: not a VMware boot bank
No hypervisor found.
because the ESXi hypervisor is expected on partition 5 or 6 which now corresponds to partition 8 and 9. It seems to me, that Windows 7 OS fixes the gpt error in background without any notice to the user and thereby messing up the partition numbers.
In order to confirm that theory I used 'sgdisk --backup=FILE_NAME /dev/DRIVE_NAME' in my Linux VM to dump the gpt (after 'dd' had finished and before disconnecting the USB device from the Linux VM) to a file. With this backup I could easily repair the incorrect gtp from my Windows 7 host using
Code: Select all
sgdisk --load-backup=FILE_NAME /dev/DRIVE_NAME
After that the SD Card or USB Stick can be used again to boot an ESXi hypervisor.
Q: Where is the link to USB Image Tool?
A: USB Image Tool does a low level copy and writes the correct gpt table from an image to a new device (SD Card / USB Stick). But as the gtp table is not "error free" Windows 7 fixes the error in background by renumbering the partition numbers. I don't know if there is a chance to handle that within USB Image Tool. This is just the result of my evaluations. Does that make sense?
Kind regards
KingTutt