Jump to content











Photo
* * * * * 1 votes

Hack Bootmgr to boot Windows in BIOS to GPT

bios gpt bootmgr winload

  • Please log in to reply
374 replies to this topic

#351 steve6375

steve6375

    Platinum Member

  • Developer
  • 6768 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 11 February 2017 - 03:09 PM

I tried booting from the C: partition 4 with umbr + reg fix and same issue - no hibernate.  :(

 

I have written up experiments so far http://www.rmprepusb...s/bios_gpt_boot

 

Would be nice to get Hibernate working!



#352 devdevadev

devdevadev

    Frequent Member

  • Advanced user
  • 451 posts
  •  
    India

Posted 11 August 2017 - 03:03 AM

AIO Boot now supports installing Grub2 on GPT disks including both HDD and USB. After installing Grub2, you can boot the GPT disk in Legacy BIOS modeWindows Boot Manager does not support booting into Legacy BIOS mode on GPT disks. AIO Boot uses wimboot, which consumes more RAM.

  1. Install AIO Boot to a partition on GPT disks.
  2. Grub2 requires a BIOS partition on GPT disks. We will create a small partition of 1 to 10MB. You do not need to format and do not need to mount the drive letter for this partition. For USB, you can use the MiniTool Partition Wizard to create a second partition. On Linux, this partition will be flagged as bios_grub. USB-multiple-partitions.jpg
  3. Run AIOCreator.exe, select Grub2 from Bootloaders. The tool will list the partitions that you created in step 2.
  4. Select the partition and click OK to install Grub2.

     

    install-grub2-on-gpt.jpg
  5. .Good luck!


#353 nightrain

nightrain
  • Members
  • 4 posts
  •  
    China

Posted 19 November 2017 - 04:24 AM

I tried booting from the C: partition 4 with umbr + reg fix and same issue - no hibernate.  :(

 

I have written up experiments so far http://www.rmprepusb...s/bios_gpt_boot

 

Would be nice to get Hibernate working!

I found a important registry value which controls BCD system store is vaild.

A dword named TreatAsSystem with value 1 in HKLM\BCD00000000\Description is very important.

After adding this value, bcdedit and all other BCD editors included built-in boot and failure recovery works.

But Hibernate is not working, wake PC with correct FirmwareBootDevice value will result in a clean boot, wake PC with unmodified FirmwareBootDevice value will result in a recovery screen(press enter is necessary to get a clean boot).

Now the only way to get hibernate working is vhd.(edit:maybe i should put boot files in a separate partition?)

 

UPDATE:

Hibernate is fully working after i put boot files in a separate partition with the modification of FirmwareBootDevice. No need to re set FirmwareBootDevice every wake up, only clean boot needs. Windows will not load BCD after wake up, you should load manually.

 

UPDATE2:
I found a interesting fact. while HKLM\BCD00000000\Description\KeyName was not BCD00000000 (usually bcdboot and bcdedit will set external BCD store's Description\KeyName to BCD00000001,BCD00000002..., and bcdedit will remove the TreatAsSystem value while the store is external store), you don't need to load BCD store manually after wake up while Description\KeyName is not BCD00000000.
Maybe windows will unload the bcd store with Description\KeyName=BCD00000000 while system goes into hibernate?

Edited by nightrain, 19 November 2017 - 05:22 AM.


#354 nightrain

nightrain
  • Members
  • 4 posts
  •  
    China

Posted 19 November 2017 - 05:36 AM

I found a important registry value which controls BCD system store is vaild.
A dword named TreatAsSystem with value 1 in HKLM\BCD00000000\Description is very important.
After adding this value, bcdedit and all other BCD editors included built-in boot and failure recovery works.
But Hibernate is not working, wake PC with correct FirmwareBootDevice value will result in a clean boot, wake PC with unmodified FirmwareBootDevice value will result in a recovery screen(press enter is necessary to get a clean boot).
Now the only way to get hibernate working is vhd.(edit:maybe i should put boot files in a separate partition?)

UPDATE:
Hibernate is fully working after i put boot files in a separate partition with the modification of FirmwareBootDevice. No need to re set FirmwareBootDevice every wake up, only clean boot needs. Windows will not load BCD after wake up, you should load manually.

UPDATE2:
I found a interesting fact. while HKLM\BCD00000000\Description\KeyName was not BCD00000000 (usually bcdboot and bcdedit will set external BCD store's Description\KeyName to BCD00000001,BCD00000002..., and bcdedit will remove the TreatAsSystem value while the store is external store), you don't need to load BCD store manually after wake up while Description\KeyName is not BCD00000000.
Maybe windows will unload the bcd store with Description\KeyName=BCD00000000 while system goes into hibernate?

UPDATE3:
KeyName=BCD00000000 is much safer than other value, if the bcd store in disk is different from in memory, system will not wake up and you need to use bcdedit (/store command) once to fix your BCD. In a nutshell, 3 registry values are important.
HKLM\BCD00000000\Description\KeyName=BCD00000000
HKLM\BCD00000000\Description\TreatAsSystem=(dword)0x1
HKLM\SYSTEM\CurrentControlSet\Control\FirmwareBootDevice=multi(0)disk(0)rdisk(0)partition(4)
(modify FirmwareBootDevice to yours)

Edited by nightrain, 19 November 2017 - 05:45 AM.


#355 AnonVendetta

AnonVendetta

    Silver Member

  • Advanced user
  • 655 posts
  • Location:A new beginning.....
  • Interests:Self-development, computing

Posted 20 November 2017 - 05:20 AM

Would hibernation work with the AIO method that @devdevadev posted about? Or is it untested as of yet? Would it be possible to test it in a VM instead of doing a real/live installation? I've noticed that whenever I install Windows to a VM hibernation doesn't seem to be available. I think maybe it's because Windows detects it's booted from a VHD, perhaps some other image type (like VDI or VMDK, etc) would work better. Then again, booting from a VHD in real/live mode doesn't seem to allow hibernation either. This is one of the few reasons why I would rather not boot from an image file on a real, permanent install.



#356 nightrain

nightrain
  • Members
  • 4 posts
  •  
    China

Posted 20 November 2017 - 10:40 AM

By the limitations of Microsoft VHD Controller driver, Windows do not support hibernate the system which stored to a vhd.

 

The only three ways to get hibernate working are:

 

1: Use the map command of GRUB4DOS, do not install Windows entirely to the VHD, install boot files to the VHD, when the VHD is attached, hibernate works.

If you use "VHD Attach" and make its service loaded before TrustedInstaller (by service dependencies), Windows Update works perfectly.

If you use "TotalMounter" to mount VHD and do not use Microsoft's driver. You can use every features in Windows included Metro Boot Selection Screen (but expect WinRE, WinRE need a custom WinRE.wim file to mount vhd, and modify winload.efi to winload.exe in BCD is necessary).

like this:

timeout 0

menu /bootmgr.vhd
  find --set-root /Windows/bootmgr.vhd
  map /Windows/bootmgr.vhd (hd0)
  map (hd0) (hd1)
  map --hook
  root (hd0,0)
  chainloader /bootmgr 

2: Use Firadisk driver, do not install Windows to a VHD, do not install Windows entirely to the VHD, install boot files to the VHD, everything works thanks to Firadisk driver(you still need a custom WinRE image), the only disadvantage of Firadisk driver is Firadisk driver has no digital signatures.

See my previous post below:

http://reboot.pro/to...ndpost&p=193161

 

3: Use superfloppy to get Windows booting, then load BCD hive and modify three registry keys to get BCD loaded properly:

To modify HKLM\BCD00000000\Description\*, you need to modify permission.

HKLM\BCD00000000\Description\KeyName=BCD00000000
HKLM\BCD00000000\Description\TreatAsSystem=(dword)0x1
HKLM\SYSTEM\CurrentControlSet\Control\FirmwareBootDevice=multi(x)disk(y)rdisk(z)partition(w)

You can not put boot files in system drive in this superfloppy way, otherwise you can not wake up. Ways 1&2 are OK in every situations.


Edited by nightrain, 20 November 2017 - 10:45 AM.


#357 luizluca

luizluca
  • Members
  • 2 posts
  •  
    Brazil

Posted 18 December 2017 - 01:03 AM

I managed to boot windows with all but "UEFI emulation" (I didn't try it). Updates do work with vhd (vhd attach) or external usb drive, but fails with wimboot. However, I could not apply a "feature update" like 1709, as it is really a system version upgrade.

When it reboots in order to apply update, it starts to rollback my system. It even messes with my BCD and I need to recover it (either install DVD or booting with wimboot).

It's this expected? Would it be any workaround?
It's there any manual way to apply this feature update? Something like boot winre and run c:\$windows.~bt\magic.exe?

I have 1709 iso, and long experience with both Windows and Linux.
My window was originally installed in MBR and mirrored to GPT

#358 cdob

cdob

    Gold Member

  • Expert
  • 1402 posts

Posted 21 December 2017 - 10:46 PM

However, I could not apply a "feature update" like 1709, as it is really a system version upgrade.

When it reboots in order to apply update, it starts to rollback my system.

Yes, a "repair installation" fails.
Actually I wonder, you got a rollback at all.
Windows setup refuses to upgrade at all here. Without UEFI firmware and GPT disk, setup refuses at online "feature update" 1709 or a <1709 DVD>\setup.exe.
.

Anyway let's compare a BIOS MBR upgrade example.

bootsequence {7254a080-1510-4e85-ac0f-e7fb3d444736}
device ramdisk=[C:]\$WINDOWS.~BT\Sources\SafeOS\winre.wim,{b9586286-e526-11e7-83f0-e946df80e7d6}

There is a file D:\$WINDOWS.~BT\Sources\SafeOS\ReAgent.xml
<OperationParam path="$WINDOWS.~BT\Sources\SetupPlatform.exe /execute Install:\$WINDOWS.~BT\Sources\SetupPlatform.ini"/>

And C:\$WINDOWS.~BT\Sources\SetupPlatform.ini

[Execute.PostOOBE]
0=\$WINDOWS.~BT\Sources\SetupHost.exe /Media /Success /ClientId Media360 /ReportId 0785d7a0-de3a-48b3-975a-2d98044a7705
[Execute.RollbackOnline]
1=\$WINDOWS.~BT\Sources\SetupHost.exe /Media /Rollback /ClientId Media360 /ReportId 0785d7a0-de3a-48b3-975a-2d98044a7705


I wonder, texted but not tested ;) set RollbackOnline to Success.
What happens at a BIOS GPT disk?

[Execute.PostOOBE]
0=\$WINDOWS.~BT\Sources\SetupHost.exe /Media /Success /ClientId Media360 /ReportId 0785d7a0-de3a-48b3-975a-2d98044a7705
[Execute.RollbackOnline]
1=\$WINDOWS.~BT\Sources\SetupHost.exe /Media /Success /ClientId Media360 /ReportId 0785d7a0-de3a-48b3-975a-2d98044a7705

Do you get a file SetupPlatform.ini at all?
Can you edit your local SetupPlatform.ini and set RollbackOnline to Success? What happens?


Or, there are anoter aproaches with a additonl real / fake / virtual UEFI hardware.
Attach a new GPT disk and the exiting hard disk to a virtual machine (VMware,Virtualbox).

#359 luizluca

luizluca
  • Members
  • 2 posts
  •  
    Brazil

Posted 22 December 2017 - 02:36 AM

Yes, a "repair installation" fails.
Actually I wonder, you got a rollback at all.


I really don't know for sure. The first reboot (after windows prepared the update), Windows starts and I can see just a flash of a windows terminal window before it reboots (the "working on updates" should follow).
After that windows reboots and it normally starts a rollback procedure. With VHD solution, my boot will loops trying to start installation or rollback. I need to rebuild BCD (either booting with ISO or inside normal Windows after booting with wimboot).
With external USB, it can rollback and return to Windows.
 

Windows setup refuses to upgrade at all here. Without UEFI firmware and GPT disk, setup refuses at online "feature update" 1709 or a <1709 DVD>\setup.exe.

Anyway let's compare a BIOS MBR upgrade example.

bootsequence {7254a080-1510-4e85-ac0f-e7fb3d444736}
device ramdisk=[C:]\$WINDOWS.~BT\Sources\SafeOS\winre.wim,{b9586286-e526-11e7-83f0-e946df80e7d6}

There is a file D:\$WINDOWS.~BT\Sources\SafeOS\ReAgent.xml
<OperationParam path="$WINDOWS.~BT\Sources\SetupPlatform.exe /execute Install:\$WINDOWS.~BT\Sources\SetupPlatform.ini"/>

And C:\$WINDOWS.~BT\Sources\SetupPlatform.ini

I wonder, texted but not tested ;) set RollbackOnline to Success.
What happens at a BIOS GPT disk?
Do you get a file SetupPlatform.ini at all?
Can you edit your local SetupPlatform.ini and set RollbackOnline to Success? What happens?

Or, there are anoter aproaches with a additonl real / fake / virtual UEFI hardware.
Attach a new GPT disk and the exiting hard disk to a virtual machine (VMware,Virtualbox).

 

I guess bootmgr was working fine for me. WIndows seems to be loaded. It is setup process that aborted my installation.

 

Sorry but I'll not be able to play args anymore as I got it working. I just adopted the UEFI emulation solution. It's quite simple and I think the cleanest of all. Windows works, all updates, including feature, works. I did not tested hibernation but it might work as well.

 

Thinking on using this same HD in a future PC (with UEFI), I created a UEFI SYSTEM partition.

It saved my day. On WIndows ISO installation, I just mapped this system partition (A:) using diskpart and installed the bootmgr to it forcing UEFI mode:

bcdboot C:\Windows /s a: /f UEFI

As I dual boot with Linux, I have grub2 as boot manager. I just created this simply entry: 

menuentry 'Tianocore' --class tianocore --class os $menuentry_id_option 'tianocore-memdisk' {
   insmod part_gpt
   linux16 /usr/lib/syslinux/memdisk
   initrd16 /boot/tianocore/tianocore.img
}

Where tianocore.img comes from this old repo (I really could not find a prebuilt image at the current repo). It boots, looks for an valid UEFI partition and boots windows (the only UEFI OS). It just works.

 

I just wonder why tianocore could not find my WIndows DVD. It did tested my USB devices for a storage, so it would only be a matter of copying all DVD files to a USB drive.

 

In summary (considering that I already have grub2 in use):

  • wimboot always booted a normal startup but any update that needs reboot will fail. "bcdedit /enum" always fails
  • VHD Boot image is equivalent to wimboot if not attached on every boot. "bcdedit /enum" always fails
  • VHD Boot image with VHD mounted using tasksched.exe works but any updates fails. Now "bcdedit /enum" works after VHD is attached.
  • VHD Boot image with VHD attach (loaded before trustedinstaller) works with everything but feature updates (and recovery)
  • USB Boot is equivalent to the previous one, except that a failed feature updates can update BCD in order to return to normal Windows boot cycle.
  • UEFI emulation (tianocore) makes everything work, except for installing from DVD (I might need an extra UEFI driver). It might work from a USB Storage but I did not test it.

I do recommend "UEFI emulation" for long-term installation (that will need feature updates). For temporary installations with short live that does not need updates, wimboot is very clean.



#360 cdob

cdob

    Gold Member

  • Expert
  • 1402 posts

Posted 22 December 2017 - 05:39 AM

I got it working. I just adopted the UEFI emulation solution.

Thanks for the feature upgrade example.
UEFI emulation (tianocore) is good at a feature upgrade.

#361 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 22 December 2017 - 09:15 AM

But, given that the Tianocore image works fine on your hardware (cannot say if it does on *all* hardware), if I get this right :unsure: one could boot "normally" from the BIOS and have the UEFI booting via Tianocore ready, using it only when an upgrade is *needed*? :unsure: :dubbio:

 

Kinda of an "emergency" alternative boot method?

 

:duff:

Wonko



#362 cdob

cdob

    Gold Member

  • Expert
  • 1402 posts

Posted 27 December 2017 - 09:16 PM

The loadable efi Clover may work at more hardware. Windows detect a UEFI environment.
http://www.rmprepusb...s/bios_gpt_boot


New game:
Kinda of an "emergency" alternative only BIOS boot method: temporary hybrid MBR

Use the GPT disk at daily usage.
Enable hybrid MBR temporary only: to install a OS. e.g install or upgrade Windows.
In that case, this is a MBR with the normal protective partition entry and one primary active partition.
Go back to GPT disk after install.
http://www.rodsbooks...isk/hybrid.html

Backup the disk first.

As for testing: given a 32 GiB GPT disk:
grub2 BIOS boot, memdisk boot.vhd
a NTFS Windows 10 partition, with \windows\boot.vhd
In addithion a EFI FAT32 system partition. Maybe useful at a UEFI hardware, holds /grub/ files too.
 
diskpart.exe
sel disk N
clean
convert gpt
create par efi size=100
format fs fat32 label="EFI"
create par prim
Remark:
The efi partition is not required currently.
It's prepared for future use, e.g. loaded UEFI firmware, ot at another UEFI hardware.

GParted DVD: https://gparted.org/
Install grub to the MBR and save grub BIOS files at the EFI system partition
(at multiboot: feel free to use another layout for the grub file)
sudo gdisk /dev/sda
n
3
34
2047
EF02

sudo mount /dev/sda1 /mnt
sudo grub-install --force --boot-directory=/mnt /dev/sda
.

Disk /dev/sda: 67108864 sectors, 32.0 GiB
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 67108830

Number Start (sector) End (sector) Size Code Name
1 2048 206847 100.0 MiB EF00 EFI system partition
2 206848 67106815 31.9 GiB 0700 Basic data partition
3 34 2047 1007.0 KiB EF02 BIOS boot partition


Backup the first hdd sector, the MBR.
 
Create the hybrid windows partition, remember a active one
sudo gdisk /dev/sda
r
p
o
h
2
y
Install Windows to the hybrid partition.
The MBR is overwritten, restore the first sector. It's a GPT disk now.

Boot a live CD, copy memdisk and set grub.cfg,
menuentry "GPT Partion boot: /Windows/boot.vhd" {
  insmod part_gpt
  linux16 /boot/syslinux/memdisk harddisk raw
  initrd16 (hd0,gpt2)/Windows/boot.vhd
}

menuentry "Win 10 setup /bootmgr - hybrided MBR partition required" {
  set root='(hd0,gpt2)'
  ntldr /bootmgr
  boot
}

menuentry "grub4dos" {
  linux16 /grub/grub.exe
}
.
Boot a Windows DVD. Create \Windows\boot.vhd
Boot from the GPT disk now.

Feel free to change partitons at the GPT disk. Add another OS, adjust boot.vhd, if appropiate.

If you like to upgrade Windows 10, create the hybrid MBR at current GPT partitions.
Adjust c:\boot\bcd, if partitions have been changed in between.
Make a Windows 10 Upgrade at MBR boot. Let Windows Update do this, or run <Install DVD>:\setup.exe.
Select the "Win 10 setup" entry at reboot several times.
Delete the hybrid MBR next and use GPT boot finally.

To clarify: there are two different \boot\bcd files used. Actually the (os)device entry is different
The one inside boot.vhd is used at GPT boot.
The other c:\boot\bcd is used at hybrid MBR boot.

Given a 64 bit Windows 7 and up:
http://www.msfn.org/...comment=1142954
should work at a 4 TiB disk, not tested. Remember to backup the disk.
Start within first 2 TiB LBA, partiton size below 2 TiB
67106815 - 206848 = 66899967
Grub4dos chainloaded:
partnew --active (hd0,0) 7 206848 66899967
Grub4dos writes the protective partition too.


Another idea: 'Setup /resizerecoverypartition disable' may be another precaution.
In cases the protective partition entry is missing/wrong, this should prohibit partition changes. Not tested.
https://docs.microso...nd-line-options
  • devdevadev likes this

#363 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 28 December 2017 - 12:22 PM

@cdob

Semi-random idea, maybe useful, maybe not. :unsure:

 

How large is the .vhd? (like 100 Mb or so, but could be even less, right?)

Is it contiguous (or can it be made so)?

 

I mean, IF it is RAW AND IF it is contiguous, one could make a direct mapping in the (hybrid) MBR for the extents of the .vhd.

 

:duff:

Wonko



#364 devdevadev

devdevadev

    Frequent Member

  • Advanced user
  • 451 posts
  •  
    India

Posted 3 weeks ago

Given a 64 bit Windows 7 and up:http://www.msfn.org/...comment=1142954
should work at a 4 TiB disk, not tested. Remember to backup the disk.
Start within first 2 TiB LBA, partiton size below 2 TiB
67106815 - 206848 = 66899967
Grub4dos chainloaded:
partnew --active (hd0,0) 7 206848 66899967
Grub4dos writes the protective partition too.

Why you mentioned grub4dos partnew code for your 32GB GPT disk while it seems to useful only in case of > 2TB MBR HDD. Is it not a bit confusing....?? Is partnew command trick also part of your hybrid approach for > 2TiB GPT HDD ? or mentioned just for >2TiB MBR HDD as a side note ?

 

New game:
Kinda of an "emergency" alternative only BIOS boot method: temporary hybrid MBR
should work at a 4 TiB disk, not tested. MBR or GPT ???

Will hybrid approach also valid for 4TB GPT USB-HDD ? You had mentioned >2TiB MBR limit stuff at the end of your GPT Hybrid approach. AFAIU, Jaclaz suggested grub4dos partnew command for >2TiB MBR HDD not for >2TB GPT or Hybrid HDD ? I want to test above Hybrid-MBR approach in 4TiB GPT USB-HDD so that GRUB2 will work in 4 TiB GPT ?.
Should I also consider >2TiB workaround of partnew during GPT partitioning of 4TiB USB-HDD ?

cdob , Please suggest GPT Hybrid-MBR partitioning for 4TiB USB-HDD. Should I also consider >2TiB partnew workaround of Wonko in Hybrid Windows Partition ?



#365 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 3 weeks ago

 Is it not a bit confusing....??

 

It wasn't until you made it so by mis-mix-quoting cdob.

 

 

There is very little actually confusing in the original post.

1) a new approach was proposed by cdob
2) this new approach has been tested succesfully by cdob on a 32 GiB disk
3) it is the (educated) guess of cdob that this same new approach might work on 4 TB disks

