You are not logged in.

#1 2012-09-02 04:24:18

zidarsk8
Member
Registered: 2011-12-06
Posts: 97

[SOLVED] UEFI: can't access EFI varialbes

Hi,

I have followed the instalation guide, and read all about UEFI, GRUB2 with UEFI. But when I try to run grub-install

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

I get,

Fatal: Couldn't open either sysfs or procfs directories for accessing EFI variables.

I have seen this post too that mentions booting up in UEFI mode, but I can't find any such options in my UEFI manager

http://superuser.com/questions/376470/h … -grub2-efi


The system specs:

motherboard: M5A99X
cpu: FX-8120
ram: 4 * 4GB

I have read that I should add boot flag to the UEFI partition, but I don't know how to do that in gdisk, so this is what I have so far:

/dev/sda #~3TB
sda1 - 1GB EF00 EFI System fat32
sda2 - 100MB 8300 ext2
sda3 - 3GB 8200 swap
sda4 - 50GB 8300 ext4 #root
sda5 - 2.7TB 8300 ext4 #home



I have tried everything I could find on the web, please help or help me find some new ideas. Thank you

PS: I can normally install ubuntu that uses grub2 so I know it should be possible and it doesn't even have the extra efi partition which is weird.

Last edited by zidarsk8 (2012-09-03 18:08:00)

Offline

#2 2012-09-02 04:37:39

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: [SOLVED] UEFI: can't access EFI varialbes

# modprobe efivars 

Does that work?  If not, you are not booted w/ UEFI.

Offline

#3 2012-09-02 04:43:26

JGunn88
Member
From: Gunn
Registered: 2012-06-27
Posts: 10

Re: [SOLVED] UEFI: can't access EFI varialbes

When your setting up Arch with a UEFI BIos motherboard its easier if you boot through the UEFI shell on a usb disk then through the install cd. It cleans up a lot of headaches. Read the post below to find out how.
https://bbs.archlinux.org/viewtopic.php?id=148155

Last edited by JGunn88 (2012-09-02 04:43:53)


Learning by jumping through fire instead of getting someone to put it out...its the Ach Way.

Offline

#4 2012-09-02 06:37:25

zidarsk8
Member
Registered: 2011-12-06
Posts: 97

Re: [SOLVED] UEFI: can't access EFI varialbes

So It would seem I wasn't booting with UEFI shell. But I have been trying that and i have no idea where to start.

I am folowing this
https://wiki.archlinux.org/index.php/UE … B_from_ISO

if i finish the Archiso section, i get into UEFI shell, but i don't know what to run, to boot from that usb.

I tried (am still trying) to go throuh Archboot section of that wiki page (just under Archiso), but I can't even seem to find "/tmp/archiso/boot/grub/grub_uefi_x86_64.bin" whick is the fist part I need to extract.

Any more tips guys? Thanks smile

Offline

#5 2012-09-02 07:27:46

JGunn88
Member
From: Gunn
Registered: 2012-06-27
Posts: 10

Re: [SOLVED] UEFI: can't access EFI varialbes

Download the Arch Image to a CD and boot from that?


Learning by jumping through fire instead of getting someone to put it out...its the Ach Way.

Offline

#6 2012-09-02 07:42:43

zidarsk8
Member
Registered: 2011-12-06
Posts: 97

Re: [SOLVED] UEFI: can't access EFI varialbes

I don't have a CD in my PC, and dding the image to an usb (which is basically the same as burning it to a cd) somehow doesn't work.

I can boot the image, but i can't boot it with UEFI (if this makes any sense)

Last edited by zidarsk8 (2012-09-02 07:43:21)

Offline

#7 2012-09-02 07:56:28

freddie
Member
Registered: 2010-10-02
Posts: 32

Re: [SOLVED] UEFI: can't access EFI varialbes

I did like this in my install.Press del to go to bios and mark uefi  look image number  4  >>  http://ubuntuforums.org/showthread.php?t=1958383
Then when you are in arch install promt  modprobe efivars.

Offline

#8 2012-09-02 08:15:56

zidarsk8
Member
Registered: 2011-12-06
Posts: 97

Re: [SOLVED] UEFI: can't access EFI varialbes

Hi freddie,

There is a step missing though.
1) If i dd archlinux iso image to the USB, then I don't have a uefi boot option.
2) if i put the uefi shell on my usb, then i don't know how to boot arch from there.

How can I make my archlinux bootable usb key to boot in UEFI mode?

Offline

#9 2012-09-02 08:22:41

freddie
Member
Registered: 2010-10-02
Posts: 32

Re: [SOLVED] UEFI: can't access EFI varialbes

Look att the notes in the link https://wiki.archlinux.org/index.php/UE … B_from_ISO

Note: dd'ing the ISO (isohybrid method) to the USB drive will not work for UEFI boot.

