Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[SOLVED] Installation fails at grub setup (UEFI)

Ask for help with issues regarding the Installations of the Debian O/S.
Post Reply
Message
Author
Gruik
Posts: 3
Joined: 2017-05-03 21:08

[SOLVED] Installation fails at grub setup (UEFI)

#1 Post by Gruik »

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.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Installation fails at grub setup (UEFI)

#2 Post by Head_on_a_Stick »

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.
deadbang

Gruik
Posts: 3
Joined: 2017-05-03 21:08

Re: Installation fails at grub setup (UEFI)

#3 Post by Gruik »

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

Dai_trying
Posts: 1100
Joined: 2016-01-07 12:25
Has thanked: 5 times
Been thanked: 16 times

Re: Installation fails at grub setup (UEFI)

#4 Post by Dai_trying »

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.

Gruik
Posts: 3
Joined: 2017-05-03 21:08

Re: Installation fails at grub setup (UEFI)

#5 Post by Gruik »

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

User avatar
phenest
Posts: 1702
Joined: 2010-03-09 09:38
Location: The Matrix

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

#6 Post by phenest »

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
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D

User avatar
phenest
Posts: 1702
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Installation fails at grub setup (UEFI)

#7 Post by phenest »

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.
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

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

#8 Post by Head_on_a_Stick »

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
deadbang

User avatar
phenest
Posts: 1702
Joined: 2010-03-09 09:38
Location: The Matrix

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

#9 Post by phenest »

Does that mean that Windows changes the boot order?
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D

Dai_trying
Posts: 1100
Joined: 2016-01-07 12:25
Has thanked: 5 times
Been thanked: 16 times

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

#10 Post by Dai_trying »

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.

User avatar
phenest
Posts: 1702
Joined: 2010-03-09 09:38
Location: The Matrix

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

#11 Post by phenest »

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.
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

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

#12 Post by Head_on_a_Stick »

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
deadbang

User avatar
phenest
Posts: 1702
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Installation fails at grub setup (UEFI)

#13 Post by phenest »

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?
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D

User avatar
jrv2kgt-s
Posts: 12
Joined: 2008-08-15 16:36
Location: New Orleans, LA

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

#14 Post by jrv2kgt-s »

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
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

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

#15 Post by Head_on_a_Stick »

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.
deadbang

Post Reply