4) the new approach has NOT been tested on 4 Tib disks

5) what jaclaz proposed on msfn (and cdob quoted) is simply that  the 32 bit width of the MBR fields DOES NOT imply a 2 TiB disk limit, rather a 4 TiB disk limit if a "special" partitioning (2 partitions, each slightly below 2 TiB[1]) is used, AS LONG AS the OS supports it, results in that thread suggest that while XP won't work with this scheme, Windows 7 32 bit (and presumably  and reasonably also Windows 7 64 bit) will

6) since the built-in tools in Windows 7 WILL NOT allow to create easily this partitioning scheme, jaclaz suggested to use grub4dos partnew (as an easy way to create that scheme, he could have suggested *any* hex/disk editor)

 

:duff:

Wonko

 

[1] actually *any* number of partitions, as long as they ALL fit in the first 2 TiB + 1 (and one only) other partition till the end of the disk (or 4 TiB, whichever comes first).



#366 cdob

cdob

    Gold Member

  • Expert
  • 1402 posts

Posted 3 weeks ago

4TiB USB-HDD

That's a different device: a external device, not a internal disk.

There are USB hard disks with 512 (logical) bytes per sector, almost all disks below 2TiB.
A 4TiB USB hard disk reports most likely 4KiB per sector, seldom 512 bytes per sector.
That’s a hardware feature (USB hard disk controlller firmware), not the windows format.

