Jump to content











Photo

How to boot Windows Installer/WTG through BIOS off GPT partitioned Removable USB Drive ?

gpt mbr bios uefi bootmgr grub4dos wtg

  • Please log in to reply
135 replies to this topic

#126 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15041 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 07 January 2019 - 07:49 PM



::let's write the optional BPB to the MBR (in order to have available as root (hd0) besides the GPT (hd0,0))
::this part can probably be REMmed out as it is not strictly needed
ECHO Applying the BPB to the MBR ...
REM dsfi LBA0Disk%tdisk%.mod 0 90 LBA2048Disk%tdisk%.mod
ECHO.

I had also tested by REMed out above code but no luck here...

 

attachicon.gif5.jpeg

 

Good :), so it is needed in your case with that crappy BIOS and it was a good idea to provide this possibility :smiling9:.

 

:duff:

Wonko


  • devdevadev likes this

#127 devdevadev

devdevadev

    Frequent Member

  • Advanced user
  • 477 posts
  •  
    India

Posted 10 January 2019 - 10:12 PM

Thanks Wonko...... :) for making both (underfloppy and grldr.pbr) ways possible in stupid 4TB GPT + VAIO BIOS Combo. But I will prefer to boot Grub4dos using underfloppy method so that can utilize PBR for Clover Bootsector (boot1f32) instead of grldr.pbr. This way Grub4dos can allow me to directly chainload Clover bootloader boot0ss .

 

How (Exactly the same done by Clover Legacy Installer) we can install Clover Bootsector (boot1f32) on a FAT32 partition of 4TB GPT USB-HDD using dd.exe Command line in Windows 10 ? Will it be equivalent to what is DONE in following boot1f32.cmd script

 

boot1f32.cmd

@ECHO OFF
pushd "%~dp0"
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION

::make the user choose the target disk
SET tdisk=
SET /P tdisk=Please enter the disk number: 
FOR /L %%A IN (0,1,9) DO IF "%%A"=="%tdisk%" GOTO :continue
GOTO :error1
:continue

IF EXIST LBA2048Disk%tdisk%.ori DEL LBA2048Disk%tdisk%.ori
dsfo \\.\Physicaldrive%tdisk% 1048576 512 LBA2048Disk%tdisk%.ori
IF EXIST LBA2048BPBDisk%tdisk%.ori DEL LBA2048BPBDisk%tdisk%.ori
dsfo LBA2048Disk%tdisk%.ori 3 87 LBA2048BPBDisk%tdisk%.ori
IF EXIST LBA2048Disk%tdisk%.mod DEL LBA2048Disk%tdisk%.mod
dsfo boot1f32 0 512 LBA2048Disk%tdisk%.mod
dsfi LBA2048Disk%tdisk%.mod 3 87 LBA2048BPBDisk%tdisk%.ori

ECHO Writing new PBR ...
"%~dp0LockDismount.exe" -force %tdisk% dsfi \\.\PhysicalDrive%tdisk% 1048576 512 LBA2048Disk%tdisk%.mod
touchdrv E:
PAUSE

:error1
ECHO Disk number not valid, exiting ...
PAUSE
GOTO :EOF

and in Grub4dos Clover Menu ?

title AIOBOOT Clover Menu 64-Bit
if exist (fd0)/grldr map (hd0) (hd1)
if exist (fd0)/grldr map (fd0) (hd0)
if exist (fd0)/grldr map --hook
find --set-root /AIO/Tools/Clover/boot0ss
echo ffffffffff > (md)0x350+1
dd if=(hd0,0)+1 of=(md)0x350+1 > nul
dd if=()/AIO/Tools/Clover/boot1f32 of=(md)0x350+1 skip=90 seek=90 bs=1 > nul
dd if=()/AIO/Tools/Clover/boot1f32 of=(md)0x350+1 count=3 bs=1 > nul
#cat --hex (md)0x350+1 && pause 
dd if=(md)0x350+1 of=(hd0,0)+1 > nul && pause --wait=2 PBR has been updated with Clover boot code...
chainloader /AIO/Tools/Clover/boot0ss
boot

