[SOLVED] Installation fails at grub setup (UEFI)

Help with issues regarding installation of Debian

[SOLVED] Installation fails at grub setup (UEFI)

Postby Gruik » 2017-05-03 21:45

Hello

I'm trying to install Debian from a "net inst CD" on my laptop which has windows 10 pre-installed (i'd like to have the dual boot) and there is a fatal error on the grub step "update-grub failed". There is no more details in the log (Alt F4) other than that update-grub failed
Note that i tried both options about the choice "install grub in the removable device too" (which is asked when the system has an EFI partition)

About my partition setup :
/dev/sda is the storage HDD
/dev/sdb is the SSD which has the "EFI" (ESP) partition (i think it's /dev/sdb1 but not sure) ; i have put the debian root in /dev/sdb5

Then I tried to install grub manually from the rescue mode doing the following :
# mount /boot/efi
# grub-install /dev/sdb
# update-grub

grub-install seem to work (i think it works too in the installation program, it's only update-grub that fails) ; note that i had to mount /boot/efi to make it work in rescue mode (i saw that by googling the issue)
update-grub seem to work too except there is a shell script error at the end in file something like /etc/grub.d/30_xxx
So, i tried to tweak that script, so that there is no error (i make the condition that contains the error fail ; the outcome should be similar, without the error)
update-grub finishes without error

But it seems grub is still not installed because windows starts as usual

Any idea what's wrong ? Or is there a bug in the installation program ?
If there is no quick solution, i may forget the dual boot and erase windows
Thanks
Last edited by Gruik on 2017-05-04 15:56, edited 1 time in total.
Gruik
 
Posts: 3
Joined: 2017-05-03 21:08

Re: Installation fails at grub setup (UEFI)

Postby Head_on_a_Stick » 2017-05-04 05:57

From your Windows system, what is the full output of this command:
Code: Select all
bcdedit

If you can load a "live" ISO image in UEFI mode (the Debian stretch rc3 live images are UEFI-capable), then please also post the output of:
Code: Select all
# efibootmgr -v

That command will show the boot order, getting Debian to boot may be as simple as setting the boot entry first by using:
Code: Select all
# efibootmgr -o xxxx,yyyy,zzzz

Where xxxx is the boot number assigned to the Debian NVRAM entry.
“Controlling complexity is the essence of computer programming."Brian Kernighan

Please read before posting How to report a problem
User avatar
Head_on_a_Stick
 
Posts: 6491
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Installation fails at grub setup (UEFI)

Postby Gruik » 2017-05-04 08:53

Thanks for your answer

For the efibootmgr -v, there was actually debian, but not in the ordered list ; so i've put it before windows entry with the command efibootmgr -o as you said
But windows still starts directly

(Edit : actually, the boot order list printed by efibootmgr -v is reset when i restart the computer)

bcdedit
Code: Select all
Gestionnaire de démarrage Windows
---------------------------------
identificateur          {bootmgr}
device                  partition=\Device\HarddiskVolume2
path                    \EFI\Microsoft\Boot\bootmgfw.efi
description             Windows Boot Manager
locale                  fr-FR
inherit                 {globalsettings}
default                 {current}
resumeobject            {a4903af6-d2e3-11e6-bee8-a81e8433260c}
displayorder            {current}
toolsdisplayorder       {memdiag}
timeout                 30

Chargeur de démarrage Windows
-----------------------------
identificateur          {current}
device                  partition=C:
path                    \Windows\system32\winload.efi
description             Windows 10
locale                  fr-FR
inherit                 {bootloadersettings}
recoverysequence        {a4903af8-d2e3-11e6-bee8-a81e8433260c}
recoveryenabled         Yes
isolatedcontext         Yes
allowedinmemorysettings 0x15000075
osdevice                partition=C:
systemroot              \Windows
resumeobject            {a4903af6-d2e3-11e6-bee8-a81e8433260c}
nx                      OptIn
bootmenupolicy          Standard
Gruik
 
Posts: 3
Joined: 2017-05-03 21:08

Re: Installation fails at grub setup (UEFI)

Postby Dai_trying » 2017-05-04 10:34

Another way to change the boot order might be in the UEFI options, I use this in my Dell Inspiron 15 3552 laptop and it is very simple to move one item to the top of the list in the boot options.
Dai_trying
 
Posts: 287
Joined: 2016-01-07 12:25

Re: Installation fails at grub setup (UEFI)

Postby Gruik » 2017-05-04 15:55

I don't have such options in the bios, except the classic boot order..

Well, i gave up, here's what i did next (for information) :
- I installed Debian by erasing all the existing partitions (including windows) : same error (update-grub failed) ; I then tried to install grub manually as described before (without errors) and then, system didn't detect any bootable device
- I gave up UEFI and installed debian in legacy mode. It worked except my wifi card wasn't recognized (among other annoying hardware issues), even though i used the "net inst CD" containing the non-free "firmwares"
I think it was a mistake to choose stable Debian since the hardware is really recent i think
- So i switched to Ubuntu, in UEFI mode first. There was no error but after the install, no bootable device was detected too
- Then i installed Ubuntu in legacy mode, and no problem

Thanks for your attention
Gruik
 
Posts: 3
Joined: 2017-05-03 21:08

Re: [SOLVED] Installation fails at grub setup (UEFI)

Postby phenest » 2017-05-04 15:59

Gruik wrote:Then I tried to install grub manually from the rescue mode doing the following :
# mount /boot/efi
# grub-install /dev/sdb
# update-grub

This is incorrect for an GRUB EFI installation. It should be:
Code: Select all
mount /dev/sdb1 /boot/efi
apt-get install --reinstall grub-efi
grub-install /dev/sdb
NEC Spirit 550 P4 3.8GHz HT - 2GB RAM - nVidia 7600GT - Pioneer BDR-209DBK
ASUS Sabertooth P67 i7 3770K - 32GB RAM - 2x nVidia 660GTX SLI'd
User avatar
phenest
 
Posts: 1571
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Installation fails at grub setup (UEFI)

Postby phenest » 2017-05-04 16:06

Gruik wrote:Well, i gave up

Your post was less than 24hrs old and you gave up. Try to be more patient and allow members here to respond.
NEC Spirit 550 P4 3.8GHz HT - 2GB RAM - nVidia 7600GT - Pioneer BDR-209DBK
ASUS Sabertooth P67 i7 3770K - 32GB RAM - 2x nVidia 660GTX SLI'd
User avatar
phenest
 
Posts: 1571
Joined: 2010-03-09 09:38
Location: The Matrix

Re: [SOLVED] Installation fails at grub setup (UEFI)

Postby Head_on_a_Stick » 2017-05-05 06:00

For any others who may have this problem, here is the solution:

Run this command from a Windows Administrator prompt:
Code: Select all
bcdedit /set "{bootmgr}" path "\EFI\debian\grubx64.efi"

This will set GRUB as the default .efi bootloader for the Windows system :)

Unfortunately, this change will be reverted after each major update of Windows :(

To solve this, a custom startup service that runs the `bcdedit` command at every boot must be created using the Windows Task Scheduler, details here:

https://forums.bunsenlabs.org/viewtopic.php?id=3624
“Controlling complexity is the essence of computer programming."Brian Kernighan

Please read before posting How to report a problem
User avatar
Head_on_a_Stick
 
Posts: 6491
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: [SOLVED] Installation fails at grub setup (UEFI)

Postby phenest » 2017-05-05 16:53

Does that mean that Windows changes the boot order?
NEC Spirit 550 P4 3.8GHz HT - 2GB RAM - nVidia 7600GT - Pioneer BDR-209DBK
ASUS Sabertooth P67 i7 3770K - 32GB RAM - 2x nVidia 660GTX SLI'd
User avatar
phenest
 
Posts: 1571
Joined: 2010-03-09 09:38
Location: The Matrix

Re: [SOLVED] Installation fails at grub setup (UEFI)

Postby Dai_trying » 2017-05-05 18:52

My guess would be that it simply puts itself at the top of the list the same as when I've installed a UEFI Linux distro, that too puts itself as first boot option.
Dai_trying
 
Posts: 287
Joined: 2016-01-07 12:25

Re: [SOLVED] Installation fails at grub setup (UEFI)

Postby phenest » 2017-05-05 20:50

Perhaps it's the EFI boot manager that does that. As each OS entry is added or modified/replaced, the boot manager places it as the first boot option. Either way, it's worth noting.
NEC Spirit 550 P4 3.8GHz HT - 2GB RAM - nVidia 7600GT - Pioneer BDR-209DBK
ASUS Sabertooth P67 i7 3770K - 32GB RAM - 2x nVidia 660GTX SLI'd
User avatar
phenest
 
Posts: 1571
Joined: 2010-03-09 09:38
Location: The Matrix

Re: [SOLVED] Installation fails at grub setup (UEFI)

Postby Head_on_a_Stick » 2017-05-06 08:57

phenest wrote:Does that mean that Windows changes the boot order?

Yes, Windows will reset itself as first in the UEFI boot order after every major update.

The OP's problem is because of a faulty firmware ("BIOS") implementation that will only boot Microsoft's .efi bootloader rather than the specified $ESP/EFI/BOOT/BOOT{IA32,X64}.EFI

For any users with an afflicted motherboard who are not dual-booting with Windows, GRUB's .efi bootloader can be renamed to get it working:
Code: Select all
# mount /dev/sdXY /mnt # replace XY with the letter & number assigned to the EFI system partition
# mkdir -p /mnt/EFI/Microsoft/Boot
# cp /mnt/EFI/debian/grubx64.efi /mnt/EFI/Microsoft/Boot/bootmgfw.efi
# umount -R /mnt
“Controlling complexity is the essence of computer programming."Brian Kernighan

Please read before posting How to report a problem
User avatar
Head_on_a_Stick
 
Posts: 6491
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Installation fails at grub setup (UEFI)

Postby phenest » 2017-05-06 09:05

Gruik wrote:- Then i installed Ubuntu in legacy mode, and no problem

Does Windows boot though? As it was installed via EFI, can methods be mixed?
NEC Spirit 550 P4 3.8GHz HT - 2GB RAM - nVidia 7600GT - Pioneer BDR-209DBK
ASUS Sabertooth P67 i7 3770K - 32GB RAM - 2x nVidia 660GTX SLI'd
User avatar
phenest
 
Posts: 1571
Joined: 2010-03-09 09:38
Location: The Matrix

Re: [SOLVED] Installation fails at grub setup (UEFI)

Postby jrv2kgt-s » 2017-05-17 02:09

I'm having similar issues as noted by the original poster on a new HP laptop (AMD A10-9800P). So far I have been able to complete the network install using the 8.8.0 build but for some reason grub reports that it failed to install properly. Although when I check the UEFI BIOS boot manager listings, it lists both windows and Debian as viable options. After I select the Debian option, the text grub menu loads up but there are no entries present.

I've tried using the various Sid live iso images in an effort to update grub but to no avail. The live images will boot but to a blank screen (X11 or weyland fails to load properly). I tried using “control + alt + F2 or F3 to reach a console but to no avail as well. I was going to try a debian 8 live image but as I reading elsewhere I learned that the image does not allow you to update grub.

Being that I have access to a blank grub menu, would it be possible for me to boot Debian manually and update grub from there? Thanks in advance for any help you may provide!
: : Running :: Jessie : :
: : Desktop Environment :: XFCE : :
User avatar
jrv2kgt-s
 
Posts: 12
Joined: 2008-08-15 16:36
Location: New Orleans, LA

Re: [SOLVED] Installation fails at grub setup (UEFI)

Postby Head_on_a_Stick » 2017-05-17 06:24

jrv2kgt-s wrote:grub reports that it failed to install properly

You need to post the *exact* error message, a vague description is useless.

Please open a new thread for your problem and link back to this one if needed.
“Controlling complexity is the essence of computer programming."Brian Kernighan

Please read before posting How to report a problem
User avatar
Head_on_a_Stick
 
Posts: 6491
Joined: 2014-06-01 17:46
Location: /dev/chair


Return to Installation

Who is online

Users browsing this forum: No registered users and 8 guests

fashionable