This result to major difference USB boot.
I don't own 4KiB sector USB hard disk.

Read https://msfn.org/boa...br-hard-drives/

#367 devdevadev

devdevadev

    Frequent Member

  • Advanced user
  • 451 posts
  •  
    India

Posted 3 weeks ago

A 4TiB USB hard disk reports most likely 4KiB per sector, seldom 512 bytes per sector.

Target 4TiB USB-HDD show bytes per sector as follows- 

 LogicalBytesPerSector :                                                            512

PhysicalBytesPerSectorForAtomicity :                                       4096
PhysicalBytesPerSectorForPerformance :                                  4096
FileSystemEffectivePhysicalBytesPerSectorForAtomicity :         4096
Device Alignment :                                                                    Aligned (0x000)
Partition alignment on device :                                                 Aligned (0x000)
Performs Normal Seeks
Trim Not Supported
Not DAX capable
Not Thinly-Provisioned

Can I try your GPT Hybrid approach in above type of 4TiB USB-HDD ? Any Hope ? Is it possible to install Grub2 in 4TiB HDD of 512 bytes per sector ? If so please suggest GPT Hybrid-MBR partitioning scheme for 4TiB USB-HDD...

 

Regards....



#368 misty

misty

    Silver Member

  • Developer
  • 928 posts
  •  
    United Kingdom

