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

#301 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 21 February 2016 - 10:14 AM

Yes, the script just creates the partition, which for the original scope (modify a GPT disk in such a way that it was bootable on BIOS without altering *anything* on the disk when sen on UEFI) was intended to be hidden.

On Windows default tools always create the partition starting on sector 2048 and we took advantage of this.

In your case (or whenever there is not this need to be hidden) you can have the partition "mapped" or "visible" also from GPT, see the already mentioned thread here:

http://reboot.pro/to...able-usb-drive/

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

Which brings us back here:

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

 

Of course one could use another partition type, instead of the EF01 one.

 

With all due respect :) I don't believe you when you say that the (hd1) does not exist or cannot be found. :w00t: :ph34r:

I mean, if you boot from the pendrive, it must "exist".

Normally on PC's when you choose to boot from a USB device  the BIOS "inserts" the USB device as first disk (hd0) and "shifts" internal disk(s) by one, so what without the pendrive is (hd0) becomes (hd1), what is (hd1) becomes (hd2), etc., this is most probably due to the fact that old OS's, like DOS must boot from first disk (hd0).

It is possible that in your setup disks are not "shifted" in this fashion, but still the "boot drive" shoudl be mapped in BIOS to some device, maybe a disk is "further shifted" (like it becomes (hd2) or (hd3) but it must actually exist.

The test is easy, all is needed is to remove the menu.lst (if any) and issue the "root" command form grub4dos command line.

 

:duff:

Wonko



#302 Pockets69

Pockets69

    Newbie

  • Members
  • 26 posts
  •  
    United States

Posted 21 February 2016 - 02:56 PM

Hey :)

 

It was supposed to be hidden then let it be hidden, it's not that it's going to change anything in the bigger scope of things

 


With all due respect  :) I don't believe you when you say that the (hd1) does not exist or cannot be found.  :w00t: :ph34r:

 

I am serious, it wasn't present, i thought it was weird as well, because hell it was the boot device, but it wasn't. I can however try again, just so you know i did hd0, hd1, hd2, hd3, fd0, fd1, fd2 and fd3, and only hd0 and fd0 was accessible and those are the ones i posted above.

 

Yeah you are right if it boots from the pen drive it must be there, but i don't know, but as you say, and it must be it disks are not shiffted like that, since even though i booted from the pen drive the hd0 is still the main hdd.

 

Ill try again, and let you know, maybe it goes to higher number that i haven't tested. 



#303 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 21 February 2016 - 05:02 PM

Sure :), I know you are serious, but there must be an explanation of this. :unsure:

 

If you found the (fd0) it means that the grldr found the menu.lst and the entries in it created the (virtual) floppy device.

 

Besides the

root 

[ENTER]

command, you may want to try:

