You are not logged in.

#1 2013-12-03 18:50:49

grydz
Member
Registered: 2013-12-03
Posts: 7

Grub2 does not boot with EFI

Hi,

I have a Sony Vaio pro 13 with H20 Bios and I want to install arch with UEFI. I inform that there is no more Windows on the hard drive and no more entry in UEFI shell.

The install works perfectly with no error. I just follow the wiki. My first partition /dev/sda1 (/boot) is an EFI partition (ef00), /dev/sda2 is a swap partiton and /dev/sda3 my root partition.

I am aware that I need to add

libata.force=noncq

in the file /etc/default/grub and I did it before

# grub-mkconfig -o /boot/grub/grub.cfg

The problem seems to be in the read of

/boot/EFI/arch_grub/grubx64.efi

in [1], [2], it seems that the path of .efi file is hard coded so I tried

# mkdir /boot/EFI/Boot
# cp /boot/EFI/arch_grub/grubx64.efi /boot/EFI/Boot/bootx64.efi

and

# efibootmgr -c -d /dev/sda -p 1 -l /EFI/Boot/bootx64.efi -L "arch (grub2)"

but it also doesn't work : no grub when I reboot without the USB key.

The weird thing is that when I run efibootmgr before reboot I got

BootCurrent: 0001
Timeout: 0 seconds
BootOrder: 0000, 0001
Boot0001* UEFI: USB DISK Pro PMAP
Boot0000* arch (grub)

and when I re-mount the system with the USB key, "arch (grub)" has disappeared.

Does someone see anything wrong? Thanks!

[1] http://svparch.blogspot.fr/2013/09/arch … -vaio.html
[2] http://www.linuxquestions.org/questions … 175411129/

Last edited by grydz (2013-12-03 18:56:57)

Offline

#2 2013-12-03 20:49:41

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: Grub2 does not boot with EFI

Welcome to Arch.

You need to run grub-install.

Last edited by cfr (2013-12-03 20:50:12)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#3 2013-12-03 21:07:19

grydz
Member
Registered: 2013-12-03
Posts: 7

Re: Grub2 does not boot with EFI

I ran grub-install several times without errors.

As I said, I followed exactly the guide. This is not my first install of arch except with UEFI smile

I have more information now :

With the USB key, I booted to UEFI Shell x86_64 v2, then I can see the mapping table

FS0:
BLK0:
BLK2:
BLK3:

fs0 is the USB key and when I type

# fs0:
# ls

I can see directories : EFI and loader. These directories are those of the USB key.

But when I move to

# blk0:
or
# blk2:
or
# blk3:

there is nothing when I type "ls".

My purpose was to add manually the .efi file

# bcfg boot add 0 blkX:\EFI\arch_grub\grubx64.efi "arch"
or
# bcfg boot add 0 blkX:\EFI\Boot\bootx64.efi "arch"

but I can't because it seems that my /boot partition is not recognised...

Last edited by grydz (2013-12-03 21:08:18)

Offline

#4 2013-12-03 21:19:01

grydz
Member
Registered: 2013-12-03
Posts: 7

Re: Grub2 does not boot with EFI

Maybe it can be useful

# parted /dev/sda print
Parition Table: gpt  
Disk Flags:
Number Start End Size File system Name Flags
1  1049kB  538MB  537MB  fat32  EFI  boot
2  -----  -----  -----  linux-swap(v1)   Swap
3  -----  ----- -----  ext4 Root

Don't worry "-----" is not what is printed on the screen, it's just laziness big_smile

Last edited by grydz (2013-12-03 21:23:48)

Offline

#5 2013-12-04 03:23:06

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: Grub2 does not boot with EFI

If grub-install ran correctly without errors, you should already have an EFI boot menu entry as it adds it automatically. You didn't mention running this before and you still haven't said which command you used exactly.

The path of the .efi is not typically hard-coded but there is a fallback position which firmware tends to use if it can't find anything properly configured to boot. That would be at /EFI/boot/bootx64.efi relative to your EFI partition. So if you mount your ESP at /boot, it would be at /boot/EFI/boot/bootx64.efi but if you mount it at /boot/efi, say, it would be at /boot/efi/EFI/boot/bootx64.efi.

What is the output of gdisk -l /dev/sdX for you disk?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#6 2013-12-04 10:47:55

grydz
Member
Registered: 2013-12-03
Posts: 7

Re: Grub2 does not boot with EFI

Ok sorry I forgot to post my grub-install command

grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=arch_grub --recheck --debug /dev/sda

I always use /boot as ESP.

Offline

#7 2013-12-04 22:03:53

grydz
Member
Registered: 2013-12-03
Posts: 7

Re: Grub2 does not boot with EFI

Ok I tried something which worked to boot arch :