Posted 6 days ago

I was kindly directed to this topic by Wonko (the sane) after posting a topic elsewhere in the forum ( Grub4dos and GPT support).

I've read through this topic to the best of my ability, however there is -
A) a lot to take in.
B) a lot of information beyond my current understanding/technical ability.

Please forgive me if this information is already covered and I missed it, however I'd like to know whether anyone has managed to find a way to install windows NT 6.* / 10.* using a GPT type disk on a system with bios firmware?

Using the information in this topic it would appear possible to boot an already installed windows OS from a MBR disk converted to GPT. Or alternatively an existing installation on a MBR disk, transferred to a GPT disk. Attempts to install windows directly to a GPT disk appear to have been unsuccessful so far?

I have tried the following. Booted to WinPE and created a GPT disk structure. Used wimlib to apply a windows 10 image to a partition on the GPT disk. Used bcdboot to create boot files. Installed grub4dos mbr code to the GPT disk using bootlace.com. Copied grldr to an accessible device. When I rebooted, grldr was loaded successfully. Used the grub4dos command-line to chainload bootmgr. Nothing happened. Based on information in this topic, this issue appears to relate to bootmgr not being able to find the BCD store on a GPT disk.

Created a floppy disk image containing bootmgr and the same BCD store I created earlier with the bcdboot command. Booted to Grub4dos, mapped the floppy disk image, chainloaded bootmgr from the mapped floppy image. The BCD store was loaded successfully and I was able to start the windows installation process. Unfortunately the install failed. I believe that cdob has speculated that this is due to the BCD store not being accessible/writable during the installation process. Grub4dos device mapping is known to be inaccessible once windows enters protected mode.