root (

[TAB]

that should list all available devices.

 

:duff:

Wonko



#304 Pockets69

Pockets69

    Newbie

  • Members
  • 26 posts
  •  
    United States

Posted 21 February 2016 - 06:26 PM

So i thought i had posted this before... apparently not, I did the testing this is what i wrote before:

 


Ok ill have you know now i am completely confused.

 

I installed your files to the pen drive like i did in previous times, but in previous times the menu looked different also the instructions:

 

map (hd0)63+1985 (fd0)
map --hook
root
(fd0)
chainloader /bootmgr

boot 

 

Never worked, this was while the files were in the pen drive only, NOW after having installed the files on the hdd and now to verify there was no other devices listed apart from hd0 and fd0, i get gritted by a slightly different grub4dos with different options, I am stumped, i tried to find other devices hd0 hd1 etc etc, THERE ARE NONE, only hd0 and fd0. if i issue the root command it reports hd0.

 

also hd0 is the main hdd as before.

 

 

This is so weird the only way for me to verify if i am booting from the small partition now instead of the pen drive is re do everything, install the files to the pen drive and issue the root command and see what it outputs, then install your files to the the disk as well and boot from the pen drive see if it jumps to hdd and issue the root command and see the output.

 

But again there are no other devices apart hd0 and fd0, also the small instructions that never worked before to boot windows, now do, that is why i am thinking it is booting from the internal hdd, its one more of the strange things that macbooks do.

 

EDIT:

I just like to add the following, I pretty much understand how this broken efi implementation by apple works, and i am like 99% positive that i am booting from the FAT12 partition on the hdd (even though i selected the pen drive, it jumps to the hdd).

 

Edit2:

Well assumptions get me nowhere, i am going to format the hdd, and re-do everything, meaning create the partitions again, install windows, install your script to the pen drive, run root again, take note, then install on the hdd and use the pen drive to boot, run root, and see if the value changes.

This will obviously need time one two days, to test everything up again, will post here again with the results.


Edited by Pockets69, 21 February 2016 - 07:10 PM.


#305 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 21 February 2016 - 06:48 PM

I am confused as well.
It seems like (for *whatever* reason) *somehow* the pendrive "vanishes" but only after it has loaded "its own" copy of grub4dos.
I am also wondering about the "slightly different" version of grub4dos you mention, the grldr file contains an "embedded" menu.lst that contains (it depends on versions):
 

configfile
default 0
timeout 1

title find /menu.lst, /boot/grub/menu.lst, /grub/menu.lst
errorcheck off
configfile /boot/grub/menu.lst
configfile /grub/menu.lst
if "%@root%"=="(ud)" && calc *0x82A0=*0x82b9&0xff
if "%@root:~1,1%"=="f" && find --set-root --devices=f /menu.lst && configfile /menu.lst
find --set-root --ignore-floppies --ignore-cd /menu.lst && configfile /menu.lst
find --set-root --ignore-floppies --ignore-cd /boot/grub/menu.lst && configfile /boot/grub/menu.lst
find --set-root --ignore-floppies --ignore-cd /grub/menu.lst && configfile /grub/menu.lst
errorcheck on
commandline

title commandline
commandline

title reboot
reboot

title halt
halt

In practice as soon as it is executed grldr will attempt to find a menu.lst on *any* device it can find and pass control to it, after having established root on the drive where the menu.lst is found.

I am not sure from what you report if you are actually using a menu.lst (on the pendrive only on the hard disk only or on both or on neither) or not.

:duff:
Wonko

#306 Pockets69

Pockets69

    Newbie

  • Members
  • 26 posts
  •  
    United States

Posted 21 February 2016 - 08:51 PM

That makes sense!

 

do you think that it is booting from the usb pen drive, but loading menu.lst from the hdd?

I know some options were not present when i had it installed on USB only.

 

Again, Ill re-do everything and report back once testing is done.

 

Thanks a lot for the help Jaclaz



#307 Pockets69

Pockets69

    Newbie

  • Members
  • 26 posts
  •  
    United States

Posted 24 February 2016 - 09:17 PM

Well guess who's back? back again...

 

well as I said above I wiped the whole hdd and started from scratch, did some extensive testing first by installing mkhidgpt to the pen drive and then by installing it to the hdd.

We needed to figure out if the efi was booting from the hidden fat12 partition on the hdd even though we selected the pen drive, and I think I came up with something that will in fact tell us if it is booting from the pen drive and jumping to the fat12 partition on the hdd, or if it is booting from the pen drive and just reading the menu.lst from the hdd.

 

But first here is the result of booting only from the pen drive, here it is:

root now reports as 

Error 17: Cannot mount selected partition

 

the following devices are availble, hd0, fd0 and rd

 

root(rd) : Can't mount selected partition.

root(fd0) : Filesystem type is fat12, using whole disk.

root(hd0) : Can't mount selected partition. (this used to work back then I believe but only when I installed mkhidgpt in the hd which makes me think that I was booting from the hd0, making my claim correct, that even though i selected the pen drive it jumped to the fat12 partition on the hd)

 

geometry (hd0) listst all the partitions (i have already listed them above, nothing changed over here)

but here is some info that may be usefull:

drive 0x80(LBA): C/H/S=121602/255/63, Sector Count/Size=1953536130/512

 

geometry (fd0) 

drive 0x00(LBA):C/H/S=1/255/63, Sector Count/Size=16450560/512

partition num 0: active filesystem type is fat32, partition type 0x0C

Filesystem type is far12, using whole disk.

 

geometry (rd)

drive 0x7f(LBA): C/H/S=523/255/63, Sector Count/Size=8388608/512

 

only hd0 and fd0 had partitions (hd0 is obviously the main disk) fd0 has 1 partition is this the pen drive? or is rd the pen drive? I am more inclined for fd0 being the pen drive but i don't know.

 

I tried to boot windows using the instructions above  

 

 


map (hd0)63+1985 (fd0)
map --hook
root (fd0)
chainloader /bootmgr

boot 

 

this failed like it did back then when i tried, this only worked when i installed the script to the hdd.

 

now i tried to change it a bit :)

