Sunday, 17 January 2016

Problems UEFI-booting .imgPTN files!!!

Since about E2B v1.73, if the second partition is a small hidden type 21h partition that is placed there by RMPartUSB when you use RMPrepUSB or the MAKE_E2B_USB_DRIVE.cmd script, this partition is not removed when you switch to a .imgPTN file - this is only done if the extension is exactly ".imgPTN" or ".imgPTNAUTO".

This was done because some Legacy BIOSes would recognise  the USB drive as a floppy disk and thus fail to boot grub4dos and boot to the CSM menu unless a 2nd partition was present (e.g. some EeePCs).



so having a 2nd dummy partition makes it correctly MBR-boot as a hard disk...

PTN 1 = FAT32 files
PTN 2 = small type 21h dummy hidden partition

However, it seems that the presence of this second partition prevents some UEFI systems from listing the E2B drive as a UEFI boot device. This means that you cannot UEFI-boot from the E2B drive from these systems.

A user recently contacted me about his ASUS S550CM notebook which would no longer UEFI-boot after he updated to E2B v1.75, i.e. he was using v1.75 and two .imgPTN files (e.g. Win8.imgPTN and Win8):

PTN 1 = FAT32 UEFI windows boot files
PTN 2 = small type 21h dummy hidden partition
PTN 3 = NTFS containing large Install.wim file

Result: His hard drive was not listed in the firmware pop-up boot menu for UEFI-booting on most (?) of his systems. The only way to UEFI-boot was by MBR\Legacy booting to the CSM menu and then choosing the Clover boot option (except his S550CM crashed before it loaded Clover and so this user could not even boot using Clover on this particular model - which was why he contacted me!).

However, if we remove the second partition (PTN2), then it was listed by his firmware and would UEFI-boot!

I have also found that my Z87 mainboard behaves oddly if we have an NTFS+FAT32 arrangement:

PTN1: NTFS
PTN2: FAT32

Now, if  the two partitions are located 'randomly' across the disk, then the Z87 firmware will not give a UEFI boot option. However, if the two partitions are sequential (no gaps or unused space between them), then I do get a UEFI boot option (I will investigate this further in due course - see below!).

So we have:

  • Some systems will not MBR-boot to grub4dos on a single-partitioned drive
  • Some systems will not UEFI-boot if a dummy type 21h partion is present as well as a FAT and NTFS partition
  • Some systems will not UEFI-boot if the FAT partition is preceded by a gap ??
So much for (UEFI) specification standards!


E2B v1.77a (beta) is now available which has a modified version of QRUN.g4b so that the type 21h partition is now deleted when you switch to a .imgPTN file (as it was in v1.72 and previous versions). E2B v1.77 also has a new version of SWITCH_E2B.exe (v1.0.7) which has the same changes. The MPI Tool Pack v0.059 has also been updated with the new version of SWITCH_E2B.exe.

So if you have trouble with E2V v1.75/1.76 and .imgPTN files and UEFI-booting, try the new beta v1.77 - phew!


Note: I have revised v1.77a because without the 2nd type 21hex partition, some systems will not CSM boot! So v1.77b has a new SWITCH_E2B.exe and a modified QRUN.g4b.


UEFI-booting

Upon further investigation, I found that Example 1 below would cause a UEFI system to display the UEFI boot option correctly, whereas Example 2 would not allow UEFI-booting because it would not recognise the USB drive as UEFI-bootable and not give a boot menu entry.

Example 1: Shows a UEFI boot option
PTN1: NTFS   start at LBA 63  Win81.imgPTN
PTN2: (unused)
PTN3: FAT32 start at LBA 921234  Win81

Example 2: Does not show a UEFI boot option
PTN1: NTFS  start at LBA 73628304  Win81.imgPTN
PTN2: (unused)
PTN3: FAT32 start at LBA 63             Win81

I tested other examples and always found that if the NTFS partition started after the FAT partition, then the UEFI boot selection menu would not show the UEFI boot option. The unused PTN2 did not affect results, so using PTN1 and PTN2 gave the same results.

So, when using two partition images - e.g. Win81.imgPTN (NTFS) and Win81 (FAT32), it matters where those files are located on the drive.

E2B v1.77c contains a cmd script file which checks the file positions and then attempts to move the files so that the .imgPTN file always precedes the file that does not have a file extension.
Read \_ISO\docs\E2B Utilities\MOVE_IMGPTN\ReadMe.txt to see how to use the MOVE_IMGPTN (run as admin).cmd file to move the two partition image files.
I have also updated Method 4 on the E2B >4GB files page here.