I could try using dism to install the svbus driver to the offline windows and try again - Setup may then be able to access the BCD store in the mapped floppy image - preferably file backed so that any edits made to the store are persistent. Alternatively I could try svbus with a small file backed .vhd containing a BCD store.

Any thoughts or suggestions?

:cheers:

Misty

#369 devdevadev

devdevadev

    Frequent Member

  • Advanced user
  • 451 posts
  •  
    India

Posted 6 days ago

I'd like to know whether anyone has managed to find a way to install windows NT 6.* / 10.* using a GPT type disk on a system with bios firmware?

May be you also enjoy these difficult! ;) stuff ?

https://www.sevenfor...-mbrs-duet.html

https://www.aioboot....pt-legacy-bios/

http://cmindnotes.bl...pt-disk-in.html

https://www.rmprepus...s/bios_gpt_boot

http://reboot.pro/to...-14#entry198148

http://reboot.pro/to...-15#entry205269

http://bbs.wuyou.net...read&tid=409654


  • misty likes this

#370 cdob

cdob

    Gold Member

  • Expert
  • 1402 posts

Posted 6 days ago

I could try using dism to install the svbus driver to the offline windows and try again

Read post #356 by nightrain again.
http://reboot.pro/to...-15#entry204888

Use a hard disk like image, not flopy like image.
The running windows may find bcd at a (virtual) hard disk, but not at the floppy.