map (fd0)63+1985 (hd0)

map --hook

root (hd0)

chainloader /bootmgr

boot

 

low and behold it worked, it booted windows bootloader, however I was unable to boot the OS but at this time I don't really care, I know I can make it work, and boot the os, this was just a test.

 

Now the testing with the mkhidgpt installed on the hdd (and installed as well on the pen drive cause it's the only way to launch it from the hd on a mac)

 

Firstly this is what I did, I installed the mkhidgpt on the hdd with a menu.lst, and installed mkhidgpt on the pen drive without the menu.lst, as soon as I booted the pen drive, I was greeted by the menu.lst, so either it is as I suspect booting through the usb and jumping to the hd0 fat12 partition, or it may only be booting from the usb but getting the menu.lst from the fat12 partition, let's see if we can find out which one is happening.

 

root command reports hd0 Filesystem type fat12, using whole disk, when i tried the root command when running from the usb only, it said cannot mount selected partition.

 

 the following devices are availble, hd0, fd0 and rd

 

root(rd) : Can't mount selected partition.

root(fd0) : Filesystem type is fat12, using whole disk.

root(hd0) : Filesystem type is fat12, using whole disk (it has to be booting from internal hd, i am almost sure)

 

Now for the geometry commands:

 

geometry (rd)

drive 0x7f(LBA): C/H/S=523/255/63, Sector Count/Size=8388608/512

 

geometry (fd0) 

drive 0x00(LBA):C/H/S=1/255/63, Sector Count/Size=16450560/512

partition num 0: active filesystem type is fat32, partition type 0x0C

Filesystem type is far12, using whole disk.

 

geometry (hd0) listst all the partitions (i have already listed them above, nothing changed over here)

but here is some info that may be usefull:

drive 0x80(LBA): C/H/S=121602/255/63, Sector Count/Size=1953536130/512

 
exactly the same as above.
 
I can only assume mainly because of the root command that I am booting from the hdd with the fat12 partition, meaning I select the pen drive, and it jumps directly for the fat12 hd0 partition.
 
issuing the command above to boot into windows, works fine.
 
but again I did all this for SCIENCE, I still need a pen drive to boot from the hdd as we can see by the testings, so I may as well use the pen drive and put the bootloader files inside.
 
I am keeping the setup til tomorrow, so if you have any question, or anything that you want me to check, please ask away.
 
Again it was awesome, thank you so much for the support / patience / awesomeness Jaclaz :)


#308 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 25 February 2016 - 09:13 AM

Well,

what you report (up to a certain point) is "normal".

A grub4dos when booted will execute an internal, embedded menu.lst that contains the commands to scan all found drives to find a menu.lst and will load the first one it finds.

You boot from the pendrive the grub4dos, the embedded menu.lst is used and since there is no menu.lst on the pendrive then the one on the hard disk is found.

Let's remember that the hard disk is "special" as the MBR code doubles as  a PBR for the "underfloppy", since the menu.lst is found on the internal hard disk (mapped by the PBR as an unpartitioned device), root is established to (hd0), the "queer" part is the vanishing of the pendrive device.

 

 

What you should try would be to remove the menu.lst from everywhere.

You will be greeted directly by the grub> command prompt.

Then issue the root command and the geometry command.

It is possible that *something* in the batch (actually in the results it produces) is not correct on the pendrive, and thus prevents the mapping of the pendrive, but I wonder what it could be.

This way, since no menu.lst will be found, root will (should) remain on the boot drive.

You could also try geometry (bd) (bd is a "special" device indicating in grub4dos the boot drive). 

 

Also, since you are not in the condition where the "fake partition" is needed to be "stealth", it would surely help (for further tests and hopefully to find a finally working solution) to have it "visible", so you could use gdisk to actually "create" it along the lines of this:

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

(it may change something or be completely irrelevant, cannot say, but at least will give you easier access to the files inside the volume, i.e. allow you to easily add and if needed later modify a menu.lst in it).

 

:duff:

Wonko



#309 Pockets69

Pockets69

    Newbie

  • Members
  • 26 posts
  •  
    United States

Posted 25 February 2016 - 03:17 PM

ok menu.lst removed, there is no menu.lst anywhere on the pen drive and on the hdd.

 

root reports as 

(hd0) Filesystem type is fat12, using whole disk

 

 

the following devices are availble, hd0, fd0 and rd

 

