Jump to content











Photo
- - - - -

Can't install grub with BootICE


  • Please log in to reply
23 replies to this topic

#1 doveman

doveman

    Frequent Member

  • Advanced user
  • 426 posts
  • Location:Surrey
  •  
    United Kingdom

Posted 05 October 2018 - 08:00 PM

I've set up an HP 840 G3 laptop with Windows 10 for my brother and want to make it dual-boot with LibreElec, so he can use that when he wants to show videos on the projector at his club without worrying about Windows doing something weird in the middle of it.

 

However BOOTICE doesn't want to help me and the only options that aren't greyed out under Process MBR are Ultra ISO and Windows NT.

 

Would the fact that Secure Boot is enabled in the BIOS cause this?

 

Is there another tool that will install the grub MBR for me?

 

Also I need to enable Bitlocker on the Windows 10 partition and the Data partition once everything's working but I'm not sure if doing that will overwrite the grub MBR with a Windows one, or if the Bitlocker stuff loads from elsewhere.

Attached Files



#2 steve6375

steve6375

    Platinum Member

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

Posted 05 October 2018 - 08:07 PM

It has GPT partions, not MBR partitions so you cannot install to MBR because there isn't one!

Why not make a bootable USB drive from LibreElec and boot to that and keep it all separate.

It also has the advantage that you can use someone else's computer or notebook, if available, and don't have to take yours (but you will need to test it to check for h/w and driver compatibility).


  • doveman likes this

#3 doveman

doveman

    Frequent Member

  • Advanced user
  • 426 posts
  • Location:Surrey
  •  
    United Kingdom

Posted 05 October 2018 - 10:16 PM

Doh! That would explain it.

 

Yeah I'll try the USB drive, it's just a bit fiddly booting from them with this laptop. I had to go in the BIOS and disable Secure Boot and enable legacy boot for another stick (which used grub to boot True Image) and I'm not sure if Windows (at least with Bitlocker enabled) will boot without Secure Boot. If not the USB stick will be impractical as I can't expect my brother to go in the BIOS and change settings each time he wants to switch between Windows and LE.



#4 doveman

doveman

    Frequent Member

  • Advanced user
  • 426 posts
  • Location:Surrey
  •  
    United Kingdom

Posted 06 October 2018 - 04:08 PM