svbus installation not tested, try:
Mount the hard disk image at boot time, yes use svbus.

As a addional comlexity layer:
try a Windows 10 update installation too, this is the challenge nowadays.
  • misty likes this

#371 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 6 days ago

I could try using dism to install the svbus driver to the offline windows and try again - Setup may then be able to access the BCD store in the mapped floppy image - preferably file backed so that any edits made to the store are persistent. Alternatively I could try svbus with a small file backed .vhd containing a BCD store.

 

Any thoughts or suggestions?

 

If you are into experiments, and have time, do check the experimental approach here:

http://reboot.pro/to...e-9#entry193947

 

Heck, it had 475 downloads (but not the ONLY one that I was interested it at the time, by cdob), and no (meaningful) report.

 

Basically it makes the contents of the underfloppy also exposed/mappable as VHD, and in your case, nothing prevents from making a very small GPT partition for sectors 63-2047, see:

http://reboot.pro/to...e-4#entry186428

 

Of course it is your responsability to find a way to "hook" the VHD, svbus is very promising :).

 

Consider how the 63-2047 range was born out of the requirements of the original scope (not modifying a "normal" GPT disk) but there is no need (in the case of a special made GPT disk to have the first partition start on 2048, so you could make a larger dedicated partition and place in it, besides the grldr and menu.lst a "normal" .vhd.

 

:duff:

Wonko


  • misty likes this

#372 misty

misty

    Silver Member

  • Developer
  • 928 posts
  •  
    United Kingdom

Posted 6 days ago

@cdob and wonko
Thanks for the feedback. I'm a bit limited for time tonight and will check the links in your posts in due course. And will possibly experiment when time permits.

@everyone
Some success to report. Test system was an old Lenovo X61 Thinkpad.

GPT disk set up using WinPE.

Used bootlace.com --gpt command to install Grub4Dos code to the GPT disk (used dd.exe and a Windows 98 boot disk in QEMU then wrote the sectors back to the GPT disk).

Copied grldr to a partition on the GPT disk.

Used wimlib to apply a 32-bit Windows 8.1 Enterprise to (hd0,3) on the GPT disk - (hd0,3) mounted as drive E: in WinPE.

Used diskpart to create (hd0,2)/bootmgr.vhd > attached the disk and created one active primary partition and mounted it as drive R:

bcdboot E:\Windows /S R: /F BIOS

dism.exe /image:E: /Add-driver /Driver:D:\SVBus\svbus.inf /ForceUnsigned

bcdedit /store R:\boot\BCD /set {default} testsigning on (to enable the unsigned svbus driver to be loaded)

Rebooted - grldr loaded successfully.

Used the following grub4dos commands at the command-line -
map (hd0,2)/bootmgr.vhd (hd0)
map (hd0) (hd1)
map --hook
root (hd0,0)
chainloader /bootmgr
I was able to successfully complete the Windows installation - several reboots were required.

:cheers:

Misty
  • devdevadev likes this

#373 misty

misty

    Silver Member

  • Developer
  • 928 posts
  •  
    United Kingdom

Posted 6 days ago

May be you also enjoy these difficult![/size]
;) stuff ?[/size]
https://www.sevenfor...-mbrs-duet.html
https://www.aioboot....pt-legacy-bios/
http://cmindnotes.bl...pt-disk-in.html
https://www.rmprepus...s/bios_gpt_boot
http://reboot.pro/to...-14#entry198148
http://reboot.pro/to...-15#entry205269
http://bbs.wuyou.net...read&tid=409654