root(rd) : Can't mount selected partition.

root(fd0) : Filesystem type is fat12, using whole disk.

root(hd0) : Filesystem type is fat12, using whole disk 

 

Now for the geometry commands:

 

geometry (rd)

drive 0x7f(LBA): C/H/S=523/255/63, Sector Count/Size=8388608/512

 

geometry (fd0) 

drive 0x00(LBA):C/H/S=1/255/63, Sector Count/Size=16450560/512

partition num 0: active filesystem type is fat32, partition type 0x0C

Filesystem type is fat12, using whole disk.

 

geometry (hd0) listst all the partitions (i have already listed them above, nothing changed over here)

but here is some info that may be usefull:

drive 0x80(LBA): C/H/S=121602/255/63, Sector Count/Size=1953536130/512

 

Just like the same as above, again no menu.lst anywhere.

 

as the for the geometry (bd) lists the hd0 partitions, so it is booting from the hd.

 

But again the only way of launching it from the hd is to have a pen drive inserted and boot it, and as i said above if i am going to have to use a pen drive, i may as well install the bootloader files on it. 



#310 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 25 February 2016 - 08:14 PM

Wait a minute.

 

geometry (fd0)
drive 0x00(LBA):C/H/S=1/255/63, Sector Count/Size=16450560/512
partition num 0: active filesystem type is fat32, partition type 0x0C
Filesystem type is fat12, using whole disk.

 

16450560*512=8422686720

Is your pendrive an 8Gb one?

And is it formatted as MBR style with a single FAT32 volume?

For some reasons that device is mounted as (fd0), this may depend on the fact that we placed a "fake" PBR in the MBR code or due to the fact that it is on USB or that it is of the "Removable" type (or more thatn one of these together).

This explains most of the confusion. :thumbsup:, I expected the pendrive to be GPT as well, and didn't check properly your previous reports, my bad  :blush: .

 

Still it doesn't really explain why the (bd) is reported as (hd0) unless something along the lines of this:

http://reboot.pro/to...-11#entry187394

continuing on next page:

http://reboot.pro/to...sword/?p=187405

happens re-setting the boot drive number to 80.

 

I am pretty sure that we can work around the issue one way or the other, but I have to re-ask you about the booting behaviour.

Right now you seemingly boot from the pendrive.

 

But what is the behaviour without the pendrive at all, what is booting (or failing to boot)?

Or what happens (which selections you make in the BIOS, what error if any you see, etc.)?

 

 

:duff:

Wonko



#311 Pockets69

Pockets69

    Newbie

  • Members
  • 26 posts
  •  
    United States

Posted 25 February 2016 - 09:08 PM

Hey

 

no man the pendrive is a 32gb one, reports as 29gb under windows if not mistaken, and yes MBR formatted with one partition.

Hey don't worry, you are helping me out immensely

 

Well i don't know if that is what is going on, but i can tell you that, the macbook EFI has this strange behaviour its not just this, i had one situation that i put the windows install files on one partition, and then booted a pen drive (it wasn't even from windows it was some linux live distro) and it jumped to the hdd and launched the windows installer.

 

It does that, it is a weird behavior, but it does it.

 

About the booting behavior it is simple:

 

if your files are not on the hdd then it boots the files on the pen drive when i select them.

if your files on the other hand are in the hdd, it boots the files on the hdd when i select the pen drive.

 

There is no Bios Jaclaz it's a mac, it only has an EFI firmware, and there are no settings.  



#312 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 26 February 2016 - 04:32 AM

>>> the following devices are availble, hd0, fd0 and rd

 

"rd" is always reported. it is the ramdisk-drive defined by grub4dos, not by BIOS. So you may want to ignore it.

 

-----------------------------

 

According to all of your descriptions, I seem to be able to get the conclusion:

 

1. You cannot boot up the machine in legacy BIOS mode without a pen drive inserted.

 

2. With pen drive inserted, the machine can boot in legacy mode(with BIOS available).

 

It is not so important that the USB was seen as (fd0) or (hd0). In the case you encountered, the USB is (fd0), and the internal HD is (hd0). it is OK. And then there are 2 possible cases:

 

(1). The refind directly booted up the MBR of the HD and grldr of HD gains control, in which case the HD is the current root device (hd0).

(2). The refind booted up the pen drive as (fd0) and grldr on pen drive gains control, but grldr then set the root to be HD in a way.

 