I had an image of the whole system before erasing everything then I just copied it to my hard drive.

The partitions in the factory-state looks like that

/dev/sda1 -> GPT hidden parition
/dev/sda2 -> Sony recovery
/dev/sda3 -> GPT partition for windows (boot)
/dev/sda4 -> Windows
/dev/sda5 -> Windows

Then I did my arch install with erasing only the last partitions /dev/sda4 and /dev/sda5. A swap partition on /dev/sda4 and my root partition on /dev/sda5.

Then as always everything works fine without errors but at the end I can't boot on /EFI/arch_grub/grubx64.efi hence I tried something in UEFI shell :

I can see both GPT partition this time and I can read EFI directories on each. I see the path to .efi on /dev/sda3 (the partition with the boot flag not the hidden one)

/EFI/Microsoft/Boot/bootmgfw.efi

The first time I tried to add an entry with bcfg to /EFI/arch_grub/grubx64.efi and to /EFI/Boot/bootx64.efi which worked at first sight but when I rebooted the entry disappeared. Then I tried this

cp EFI/arch_grub/grubx64.efi /EFI/Microsoft/Boot/bootmgfw.efi

and of course it worked.

I am not really happy with this issue I would like to understand why I can't use my own EFI parition and why I can't add any entry using bcfg or efibootmgr.

Last edited by grydz (2013-12-04 22:04:35)

Offline

#8 2013-12-05 00:02:53

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: Grub2 does not boot with EFI

It really sounds like buggy firmware. Have you checked if there are any updates available?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#9 2013-12-09 20:04:35

grydz
Member
Registered: 2013-12-03
Posts: 7

Re: Grub2 does not boot with EFI

You're probably right, I will check that but I need to subscribe on sony's website...

Offline

#10 2013-12-23 03:52:53

badhat
Member
Registered: 2011-01-30
Posts: 112

Re: Grub2 does not boot with EFI

I see a similar issue on my system -- GRUB2 seems unrelated.
I'm running an ASUS F1A75-M and trying to write rEFInd as my EFI bootloader. Creating the entry/delelting old entries with efibootmgr appears to work from the booted system but when I reboot the entries have not been created. The system had been working with EFI before, so I am not sure what is happening. I did already try upgrading to the latest firmware and cleared my CMOS. No help yet.

Offline

#11 2013-12-23 04:51:22

subverted
Member
Registered: 2013-12-23
Posts: 31

Re: Grub2 does not boot with EFI

im having this same exact problem! only problem is, i formatted my windows partition (cuz i flippin hate windows 8) so i cant do that little copy paste trick you did sad

Offline

#12 2013-12-23 05:20:20

badhat
Member
Registered: 2011-01-30
Posts: 112

Re: Grub2 does not boot with EFI

I used a liveCD of the latest Ubuntu. Just get to the desktop, update the repos, install efibootmgr, and then use it to mark your *.efi file as bootable for the firmware. I was able to do so with rEFInd (the GNU version... haven't tried the version built with the TianoCore toolchain, though I can test that and post back unless someone beats me to it... quite busy still not having done any christmas shopping!

Offline

#13 2013-12-23 19:25:20

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: Grub2 does not boot with EFI

badhat wrote:

I'm running an ASUS F1A75-M and trying to write rEFInd as my EFI bootloader. Creating the entry/delelting old entries with efibootmgr appears to work from the booted system but when I reboot the entries have not been created.

My usual approach to this problem is to try another program for registering the boot manager/loader. The "bcfg" program in the EFI (version 2) shell usually works, as documented on the Arch wiki:

https://wiki.archlinux.org/index.php/Un … rface#bcfg

You could also use "bcdedit" in Windows, as documented in the rEFInd documentation:

http://www.rodsbooks.com/refind/installing.html#windows

If that fails, chances are you've got a defective EFI that ignores the NVRAM boot entries, at least under some circumstances. In that case, you must use an alternative naming scheme for your boot loader/manager:

http://www.rodsbooks.com/refind/installing.html#naming

Offline

#14 2014-01-05 16:44:15

badhat
Member
Registered: 2011-01-30
Posts: 112

Re: Grub2 does not boot with EFI

Thank you for those suggestions. In my case the link to the UEFI shell and instructions for bcfg in the wiki did not stick, either. I did not try bcedit because I do not own a copy of Windows at this time.
Strangely, the alternate name of 'EFI/BOOT/bootx64.efi' was unnecessary because the liveCD of Ubuntu worked without issue using efibootmgr. I'm curious if it has anything to do with https://wiki.archlinux.org/index.php/Un … fs-efivars

The arch install image used to work just fine for my systems, though UEFI itself has always felt a little flaky.

Offline

Board footer

Powered by FluxBB