@devdevadev
Sorry - I missed your posts earlier. Thanks for the links. I missed some of the posts you linked to in this topic - I blame information overload!

Misty

#374 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 6 days ago

Good.  :) 

 

Used bootlace.com --gpt command to install Grub4Dos code to the GPT disk (used dd.exe and a Windows 98 boot disk in QEMU then wrote the sectors back to the GPT disk).

 

I did a quick check inside bootlace.com, I am adding the info on the other topic:

http://reboot.pro/to...nd-gpt-support/

so it has less risks of getting "lost" in this looong thread.

 

:duff:

Wonko



#375 misty

misty

    Silver Member

  • Developer
  • 928 posts
  •  
    United Kingdom

Posted 6 days ago

...As a addional comlexity layer:
try a Windows 10 update installation too, this is the challenge nowadays.

Quite the challenge. No luck yet.

My GPT disk setup on my X61 Thinkpad test system -
- (hd0,0) - EFI System partition
- (hd0,1) - MSR partition
- (hd0,2) - Primary partition
- (hd0,3) - Primary partition
- (hd0,4) - Primary partition (empty)
- (hd0,5) - Primary partition (empty)

(hd0,3) contains my 32-bit Windows 8.1 installed earlier (see post #372).

I installed and activated 64-bit Windows 7 Ultimate on my GPT disk using a similar proceedure to post #372 - Windows 7 installed on (hd0,2).
- used wimlib to apply Windows 7 to (hd0,2)
- mounted the active primary partition on (hd0,2)/bootmgr.vhd as volume S:
- used bcdboot to apply Windows 7 boot files to S:
- used DISM to install svbus to the offline image on (hd0,2)
- bcdedit testsigning on
- completed installation
- activated Windows 7

In the running Windows 7 - used ImDisk to mount a Windows 10 .iso file.

Ran setup.exe in the mounted Windows 10 .iso file.

Error - can't recall the exact error, but it related to there not being enough free space for temporary files. The message mentioned that around 1 GiB of free space was required.

Tried again. This time I created a much larger bootmgr.vhd file (3 GiB in size) and used bcdboot to create the necessary boot files for Windows 8.1 (on (hd0,3)) and Windows 7 (on (hd0,2)) and rebooted to Windows 7.

Used ImDisk to mount my Windows 10 .iso file and ran setup.exe.

This time setup got further, however when I attempted to run the upgrade option I received an error message -
Compatibility report (saved to your desktop)

This upgrade path is not supported. Please close Setup and relaunch from
the root of the media or go back and pick a different installation choice.
Attempted to upgrade from Windows 7 Ultimate to Windows 10 (1809) Pro initially. Retried and selected Windows 10 (1809) Home edition. Both versions/editions of Windows 10 resulted in the same compatibility report error message.

Also tried upgrading Windows the 32-bit Windows 8.1 Enterprise on (hd0,3) - this also resulted in the same Compatibility report error.

Misty





Also tagged with one or more of these keywords: bios, gpt, bootmgr, winload

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users