It does work from USB stick if I disable Secure Boot in the BIOS and Windows still boots (I haven't tried enabling Bitlocker yet) but I'd still rather have it on the SSD to make it simpler for my brother and free up the USB port.

 

It seems that grub can be installed to the ESP partition but these instructions are aimed at Linux users and grub looks for files in /boot, so is there an equivalent grub4dos method that will load grldr and menu.lst from a FAT32 partition instead?



#5 doveman

doveman

    Frequent Member

  • Advanced user
  • 426 posts
  • Location:Surrey
  •  
    United Kingdom

Posted 09 October 2018 - 12:14 PM

I guess it might be easiest to just image the partitions, reconfigure the SSD as MBR and restore from the image. I'm still not sure where the Bitlocker boot screen loads from though or if installing grub on the MBR will mess that up?



#6 steve6375

steve6375

    Platinum Member

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

Posted 09 October 2018 - 12:26 PM

You cannot boot from encrypted files, so bitlocker requires a separate partition on which it can place bootmgr etc.

"For computers that boot natively with UEFI firmware, at least one FAT32 partition for the system drive and one NTFS partition for the operating system drive. For computers with legacy BIOS firmware, at least two NTFS disk partitions, one for the system drive and one for the operating system drive. For either firmware, the system drive partition must be at least 350 megabytes (MB) and set as the active partition."

 

 

You can use wee to boot to grub4dos once Windows is installed.

https://www.rmprepus...m/tutorials/wee



#7 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 09 October 2018 - 01:42 PM

I don't understand.

 

@doveman

Are you booting UEFI or BIOS?

grub4dos won't work in UEFI (only on BIOS).

If the disk is GPT it is not a big problem, you can use the UMBR to boot the grub4dos from a GPT partition.

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

http://chenall.net/post/grub4dos_umbr/

 

@Steve6375

It is not exact to say that GPT has not a MBR, it has a (normally codeless)  "protective MBR" alright.

 

:duff:

Wonko



#8 AnonVendetta

AnonVendetta

    Silver Member

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

Posted 09 October 2018 - 02:04 PM

Even GPT has a so-called protective MBR. So it should be possible to write to the MBR with BootIce. Having Secure Boot enabled could be an issue, I recommend always leaving it off if your BIOS will allow you to do so. SB is more headache than it's worth.



#9 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 09 October 2018 - 06:01 PM

Even GPT has a so-called protective MBR. So it should be possible to write to the MBR with BootIce.

No.

Bootice uses the "normal" grub4dos grldr.mbr, which is more than one sector long and thus CANNOT be written to GPT, as second and third sector (onwards, usually up to sector 33) on GPT are used for the GPT partition tables, it simply won't fit..

 

https://en.wikipedia...Partition_Table

 

:duff:

Wonko



#10 doveman

doveman

    Frequent Member

  • Advanced user
  • 426 posts
  • Location:Surrey
  •  
    United Kingdom

Posted 4 weeks ago

I don't understand.

 

@doveman

Are you booting UEFI or BIOS?

grub4dos won't work in UEFI (only on BIOS).

If the disk is GPT it is not a big problem, you can use the UMBR to boot the grub4dos from a GPT partition.

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

http://chenall.net/post/grub4dos_umbr/

 

@Steve6375

It is not exact to say that GPT has not a MBR, it has a (normally codeless)  "protective MBR" alright.

 

:duff:

Wonko

I think with Secure Boot enabled it's UEFI but if I switch it to Legacy Mode it's BIOS.

 

Thanks for the link to UMBR, that looks like it should work if I boot from a grub4dos USB stick into the g4d environment to install it. The problem is the download link http://b.chenall.net/boot/grub/umbrdoesn't work. Is there anywhere else I can get it from?



#11 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 4 weeks ago

Try the wayback machine cached file:

https://web.archive..../boot/grub/umbr

 

If you have issues with it, you can still use my half-@§§ed (but working AFAIK) approach:

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

OR this one (experimental/to be tested):

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

 

 

 

:duff:

Wonko


  • doveman likes this

#12 doveman

doveman

    Frequent Member

  • Advanced user
  • 426 posts
  • Location:Surrey
  •  
    United Kingdom

Posted 3 weeks ago

Thanks, the wayback link worked.

 

I'm struggling to understand the command syntax though. 

 

In the example given it says "The partition with the system installed is (hd0,1)". Presumably by "system" it means the OS but I can't use the Win10 partition as that will be encrypted with bitlocker. My Windows 10 partition is 0,3 and I've put grldr and menu.lst on 0,5, which is a 1GB FAT32 partition for booting LibreElec. As I'll be booting from USB stick to run umbr I guess the SSD will be hd1.

 

It also says "The two backups of the GRLDR are the ESP partition (hd0,0)/grldr and the normal partition (hd0,3)/boot/grub/grldr, and there are partition gaps (hd0) 6554443+63. a WEE63". I don't know what it means by the "two backups", maybe it just means two copies, either of which can be used. I have no idea what the WEE63 bit is about but maybe I don't need that.

 

So if I used:

 

umbr -d=1 -p=3 (hd1,5)/boot/grub/grldr (hd1,0)/grldr

 

will that install something in the ESP that will then look for grldr in /boot/grub and on (hd1,0)? Presumably I could put grldr in the root of (hd1,5) instead of putting it in /boot/grub and change the command to (hd1,5)/grldr. (hd1,0) is the 500MB NTFS Windows Recovery partition so I'm not sure if grldr can go on there but is there even any need to tell umbr to look anywhere other than (hd1,5) for it?

 

After running umbr to install the loaded in the ESP, will this boot by default so that I won't be able to boot Windows or LibreElec anymore without a grldr and menu.lst in place (or by typing in the required commands manually at the grub command line)?



#13 doveman

doveman

    Frequent Member

  • Advanced user
  • 426 posts
  • Location:Surrey
  •  
    United Kingdom

Posted 3 weeks ago

Also what do I put in menu.lst to boot Win 10?

 

On my desktop I seem to have managed to install it all in one partition, so I can just use

 

root (hd0,1)
makeactive
chainloader /bootmgr
 
but on this laptop the Win 10 partition doesn't contain bootmgr or the boot/BCD and there's three partitions before it, as shown in the screenshot in the OP. Disk Management only shows the 499MB Recovery partition and the 100MB ESP partition, not the 16MB MSR one and those two can't be assigned drive letters anyway so I can't look at them to see what they contain.


#14 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 3 weeks ago

Oh yes, they can be assigned a drive letter alright.

 

Just use mountvol (it should be able, running Windows 7 + to assign a letter to the ESP partition), if for any reason that doesn't work try diskpart:

https://support.micr...tvol-utility-in

 

Still, normally in a GPT disk the firmware is UEFI, so in the ESP partition there will be the normal .EFI boot files.

 

You need to add there the BIOS boot files (i.e. BOOTMGR and \boot\BCD) and the grldr (and if neded the menu.lst, if you put the menu.lst in another partition or in a different form default path you will need to edit the embedded menu.lst in grldr to make it find the "full" menu.lst).

 

What the UMBR does in a nutshell is to chainload the grldr, so that as long as the grldr resides in a filesystem that grub4dos can access (i.e. not the bitlockered volume) it can be chainloaded, the ESP partition seems like the most logical choice.

 

I don't think you actually need two copies of grldr.

 

If you don't want to have the grldr and menu.lst in *any* partition, you can try using my approach that creates a (hidden) small volume in the unused space LBA 63-2047 containing all the boot files.

 

This volume won't be normally accessible by the booted windows, but you can mount/access it in grub4dos or use IMDISK with direct access, the only issue might be that the booted windows won't be able to mount/access the BCD.

 

Of course nothing prevents you from having in the hidden small partition just the grldr and menu.lst and have the BOOTMGR and \boot\BCD on the ESP volume (ot in another accessible, not bitlockered, volume.

 

:duff:

Wonko



#15 doveman

doveman

    Frequent Member

  • Advanced user
  • 426 posts
  • Location:Surrey
  •  
    United Kingdom

Posted 3 weeks ago

OK, thanks, I'll try mounting them with mountvol or diskpart to see what's on them.

 

So it's probable that there's no BOOTMGR or boot\BCD anywhere at the moment and grub4dos can't boot WIn10 without them? I guess if I've got the partition mounted in Win10 I could use EasyBCD to create the required files on it?

 

I'm confused by your suggestion that I'll need to edit the embedded menu.lst to make it find the "full" one. In my experience if there's no menu.lst available on the HDD/SSD then grub4dos just boots to a command line, not an embedded menu.lst, and I can put grldr and menu.lst on any partition and grub4dos finds them. Does UMBR work differently?

 

My main reason for putting the menu.lst on the LibreELEC FAT32 partition is that makes it easy to edit it if necessary and I generally just put the grldr with the menu.lst, although grldr doesn't really need to be accessible so I could put that on the ESP partition.

 

So with the ESP partition being (hd0,1) should I just use this command?

 

umbr -d=1 -p=3 (hd1,0)/grldr

 

What purpose do the -d=1 and -p=3 bits serve, when the destination for grldr is set by the last part and what will happen if grldr can't be located after installing umbr?



#16 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 3 weeks ago

The last few lines of grldr are an "internal" or "embedded" menu.lst, they are read when the grldr is chainloaded and they - among other things - try to find the "real" menu.lst, here they are from 0.4.6a-2018-06-12:



pxe detect
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
	configfile http://b.chenall.net/menu.lst
	errorcheck on
	commandline

title commandline
	commandline

title reboot
	reboot

title halt
	halt

if your menu.lst is available in the searched devices/paths, then it will be loaded, if it isn't it won't and you will have the grub4dos command prompt only.

 

 

OK, thanks, I'll try mounting them with mountvol or diskpart to see what's on them.

 

So it's probable that there's no BOOTMGR or boot\BCD anywhere at the moment and grub4dos can't boot WIn10 without them? I guess if I've got the partition mounted in Win10 I could use EasyBCD to create the required files on it?

 

I would rather use BCDBOOT.

https://docs.microso...ions-techref-di

 

 

 

 

So with the ESP partition being (hd0,1) should I just use this command?

 

umbr -d=1 -p=3 (hd1,0)/grldr

 

What purpose do the -d=1 and -p=3 bits serve, when the destination for grldr is set by the last part and what will happen if grldr can't be located after installing umbr?

Yes and no (mostly no).

Remember that you need to have grldr on the ESP partitions before running that command.

 

This is the translation (Google translate) of the parameters:



Umbr [-d=D] [-p=P] [--test] [file1] [file2] [file3] 
-d=D Specifies that the disk to be installed defaults to the current ROOT disk 
-p=D The boot partition defaults to the first partition. 
--test test mode, does not write to disk, add this parameter will enter the installation effect test. 
file1-3 can specify three boot file locations to prevent startup failure. 
Note: This filex can Is any file format that GRUB4DOS can recognize (must be stored continuously). 
For example (hdx, y) / path / file or (hdx) xxxx + yyyy / (hdx, y) xxx + yyy, etc. file1-file3 must be in the same 
The disk is consistent with the disk specified by -d. 
File1-2 can also be a PBR such as (hd0, 3) +1 file1 is the main boot file, if the test fails, try file2 again...

so i would try to supply ANYWAY the --test parameter, but you want to run:



umbr -d=0 -p=1 --test (hd0,1)/grldr

 the -d=0 -p=1 actually means AFAICT "should any of the files linked to ([file1] [file2] [file3]) fail, try chainloading the bootsector of the drive 0 partition 1", it has to be seen if your ESP  partition has a valid bootsector chainloading the "normal" BOOTMGR.

:duff:

Wonko


  • doveman likes this

#17 doveman

doveman

    Frequent Member

  • Advanced user
  • 426 posts
  • Location:Surrey
  •  
    United Kingdom

Posted 3 weeks ago

if your menu.lst is available in the searched devices/paths, then it will be loaded, if it isn't it won't and you will have the grub4dos command prompt only.


Ah righto, that makes sense.
 

I would rather use BCDBOOT.
https://docs.microso...ions-techref-di


Ah yes, that's probably better. If I use "bcdboot C:\Windows /s C: /f ALL" to install both the BIOS and UEFI files on the C: partition then presumably I wouldn't actually need the ESP partition anymore and could just set menu.lst to boot directly to (hd0,3)?


Yes and no (mostly no).
Remember that you need to have grldr on the ESP partitions before running that command.


Thanks for the reminder, I would've probably forgotten to do that.
 

so i would try to supply ANYWAY the --test parameter, but you want to run:


umbr -d=0 -p=1 --test (hd0,1)/grldr
 the -d=0 -p=1 actually means AFAICT "should any of the files linked to ([file1] [file2] [file3]) fail, try chainloading the bootsector of the drive 0 partition 1", it has to be seen if your ESP  partition has a valid bootsector chainloading the "normal" BOOTMGR.


The reason I had -d=1 and (hd1) is because I'll be booting from USB stick which will be hd0. Maybe I should just do:

map (hd0) (hd1)
map (hd1) (hd0)
map --hook

before running UMBR though?

#18 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 3 weeks ago

Ah yes, that's probably better. If I use "bcdboot C:\Windows /s C: /f ALL" to install both the BIOS and UEFI files on the C: partition then presumably I wouldn't actually need the ESP partition anymore and could just set menu.lst to boot directly to (hd0,3)?
 

I don't know. :dubbio:

 

The ESP partition is NEEDED for UEFI booting and (normally) it needs to be FAT32 (unless your UEFI understands NTFS or you are using the Rufus EFI driver), but besides the filesystems, a UEFI needs the ESP UUID (C12A7328-F81F-11D2-BA4B-00A0C93EC93B)  in order to find and chainload the EFI bootloader.

 

And, if I recall correctly your "main" volume is bitlockered, so you can't put boot files on it anyway, I believe. :unsure:

 

You can remap disks to keep the order as if it was not booted from USB, or you can use the (hd1,0) and the  -d=1, I don't think that it would make any difference, I would run a "find --set-root /grldr", "root" to verify before issuing the command anyway.

 

:duff:

Wonko


  • doveman likes this

#19 doveman

doveman

    Frequent Member

  • Advanced user
  • 426 posts
  • Location:Surrey
  •  
    United Kingdom

Posted 3 weeks ago

I don't know. :dubbio:
 
The ESP partition is NEEDED for UEFI booting and (normally) it needs to be FAT32 (unless your UEFI understands NTFS or you are using the Rufus EFI driver), but besides the filesystems, a UEFI needs the ESP UUID (C12A7328-F81F-11D2-BA4B-00A0C93EC93B)  in order to find and chainload the EFI bootloader.
 
And, if I recall correctly your "main" volume is bitlockered, so you can't put boot files on it anyway, I believe. :unsure:


Hmm, yes I forgot about the bitlocker factor. I'm not sure where the password prompt loads from and at what point the drive gets decrypted but its probably going to be AFTER the point where the boot files are needed.

I have a problem putting the boot files on the ESP partition though. I mounted it in Win10 with diskpart but it denied me access, saying I should use the Security tab to manage permissions but there is no Security tab for the assigned drive when I right-click and select Properties!
 

You can remap disks to keep the order as if it was not booted from USB, or you can use the (hd1,0) and the  -d=1, I don't think that it would make any difference, I would run a "find --set-root /grldr", "root" to verify before issuing the command anyway.


Good idea, thanks.

#20 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 3 weeks ago

I think that in (stupid) Windows 10 that is an Explorer limitation (by design as the good MS guys would put it).

Explorer ++ is mentioned here and there as being able to access the ESP volume just fine, but I believe that any non-MS-Explorer file manager would do, example:

https://www.insanely...-on-windows-10/

 

Personally I would try 7-zip (which is a file manager besides being an archive/compression tool).

 

:duff:

Wonko



#21 doveman

doveman

    Frequent Member

  • Advanced user
  • 426 posts
  • Location:Surrey
  •  
    United Kingdom

Posted 2 weeks ago

OK, 7-Zip enabled me to browse the ESP Volume (I mounted it with BootICE rather than diskpart this time, although that doesn't matter) and I added the BIOS boot files to it with bcdboot.

I got an error running umbr though, as shown in the attached picture. (hd1,5) is my 1GB FAT32 LibreELEC boot partition with grldr and menu.lst on it.

Attached Files



#22 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 2 weeks ago

OK, 7-Zip enabled me to browse the ESP Volume (I mounted it with BootICE rather than diskpart this time, although that doesn't matter) and I added the BIOS boot files to it with bcdboot.

I got an error running umbr though, as shown in the attached picture. (hd1,5) is my 1GB FAT32 LibreELEC boot partition with grldr and menu.lst on it.

At first sight it may depend on either:
1) a "wrong" version of grldr (too new or too old? :unsure:)
2) the file (hd1,5)/grldr not existing or not found 

3) the file (hd1,5)/grldr being on an extent too "high"

 

Please check the above.

 

For #1 which exact version of grub4dos/grldr are you using?

 

For #2 does:

find --set-root /grldr

root

actually work (and actually return (hd1,5))?

 

For #3 try issuing:

blocklist (hd1,5)/grldr

and report.

 

Besides the above, what do you have now in the (protective) MBR?

Ie. issue a 

cat --hex (hd1)0+1

and post screenshot.

 

Maybe UMBR wants a 00ed (exception made for the protective partition table entry and the Magic Bytes 55AA at the end, of course) MBR? 

Cannot say if the snippet in the Error output is the MBR "before" or "after" the test. :dubbio:

 

Wasn't your ESP partition (hd1,1)?

 

:duff:

Wonko



#23 doveman

doveman

    Frequent Member

  • Advanced user
  • 426 posts
  • Location:Surrey
  •  
    United Kingdom

Posted 2 weeks ago

Yeah the ESP partition is (hd1,1) but I'm going to put grldr and menu.lst on (hd1,5) first as it's easier to access. Once it's all working I might move them to (hd1,1).

 

#1 - grldr version is 0.4.5c, 265KB, 24 July 2013

 

#2 - find --set-root /grldr only returns (hd0,0) as it finds it on the USB stick first and stops there but find /grldr returns both (hd0,0) and (hd1,5)

 

#3 - blocklist (hd1,5)/grldr returns 1577000+532

 

cat --hex (hd1)0+1 result is shown in the attached screenshots.

 

Attached File  IMG_20181029_145504.jpg   186.73KB   0 downloads

 

Attached File  IMG_20181029_145520.jpg   179.79KB   0 downloads



#24 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 2 weeks ago

Hmmm. :dubbio:
Since the UMBR is January 2016, I would try a similarly dated grub4dos , i.e., namely, either:
http://grub4dos.chen....5c-2015-12-31/
or
http://grub4dos.chen....6a-2015-12-31/

But the issue seems different/wider, since you did provide p=1, it should have tried booting the ESP partition bootsector (that should have itself failed to boot reporting a missing BOOTMGR or a similar error) :unsure:.

Steve6375 does use UMBR in some of his tutorials, try checking it, maybe we are missing something or the UMBR recovered via Wayback Machine is not the "right" one:
https://sites.google...s/bios_gpt_boot

:duff:
Wonko




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users