Offline

#10 2012-09-02 08:31:18

zidarsk8
Member
Registered: 2011-12-06
Posts: 97

Re: [SOLVED] UEFI: can't access EFI varialbes

And under that note there are two secions: Archiso and Archboot. I am assuming that those are instructions on how I can get a UEFI mode bottable archlinux usb, right?

but that brings us a few posts back to: https://bbs.archlinux.org/viewtopic.php … 4#p1155334

Where I said I am trying to boot into UEFI mode but that wiki pakge doesn't seem to work (or i might be missing something).

Offline

#11 2012-09-02 08:43:20

the.ridikulus.rat
Member
From: Indiana, USA
Registered: 2011-10-04
Posts: 765

Re: [SOLVED] UEFI: can't access EFI varialbes

zidarsk8 wrote:

So It would seem I wasn't booting with UEFI shell. But I have been trying that and i have no idea where to start.

I am folowing this
https://wiki.archlinux.org/index.php/UE … B_from_ISO

if i finish the Archiso section, i get into UEFI shell, but i don't know what to run, to boot from that usb.

I tried (am still trying) to go throuh Archboot section of that wiki page (just under Archiso), but I can't even seem to find "/tmp/archiso/boot/grub/grub_uefi_x86_64.bin" whick is the fist part I need to extract.

Any more tips guys? Thanks smile