Should I also consider writing the optional BPB to the MBR for Clover Bootsector to work in 4TB GPT + VAIO Combo ?



#128 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15041 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 11 January 2019 - 10:14 AM

It looks fine at first view :) (though you are using the grub4dos "backwards" (relative to the batch), I mean, why not (not tested) follow the same logic in grub4dos as the batch :dubbio:, unlike dsfo/dsfi (and other Windows tools) the dd in grub4dos allows "partial" read/write on block device, i.e.:

dd if=()/AIO/Tools/Clover/boot1f32 of=(md)0x350+1 > nul
dd if=(hd0,0)+1 of=(md)0x350+1 skip=3 seek=3 bs=1 count=87> nul
#cat --hex (md)0x350+1 --length=96 && pause
dd if=(md)0x350+1 of=(hd0,0)+1 > nul && pause --wait=2 PBR has been updated with Clover boot code...

or, saving one operation:
 
 

dd if=()/AIO/Tools/Clover/boot1f32 of=(hd0,0)+1 skip=0 seek=0 bs=1 count=3> nul
dd if=()/AIO/Tools/Clover/boot1f32 of=(hd0,0)+1 skip=90 seek=90 bs=1 count=422> nul
cat --hex (md)0x350+1 --length=96 &&pause --wait=2 PBR has been updated with Clover boot code...

Loosely speaking, a FAT32 bootsector "normally" starts, i.e. 99.99% of them start, with the same "jump bytes" (since the BPB is of the given length and code starts "as soon as possible" after it):



EB 58 90

so it makes little sense, once verified (once, in initial experimenting) that the first three bytes in both the involved the boot sectors are already EB5890 to insist on overwriting EB5890 with EB5890 over and over ...

 
So, the whole stuff can be even simplified to a one liner:

dd if=()/AIO/Tools/Clover/boot1f32 of=(hd0,0)+1 skip=90 seek=90 bs=1 count=422> nul  &&pause --wait=2 PBR has been updated with Clover boot code...

Should I also consider writing the optional BPB to the MBR for Clover Bootsector to work in 4TB GPT + VAIO Combo ?

That depends. :unsure:
If you use the "underfloppy" method AND you don't have a GPT partition entry for the "underfloppy" extents your grldr (and *whatever* other file inside the "underfloppy") the "underfloppy" contents won't be available (as - say -  (hd0,0) or (fd0,0)) until you map the extent (hd0)63+1985 (or (fd0)63+1985 on that SONY VAIO BIOS) to *some* device, whilst if you have the "doubled" BPB on the MBR you have access to the contents via (hd0) (or (fd0) on that SONY VAIO BIOS) and/or establish root to it.

I mean, to have this working:

 

if exist (fd0)/grldr map (hd0) (hd1)

you need the "double" BPB in the MBR, don't you? :dubbio:

 

As a side note, generally speaking, I would rather use a (pseudo-unique)  "tag file", let's say "this_is_underfloppy.tag" in "if exist" checks, you never know (except on the specific machine) what is actually mapped to (fd0), and a grldr in root of a device may be a "too common" occurrence, potentially leading to a mis-identification of the device. 

:duff:
Wonko


  • devdevadev likes this

#129 devdevadev

devdevadev

    Frequent Member

  • Advanced user
  • 477 posts
  •  
    India

Posted 12 January 2019 - 06:13 PM

If you use the "underfloppy" method AND you don't have a GPT partition entry for the "underfloppy" extents your grldr (and *whatever* other file inside the "underfloppy") the "underfloppy" contents won't be available (as - say -  (hd0,0) or (fd0,0)) until you map the extent (hd0)63+1985 (or (fd0)63+1985 on that SONY VAIO BIOS) to *some* device, whilst if you have the "doubled" BPB on the MBR you have access to the contents via (hd0) (or (fd0) on that SONY VAIO BIOS) and/or establish root to it.

I mean, to have this working:

you need the "double" BPB in the MBR, don't you? :dubbio:

Sorry I could not understood "Double" BPB. Let me ask once again..

First I have used mkhidGPT.cmd script in 4TB GPT USB-HDD and also written Clover bootsector using boot1f32.cmd and then executed following commands.

 

Attached File  1.jpeg   183.87KB   0 downloads

if exist (fd0)/grldr map (hd0) (hd1)

this command successfully executed. It mean grub4dos already have access to the content of (fd0) ? Does MBR (hidgpt63.mbr) already have BPB for underfloppy image ? If SO then it should be first BPB ?

 

Now what do you mean by "Double BPB" in MBR ? 

Are you talking about also writing BPB of FAT32 partition i.e. (fd0,0) to MBR ?

Should I also apply the BPB of FAT32 partition 1 to the MBR as second BPB in case of underfloppy ?

 

How "Double" BPB will be written in MBR ? What will be location and size (in bytes) of two BPB's in MBR ?

 

It's looking writing BPB of FAT32 partition to MBR become must if device is treated as floppy ?

 

Please explain concept of use of single BPB (also Double BPB) in MBR in detail....

Regards...



#130 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15041 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 13 January 2019 - 02:41 PM

The BPB is only the one in the bootsector of the volume.

The "double" BPB is the (modified) one in the (special) MBR.

 

Imagine that you boot to grub4dos from another device (let's say a USB stick) and try to access this "special" GPT disk.

 

If there is this "double" BPB in the MBR, than you can root to the device, i.e. root (hd0) just fine.

If there is not this "double" BPB in the MBR, than you cannot root to the device, i.e. root (hd0) will return Error 17: cannot mount selected partition, and if you try root (hd0 [TAB] grub4dos will try to autocomplete the line to (hd0, 

 

What happens is that the grub4dos tries to read the volume BPB and cannot find it, with [TAB] it sees the (GPT) partition table, proceeds to read partitions in it and adds the comma. 

 

When you are using the underfloppy, it is mapped "nowhere" unless you have the "double" BPB in the MBR, in which case it is mapped as a volume that starts at offset 0 on the device.

And sure, the "hidgpt63.mbr" already has the "double" BPB inside (it is hardcoded since the extents and the filesystem data of the underfloppy are known and fixed since the underfloppy image is also provided).

With the underfloppy you need the "double" BPB in the MBR to be able to access it as (hd0) or (fd0).

And you need to map the underfloppy extents in the GPT partition table if you want to access it as (hd0,0) or (fd0).

.

When you are using the GPT partition, it can be accessed "normally" via the GPT partition table as (hd0,0) or (fd0,0).

If you (optionally) add the "double" BPB to the MBR, it can be accessed also as (hd0) or (fd0), similarly to the underfloppy, it is also mapped as a volume that starts at offset 0 on the device.

 

See again:

http://reboot.pro/to...drive/?p=208814

 

In a nutshell:

1) with the underfloppy method you need (and already have) a "double" BPB in the MBR and you can optionally add the extents of the underfloppy to the GPT partition table.
2) with the partition method in theory you need not a "double" BPB in the MBR (it is optional) but seemingly in practice on your BIOS it is needed as well.

 

:duff:

Wonko



#131 wimb

wimb

    Platinum Member

  • Developer
  • 2636 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 30 January 2019 - 06:12 PM

How about using two USB drives:

 

MBR 32 GB FAT32 USB-Stick with Boot Manager menu prepared e.g. with Microsoft MediaCreationTool used as boot drive in BIOS mode

and then booting GPT 4 GB USB Drive with Win10x64.vhdx or Windows Installer or Linux ISO or whatever ....

 

Grub4dos in BIOS Windows Boot Manager Menu on USB can boot Linux ISO located on FAT32 partition of GPT drive

BIOS mode Windows Boot Manager Menu on USB can boot W10x64NL.vhd and Win7x32.vhd located on NTFS partition of GPT drive

 

Boot Menu entries working with locate can be made easily with UEFI_MULTI



#132 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15041 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 30 January 2019 - 07:28 PM

How about using two USB drives:

Why not an USB floppy?  :frusty:

 

Or PXE booting (possibly over the internet or "the cloud")?

 

:duff:

Wonko



#133 wimb

wimb

    Platinum Member

  • Developer
  • 2636 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 30 January 2019 - 07:31 PM

Why not an USB floppy?  :frusty:

 

Or PXE booting (possibly over the internet or "the cloud")?

 

:duff:

Wonko

 

Two USB-drives as proposed is more convenient and more realistic and solves USB BIOS mode booting off GPT drive.

 

ESD-USB MBR BIOS booting  Grub4dos Ubuntu ISO located on FAT32 and Win7x32.vhd FiraDisk located on NTFS partition of USB GPT disk

 

Attached File  Ubuntu-ISO-GPT.png   560.27KB   0 downloads == Attached File  Win7x32-VHD-G4D-Fira-GPT.png   474.02KB   0 downloads

 

 

ESD-USB MBR BIOS Boot Manager booting W10x64NL.vhd located on NTFS partition of USB GPT disk

 

Attached File  Win10x64-VHD-GPT.png   463.82KB   1 downloads



#134 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15041 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 31 January 2019 - 08:46 AM

Two USB-drives as proposed is more convenient and more realistic and solves USB BIOS mode booting off GPT drive.

 

NO, it doesn't. :frusty:

It solves booting from ANOTHER MEDIA (the second USB drive) and chainloading the original drive, which is ANOTHER thing.

 

In any case a USB floppy is very realistic (I have two of them on my bench right now, and PXE booting is also realistic, by pure chance I am writing this from a system booted off PXE) though both are NOT solutions to the original problem, just like yours are - at the most -  workarounds.

 

The original problem is solved at the moment only by using the grub4dos UMBR (when LBA access is in the BIOS is a vailable, i.e. everywhere but on the particular BIOS talked about in this thread) or by my half-@§§edly modified MBR (either with the underfloppy or the remapping of the ESP partition methods).

 

:duff:

Wonko



#135 wimb

wimb

    Platinum Member

  • Developer
  • 2636 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 31 January 2019 - 09:03 AM

NO, it doesn't. :frusty:

It solves booting from ANOTHER MEDIA (the second USB drive) and chainloading the original drive, which is ANOTHER thing.

 

 

 

The original problem is How to USB BIOS mode boot off GPT drive, which is solved by my approach.

 

Nowhere is stated that it is limited to using one (and only one) USB-drive.

 

I am using BIOS mode booting from USB with Grub4dos and can boot with Linux ISO or Win7x32.vhd FiraDisk located on USB GPT disk.

BIOS mode Windows Boot Manager Menu on USB can boot W10x64NL.vhd and Win7x32.vhd located on NTFS partition of USB GPT disk.

Boot commands are the same as in the case where one (and only one) USB-drive is used.



#136 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15041 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 31 January 2019 - 09:46 AM

The original problem is How to USB BIOS mode boot off GPT drive, which is solved by my approach.

 

Nowhere is stated that it is limited to using one (and only one) USB-drive.

 

I am using BIOS mode booting from USB with Grub4dos and can boot with Linux ISO or Win7x32.vhd FiraDisk located on USB GPT disk.

No.

The second drive you are using is MBR and not GPT, again, besides needing a second USB device, you are booting a MBR drive and from it chainload a GPT drive. (not really "news")

You are NOT booting from GPT drive.

 

Other examples:

BIOS boot off (USB) floppy and chainload *whatever* on  GPT drive
BIOS boot off (USB) CD/DVD and chainload *whatever* on GPT drive

BIOS boot off PXE  and chainload *whatever* on GPT drive

....

 

Anyway, if you are convinced that your workaround is a solution, that's perfectly fine with me. :)

 

 

:duff:

Wonko







Also tagged with one or more of these keywords: gpt, mbr, bios, uefi, bootmgr, grub4dos, wtg

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users