Note that at boot time GRLDR could setup the root device according to what it "thinks". For instance, if BPB sector data found at 0000:7C00, and it corresponds to a primary partition, then this primary partition will be set to the root partition.



#313 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 26 February 2016 - 08:56 AM

I guess that then everything - strange as it might be - has an explanation.

I am not familiar with the booting process of your machine (nor with refind).

It is a Mac.

It is (natively) EFI.

You use refind.

If I read this correctly:

http://www.rodsbooks...find/using.html

the refind scans systems to look for "legacy" systems, and when a removable device is detected attempts to boot from it. :unsure:

But I am not sure to understand the part "Booting Legacy OSes" on:

http://www.rodsbooks...find/using.html

(actually I am pretty sure I don't understand it).

Now, what happens if you try making the hidden partition on the hard disk visible?

How are your scanfor settings? Do you have hdbios in them? 

Reading this:

https://bbs.archlinu...c.php?id=173184

it seems that the issue is with the actual BIOS/UEFI/whatever of the mac that autoswitches when it finds a Hybrid MBR:

https://bbs.archlinu...c.php?id=173184

For internal disks (i.e. staying on a same system) making a hybrid MBR, though an awful hack:

http://www.rodsbooks...isk/hybrid.html

is not a problem, you could create a pointer to the small partition and mark it as the active one in a hybrid MBR. :unsure:

 

:duff:

Wonko



#314 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 26 February 2016 - 09:37 AM

@Wonko

 

This might be slightly off-topic -- I encountered an ASUS notebook with Win8 installed, and the internal disk is of GPT. I cannot set it up to boot to legacy BIOS mode even with a BIOS-bootable USB pen drive inserted. Surely it boots to EFI mode with success(by using an EFI style bootable USB pen drive). The company does not like BIOS, I conclude.



#315 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 26 February 2016 - 12:04 PM

@tinybit

Yes, I have already seen somewhere similar reports, hence (JFYI):

http://reboot.pro/to...ot/#entry196816

http://reboot.pro/to...ot/#entry196838

 

But the reFind on the Mac specifically should work with "normal" Hybrid MBR's, or at least it is documented as such. :unsure:

 

:duff:

Wonko



#316 Pockets69

Pockets69

    Newbie

  • Members
  • 26 posts
  •  
    United States

Posted 26 February 2016 - 02:00 PM

Hey Tinybit and Jaclaz

 


 

1. You cannot boot up the machine in legacy BIOS mode without a pen drive inserted.

 

 

Exactly, I mean there is a way, its flagging a partition on the hd as hybrid then it acts as that partition is booted on CSM, but that's completely out of the equation because it's dangerous and poorly designed, it is as simple as you flag a partition as hybrid you install something on it, then you go about your way, and install another OS somewhere that has nothing to do with that partition, and when you try to boot that CSM/Legacy partition it doesn't work anymore, that shit is completely broken.

 


 

2. With pen drive inserted, the machine can boot in legacy mode(with BIOS available).

 

 

Exactly, refind can boot legacy normally from the pen drive, so if i install Jaclaz script to it, it just boots from the pen drive, likewise if i install a legacy 32 bit linux distro, the same happens i can boot it and go to the installer or use it's live version.

If i however install Jaclaz scripts on the hdd, and then the same files or other legacy linux distro on the pen drive, and if you select the pen drive on refind, it automatically jumps to the HDD, it doesn't even care about what's inside the pen drive it jumps straight to boot grub4dos that is on the hdd.

 


 

(1). The refind directly booted up the MBR of the HD and grldr of HD gains control, in which case the HD is the current root device (hd0).

 

(2). The refind booted up the pen drive as (fd0) and grldr on pen drive gains control, but grldr then set the root to be HD in a way.

 

 

 

Option 1 is happening, and i explained above why, again, if I just put Jaclaz files on the hdd with his script, and on the pen drive I install arch linux installer, if i try to boot arch, it jumps directly to the HDD booting grub4dos, so the booting is happening on the hdd, even though i selected the pen drive with linux.

I know that is what it does, just don't know why it does it and why the erratic behavior

 


 

I guess that then everything - strange as it might be - has an explanation.

I am not familiar with the booting process of your machine (nor with refind).

It is a Mac.

It is (natively) EFI.

You use refind.

If I read this correctly:

http://www.rodsbooks...find/using.html

the refind scans systems to look for "legacy" systems, and when a removable device is detected attempts to boot from it.  :unsure:

 

.

Exactly it does that it detects legacy systems on the pen drive

 


 

But I am not sure to understand the part "Booting Legacy OSes" on:

http://www.rodsbooks...find/using.html

(actually I am pretty sure I don't understand it).

 

I ll try to explain, as i said above there is a way to boot legacy OSs on the disk, you need to flag a partition as hybrid and then install the OS as legacy/csm, that is what apple wants you to do when you try to install windows on a mac, the problem with this is that hybrid partitions are dangerous and don't work well, so what happen when you install windows on that hybrid partition? it works as intended, until you need to install another OS on some other partition... if you do since this legacy/csm stuff is completely shit in a mac, when you try to boot windows from that partition you get an operating system not found.

And flagging a partition as hybrid is exactly what I don't want and why I started this endeavor of installing windows 7 in EFI mode in mac (That has never been achieved before).

 


 

This might be slightly off-topic -- I encountered an ASUS notebook with Win8 installed, and the internal disk is of GPT. I cannot set it up to boot to legacy BIOS mode even with a BIOS-bootable USB pen drive inserted. Surely it boots to EFI mode with success(by using an EFI style bootable USB pen drive). The company does not like BIOS, I conclude.

 

 

Really?? that's crap man, I own several asus laptops (vivobook s200, vivobook s400, asus s46, they are all ivy bridge btw) and all of them can boot (as long as CSM is enabled that is) legacy from an mbr pen drive, for instance some linux distro, but they can't boot from legacy on a gpt disk unfortunately.



#317 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 26 February 2016 - 04:27 PM

I still don't understand it. :(

 

The ReFind is something that comes not from Apple, the good guy that wrote it (Roderick W. Smith, who wrote also the very good tool gdisk :thumbsup:) seemingly intentionally put that "feature" in the bootmanager.

What the Author (or the good Apple guys) think as a "feature" seems to me (and seemingly to you) more like a senseless roadblock.

At least to me it doesn't make sense to provide not a "manual override" to the automated scanning process (and I don't really understand why - the heck - a given system is re-scanned at every boot).

As said I am not at all familiar with that tool or the stupid EFI/UEFI (let alone the Mac's seemingly flawed implementation) but it doesn't really sound "right", it should be IMHO FIRST thing to implement and not the last (maybe) one:

http://www.rodsbooks...le.html#stanzas

Manual boot stanzas in rEFInd are similar to those in GRUB Legacy, GRUB 2, or ELILO. You can use them to add EFI boot loaders to those that are auto-detected. rEFInd does not yet support manual boot stanzas for BIOS-mode boot loaders. 

 

:frusty:

 

Back to topic, try and see if you can avoid the mapping of the pendrive to (fd0) by removing the (fake) BPB from the MBR, i.e. fill with 00's from offset 0x03 to offset 0x59, like from:



EB 58 90 47 52 4C 44 52 20 20 20 00 02 01 40 00 
01 10 00 00 08 F8 06 00 3F 00 FF 00 00 00 00 00 
00 00 00 00 80 00 29 57 74 53 66 47 34 44 5F 42 
49 4F 53 47 50 54 46 41 54 31 32 20 20 20 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 FA 31 C0 8E D8 8E 


to:

EB 58 90 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 FA 31 C0 8E D8 8E 

Now the thingy is to all effects a "plain partitioned hard disk MBR" and should not be mapped to a floppy like device.

 

:duff:

Wonko

 



#318 Advanced Shutdown

Advanced Shutdown
  • Members
  • 7 posts
  •  
    Russian Federation

Posted 26 February 2016 - 07:24 PM

Hi guys.

I've tried to install and boot Windows 7 as described here

http://reboot.pro/to...o-gpt/?p=184489

but after I select the corresponding GRUB2 menu entry I get the message "A disk read error occurred". Where does this message come from (BIOS, MBR, bootmgr, sth. else)?

I have 1 SSD and 3 HDDs (AHCI mode). I installed W7 on SSD (with GPT). The partition layout is as follows:

1 bios_grub

2 boot (FAT32)

3 reserved

4 windows (NTFS) <- this is where I installed W7 with imagex and this is where bootmgr.vhd resides

5, 6, 7 linux

 

I also have an old W7 on one of HDDs (which has MBR).

Yes I know that I can boot new W7 using MBR on one of HDDs but first I want to try to do it using VHD.

Maybe someone can advise me how can I identify the problem? I can provide the needed info.


Edited by Advanced Shutdown, 26 February 2016 - 07:25 PM.


#319 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 26 February 2016 - 07:35 PM

@Advanced Shutdown

Check that you have the Append RAW parameter for memdisk, see:

 

http://reboot.pro/to...o-gpt/?p=182138

http://reboot.pro/to...o-gpt/?p=192051

http://reboot.pro/to...o-gpt/?p=192052

 

:duff:

Wonko



#320 Pockets69

Pockets69

    Newbie

  • Members
  • 26 posts
  •  
    United States

Posted 26 February 2016 - 11:17 PM

Hey Jaclaz

 


 

The ReFind is something that comes not from Apple, the good guy that wrote it (Roderick W. Smith, who wrote also the very good tool gdisk  :thumbsup:) seemingly intentionally put that "feature" in the bootmanager.

 

 

Good guy... I am not so sure about that, although his skills are undeniable, but what "feature" are you referring to? The ability to boot legacy from an hybrid flagged partition? Well not quite... you see the csm/legacy partition that macbooks are able to boot from they are able to see them but only if they have windows installed, other than that, it doesn't see anything, no a mbr formatted pen drive with linux anything, so it can boot legacy/CSM if the partition has Windows on it other than that, it can't boot anything, this is on a normal macbook with no refind installed.

Refind extends this a bit, allowing you to boot legacy installed linux OS by launching vmlinuz (the kernel) or launching Linux installers that are on a MBR usb.

 

So without refind legacy booting is reduced to windows only and apple's bootpicker can see the windows drive.

With refind however you ALSO can boot legacy/csm from a pen drive and linux distributions on the hdd by booting the kernel instead of the bootloader, this is what refind adds to the game.

 

 

What the Author (or the good Apple guys) think as a "feature" seems to me (and seemingly to you) more like a senseless roadblock.

 

 

Yes if the feature you mentions is the hybredization of a partition yeah its a roadblock its ridiculous and annoying, but it has a historical propose, windows 7, vista and xp are commonly installed on regular pcs as bios installation on an mbr disk, so that is what apple did, they tried to facilitate the install of said windows on a gpt disk by turning one partition into an hybrid partition and then install it like it was installed on mbr partition.

 

Right now it doesn't make any sense, since vista sp1 or whatever also supports EFI, but they insist in bringing that stupid hybrid partition to install windows, when windows already supports EFI, but since the EFI implementation on Macs are not Universally compliant and there are several fuckups on the EFI implementation at least on older macs they keep bringing this hybrid crap to boot windows, but since i don't like it, i set up to boot it on EFI mode on a mac (which as i said above has never been done before).

 

Just so you have an idea, I believe that only the last gen of macbook pros (the retina ones) and the last gen of macbook airs and macbook, got rid of all that hybrid bulshit and you are now able to install windows without much problems on EFI mode, but only windows 8.1 and 10, windows 7 still doesn't work with their crappy implementation.

 


 

Back to topic, try and see if you can avoid the mapping of the pendrive to (fd0) by removing the (fake) BPB from the MBR, i.e. fill with 00's from offset 0x03 to offset 0x59, like from:



EB 58 90 47 52 4C 44 52 20 20 20 00 02 01 40 00
01 10 00 00 08 F8 06 00 3F 00 FF 00 00 00 00 00
00 00 00 00 80 00 29 57 74 53 66 47 34 44 5F 42
49 4F 53 47 50 54 46 41 54 31 32 20 20 20 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 FA 31 C0 8E D8 8E



to:

EB 58 90 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 FA 31 C0 8E D8 8E


Now the thingy is to all effects a "plain partitioned hard disk MBR" and should not be mapped to a floppy like device.

 

 

Well what is the problem of the mapping of the pen drive to fd0, will it make any difference?

 

also care to explain how will i be able to do that, i understand that i need to fill the ofset from 0x3 to 0x59 with zeros the problem is how am i going to do that, i know that i can use an hex editor to fill it with zeros, but what should i use to get that bpb, is there a dd command that i should use? I am sorry for being such a noob xD

 

Thanks a lot for spoonfeeding me Jaclaz :D



#321 Advanced Shutdown

Advanced Shutdown
  • Members
  • 7 posts
  •  
    Russian Federation

Posted 27 February 2016 - 12:04 AM

Thanks Wonko, but in my case it was an invalid path to memdisk. :hmm:

After correcting the path new W7 boots but now W7 setup won't finish. Apparently because it cannot find bcd store.

Error      [0x0e00b3] TOOL   Sysprep_Specialize_Bcd: There was an error opening the system store. Status=[0xC0000452][gle=0x000003e5]
Error      [0x0f0082] SYSPRP LaunchDll:Failure occurred while executing 'C:\Windows\System32\spbcd.dll,Sysprep_Specialize_Bcd', returned error code 15299[gle=0x000003e5]
Error      [0x060435] IBS    Callback_Specialize: An error occurred while either deciding if we need to specialize or while specializing; dwRet = 0x3bc3

So unless there's a way to make some emulated medium (hdd, floppy) that W7 can recognize by itself during boot right after installation (don't want to use 3rd party drivers) I will have to sacrifice one of my old flash drives. ;)