Archiso is the official iso. Archboot is an unofficial iso maintained by tpowa (he's a dev). It uses its own setup script which is not based on AIF. More info at https://wiki.archlinux.org/index.php/Archboot .

Archboot was the first Arch Installer iso to get UEFI support (even before Archiso). That is the reason why Archboot related info is also listed in that page apart from Archiso.

Offline

#12 2012-09-02 08:56:02

the.ridikulus.rat
Member
From: Indiana, USA
Registered: 2011-10-04
Posts: 765

Re: [SOLVED] UEFI: can't access EFI varialbes

zidarsk8 wrote:

So It would seem I wasn't booting with UEFI shell. But I have been trying that and i have no idea where to start.

I am folowing this
https://wiki.archlinux.org/index.php/UE … B_from_ISO

if i finish the Archiso section, i get into UEFI shell, but i don't know what to run, to boot from that usb.

When the shell tell that it is starting "startup.nsh", do not disturb it. That script launches the archiso kernel in uefi mode.

If for any reason the UEFI shell does not launch startup.nsh, type (in the shell)

Shell > cd \EFI\boot
Shell > startup.nsh

I tried (am still trying) to go throuh Archboot section of that wiki page (just under Archiso), but I can't even seem to find "/tmp/archiso/boot/grub/grub_uefi_x86_64.bin" whick is the fist part I need to extract.

Minor typo mistake. It should have been "/tmp/archboot/boot/grub/grub_uefi_x86_64.bin" . I have corrected it in the wiki.

Last edited by the.ridikulus.rat (2012-09-02 08:57:46)

Offline

#13 2012-09-02 09:06:15

the.ridikulus.rat
Member
From: Indiana, USA
Registered: 2011-10-04
Posts: 765

Re: [SOLVED] UEFI: can't access EFI varialbes

zidarsk8 wrote:

Hi,

I have followed the instalation guide, and read all about UEFI, GRUB2 with UEFI. But when I try to run grub-install

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

I get,

Fatal: Couldn't open either sysfs or procfs directories for accessing EFI variables.

I have seen this post too that mentions booting up in UEFI mode, but I can't find any such options in my UEFI manager

That error is shown by efibootmgr. That error will go only if you "modprobe efivars" after booting in UEFI mode. To check whether you have booted correctly, check whether "/sys/firmware/efi/vars/" directory is non-empty. If that directory is empty or non existing even after loading efivars module, then you have not booted in UEFI mode.

I have read that I should add boot flag to the UEFI partition, but I don't know how to do that in gdisk, so this is what I have so far:

gdisk EF00 type code is same as "boot" flag in parted. Both change the partition type to "UEFI System". The "boot" flag is the terminology used by GNU Parted. whereas gdisk uses the correct terminology of partition type codes (in this case EF00).

/dev/sda #~3TB
sda1 - 1GB EF00 EFI System fat32
sda2 - 100MB 8300 ext2
sda3 - 3GB 8200 swap
sda4 - 50GB 8300 ext4 #root
sda5 - 2.7TB 8300 ext4 #home

Your /dev/sda1 is a valid EFI system partition (although 1 GB is bit too much, but not an issue). It already has EF00 gdisk type code set (no need to try boot flag in parted which does the exact same thing) and is formatted as FAT32 which is correct. Just mount /dev/sda1 at /boot/efi and then run grub-install command you tried before.

PS: I can normally install ubuntu that uses grub2 so I know it should be possible and it doesn't even have the extra efi partition which is weird.[/quote]

Ubuntu must have been installed in BIOS-MBR or BIOS-GPT mode. Just so you know, grub(2) is not the only UEFI bootloader available. Read https://wiki.archlinux.org/index.php/UEFI_Bootloaders for more info.

Offline

#14 2012-09-02 14:18:34

ewaves
Member
Registered: 2012-09-01
Posts: 38

Re: [SOLVED] UEFI: can't access EFI varialbes

the.ridikulus.rat wrote:
zidarsk8 wrote:

Hi,

I have followed the instalation guide, and read all about UEFI, GRUB2 with UEFI. But when I try to run grub-install

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

I get,

Fatal: Couldn't open either sysfs or procfs directories for accessing EFI variables.

I have seen this post too that mentions booting up in UEFI mode, but I can't find any such options in my UEFI manager

That error is shown by efibootmgr. That error will go only if you "modprobe efivars" after booting in UEFI mode. To check whether you have booted correctly, check whether "/sys/firmware/efi/vars/" directory is non-empty. If that directory is empty or non existing even after loading efivars module, then you have not booted in UEFI mode.

Hi! We are discussing the same problem here https://bbs.archlinux.org/viewtopic.php?id=148120.
That's seems to not be true for me, since i booted in UEFI mode for sure and "modprobe efivars" doesn't give errors. I'll check "/sys/firmware/efi/vars/" to be sure but there is too many people complaining this issue to be just human error IMHO.

EDIT: directory not empty sad

EDIT 2: I did "modprobe efivars" before chrooting and fallowed this https://wiki.archlinux.org/index.php/GR … _systems_2 instead of the beginners guide and something changed, but when i try to bless from osx to allow the disk to boot it says:

sudo bless --folder=/Volumes/efi --file=/Volumes/efi/efi/arch_grub/grubx64.efi --setBoot
Error while getting file ID of /Volumes/efi/efi/arch_grub/grubx64.efi. Ignoring...

sudo bless --mount=/Volumes/efi --file=/Volumes/efi/EFI/arch_grub/grubx64.efi --setBoot
Can't statfs /Volumes/efi/EFI/arch_grub/grubx64.efi

So there still is something wrong in grub installation I think...

EDIT 3: so sorry for all this edit. Just a stupid error, i didn't mount the efi partition before blessing. Now grub works (i can't believe it, it's been 4 days) but it cannot find my devices, it drops me to a recovery shell, where is the error?

EDIT 4: nevermind, i was booting via usb, i inserted the hd and GRUB is working!

Last edited by ewaves (2012-09-02 15:23:20)

Offline

#15 2012-09-02 20:00:07

zidarsk8
Member
Registered: 2011-12-06
Posts: 97

Re: [SOLVED] UEFI: can't access EFI varialbes

the.ridikulus.rat wrote:

Archiso is the official iso. Archboot is an unofficial iso maintained by tpowa (he's a dev). It uses its own setup script which is not based on AIF. More info at https://wiki.archlinux.org/index.php/Archboot .

Archboot was the first Arch Installer iso to get UEFI support (even before Archiso). That is the reason why Archboot related info is also listed in that page apart from Archiso.

Didn't know that, thanks. Also I've manadged to boot the archboot in UEFI mode, but i'm still having a few problems installing Arch from there.

Expanding the problem: I have quite a few 3TB disks and I want to install the system on a RAID array.

status:
archboot - can boot in uefi mode, can't install system on a raid array, instalation stops at pvcreate (to create a LVM on a raid array)
archiso - can't boot in uefi mode, but i can normally set up my raid array, instalation stops at efivars


I think that my best option would be to somehow boot archiso usb in uefi mode, but I have tried that a few times and failed. If i folow the instructions on wiki i just get to the efi shell


the.ridikulus.rat wrote:

When the shell tell that it is starting "startup.nsh", do not disturb it. That script launches the archiso kernel in uefi mode.

If for any reason the UEFI shell does not launch startup.nsh, type (in the shell)

Shell > cd \EFI\boot
Shell > startup.nsh

i don't press anything, but the startup.nsh doen't launch, for some reason cd \EFI\boot doens't work ether, and if i just run startup.nsh it doensn't work normally either.

edit:
booting from archiso in UEFI mode:

Shell > cd \EFI\boot
cd: Cannot find mapped device

just running "startup.nsh" works now. - previsouly i forgot to set the label for the fat partition!

I'll see if i can get anything to work now and i'll report back later

Last edited by zidarsk8 (2012-09-02 20:31:18)

Offline

#16 2012-09-03 18:07:33

zidarsk8
Member
Registered: 2011-12-06
Posts: 97

Re: [SOLVED] UEFI: can't access EFI varialbes

ok since booting archiso in uefi mode, things work normally.

Thanks everyoen who helped smile

Offline

#17 2012-09-05 01:40:24

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 5,661

Re: [SOLVED] UEFI: can't access EFI varialbes

The README on the iso itself has instructions which I found the most straightforward. Or you can download a copy of the README from the GIT repository. I'm not sure why, but the wiki instructions are not quite the same and did not seem quite so easy to follow.

Using the README instructions I found it fairly straightforward to create a UEFI bootable USB key but it would probably be nice if these were linked somewhere more obviously to give them more of a chance of being read before the key is created...


How To Ask Questions The Smart Way | Help Vampires

Arch Linux | x86_64 | GPT | EFI boot | grub2 | systemd | LVM2 on LUKS
Lenovo x121e | Intel(R) Core(TM) i3-2367M CPU @ 1.40GHz GenuineIntel | Intel Centrino Wireless-N 1000 | US keyboard with Euro | 320G 7200 RPM Seagate HDD

Offline

#18 2012-09-05 13:49:13

the.ridikulus.rat
Member
From: Indiana, USA
Registered: 2011-10-04
Posts: 765

Re: [SOLVED] UEFI: can't access EFI varialbes

zidarsk8 wrote:

I have quite a few 3TB disks and I want to install the system on a RAID array.

status:
archboot - can boot in uefi mode, can't install system on a raid array, instalation stops at pvcreate (to create a LVM on a raid array)

Can you try one of the iso at https://dev.archlinux.org/~tpowa/archboot-2012.08/ ? If the problem is not yet solved, report the exact issue, with logs if any, at https://bbs.archlinux.org/viewtopic.php?id=143541 . This will be helpful in fixing the problem before archboot 2012.09 iso is released.

Offline

#19 2012-09-09 10:30:25

dobie2564
Member
Registered: 2011-09-05
Posts: 13

Re: [SOLVED] UEFI: can't access EFI varialbes

This one threw me for a loop too. 

Even though I had successfully booted into UEFI mode the process for setting up boot would fail because there is some bug that keeps the EFI variables from being seen by the system until after the command "modprobe efivars" is entered.  And that is confusing as well because the command returns nothing.  Prior to issuing that command, efibootmgr will error out and there won't be a /sys/firmware/efi directory.  After issuing the command the directory shows up and efibootmgr works as described in the various wiki pages.   

Without the modprobe step, diagnosis would lead one to believe they were not in UEFI mode when in fact they are.  I believe it was also the reason the initial attempt I made to installe the EFI verision of grub failed.     After I figured this out it wasn't hard to setup a new system that I built yesterday to use rEFInd to directly boot the kernel via EFISTUB.  (I found it preferable to grub)   I'm blown away at how fast that will boot up the system. 

(One other note:  I found that if you follow the instructions to download Shell.efi so that you can boot into a UEFI Shell, it greatly helps with diagnosis.  When you are in the shell, you can directly boot  kernels and loaders from it's CLI)

Last edited by dobie2564 (2012-09-09 10:31:49)

Offline

#20 2012-09-11 14:07:35

the.ridikulus.rat
Member
From: Indiana, USA
Registered: 2011-10-04
Posts: 765

Re: [SOLVED] UEFI: can't access EFI varialbes

dobie2564 wrote:

This one threw me for a loop too. 

Even though I had successfully booted into UEFI mode the process for setting up boot would fail because there is some bug that keeps the EFI variables from being seen by the system until after the command "modprobe efivars" is entered.  And that is confusing as well because the command returns nothing.  Prior to issuing that command, efibootmgr will error out and there won't be a /sys/firmware/efi directory.  After issuing the command the directory shows up and efibootmgr works as described in the various wiki pages.   

Without the modprobe step, diagnosis would lead one to believe they were not in UEFI mode when in fact they are.  I believe it was also the reason the initial attempt I made to installe the EFI verision of grub failed.     After I figured this out it wasn't hard to setup a new system that I built yesterday to use rEFInd to directly boot the kernel via EFISTUB.  (I found it preferable to grub)   I'm blown away at how fast that will boot up the system. 

(One other note:  I found that if you follow the instructions to download Shell.efi so that you can boot into a UEFI Shell, it greatly helps with diagnosis.  When you are in the shell, you can directly boot  kernels and loaders from it's CLI)

This is not as bug. "efivars" kernel module is responsible for detecting and populating UEFI variables in /sys/firmware/efi/vars, which is used by efibootmgr to setup boot entries. This module is not loaded automatically by Archiso or Archboot. So to the actual indication that you have booted in UEFI mode is to load efivars and check for files in /sys/firmware/efi/vars.

Previously efivars used to give error somethign like "unknown device" when booted in BIOS mode. But recent kernels do not show such error. So efivars loads successfully even in bios mode (but obviously does nothing). Thats why we need to check /sys/firmware/efi/vars .

Offline

Board footer

Powered by FluxBB