#322 Pockets69

Pockets69

    Newbie

  • Members
  • 26 posts
  •  
    United States

Posted 27 February 2016 - 12:47 AM

Advanced Shutdown let me fix that for you :)

 

can you boot back into windows installer again (it will complain that the installer failed so you will need to restart and re-install windows again), press Shift+F11 then:

type "cd oobe"

type msoobe.exe

 

that will start the out of the box experience and you can then put your username password etc, but won't be able to reach the desktop... Next time you boot however, you will have a functioning desktop.

 

good luck :) 



#323 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 27 February 2016 - 01:25 AM


Exactly, refind can boot legacy normally from the pen drive, so if i install Jaclaz script to it, it just boots from the pen drive, likewise if i install a legacy 32 bit linux distro, the same happens i can boot it and go to the installer or use it's live version.

If i however install Jaclaz scripts on the hdd, and then the same files or other legacy linux distro on the pen drive, and if you select the pen drive on refind, it automatically jumps to the HDD, it doesn't even care about what's inside the pen drive it jumps straight to boot grub4dos that is on the hdd.

 

Option 1 is happening, and i explained above why, again, if I just put Jaclaz files on the hdd with his script, and on the pen drive I install arch linux installer, if i try to boot arch, it jumps directly to the HDD booting grub4dos, so the booting is happening on the hdd, even though i selected the pen drive with linux.

I know that is what it does, just don't know why it does it and why the erratic behavior.

 

So I guess ------ rEFInd would simply pick up a "legacy" device and boot it up, no matter whether or not it is USB drive. Jaclaz's script might have turned the HD to be "legacy" as seen by rEFInd. It could also be a bug (or a feature) of rEFInd.

 

Another possibility ------ The rEFInd tried to boot up the USB drive at first. But the boot loader on the USB drive automatically switched to the HD and booted it up.



#324 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 27 February 2016 - 02:01 AM


Really?? that's crap man, I own several asus laptops (vivobook s200, vivobook s400, asus s46, they are all ivy bridge btw) and all of them can boot (as long as CSM is enabled that is) legacy from an mbr pen drive, for instance some linux distro, but they can't boot from legacy on a gpt disk unfortunately.

 

You just do not own the one I encountered. Surely CSM was enabled, but it did not function. And CSM will be automatically disabled on the next boot. Sorry I cannot tell the model number because the machine is not at hand nearby me. It is not mine.



#325 Pockets69

Pockets69

    Newbie

  • Members
  • 26 posts
  •  
    United States

Posted 27 February 2016 - 05:19 AM


 

So I guess ------ rEFInd would simply pick up a "legacy" device and boot it up, no matter whether or not it is USB drive. Jaclaz's script might have turned the HD to be "legacy" as seen by rEFInd. It could also be a bug (or a feature) of rEFInd.

 

Another possibility ------ The rEFInd tried to boot up the USB drive at first. But the boot loader on the USB drive automatically switched to the HD and booted it up.

 

 

Even if what you said is true, where is the entry in refind to boot from the hdd then? there is none, the thing is it's not Jaclaz script only, as i said before the same crap has happened with windows as well, i put the install files from windows on a partition, forgot about them, when i tried to install some linux distro on another partition, when i was booting from the usb with linux on it, instead of starting linux installer i am greeted by a windows installation starting LOL it jumps to the hdd out of nowhere.

 

As for the asus stuff yeah that's crap i hate how oems are closing their firmwares more and more its beyond ridiculous, and asus aren't the worst, you should see the options you have with lenovo or hp... it's beyond pathetic, what is even worse? a broken firmware like you mentioned, csm option available but not working is ridiculous. 







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

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users