You are not logged in.

#1 2013-01-24 06:46:37

dusktreader
Member
Registered: 2013-01-22
Posts: 9

[solved] rEFInd not detected at boot without USB rEFInd/archiso

I've been struggling through setting up a new Arch install using UEFI.

My system is an Acer Aspire notebook.  I have managed to setup and use (quite nicely, I might add) a USB archiso image that is booted with an instance of rEFInd that is on the USB flash drive.  Booting from there, I was able to install Arch onto my hard disk without much problems.  The issue I am having now is getting my computer to see an instance of rEFInd that I installed to an EFI enabled FAT32 partition on my notebook's hard disk.

When I boot with the USB drive in place, I see an option to boot the Archiso image.  But there is also an option to boot the Arch image install that I set up.  When I select the Arch installation on the hard disk, it boots no problem, and I can verify that I am indeed loaded into the local install on the HDD.

When I remove the flash drive, however, my computer simply shows "Operating System Not Found"  I feel like I am so close, but I must be missing something.

Some system information:

Partition scheme looks like this:

/dev/sda1 -> FAT32, 1GB
/dev/sda2 -> swap, 1GB
/dev/sda3 -> ext4, 20GB
/dev/sda4 -> ext4, ~400GB

After setting up Arch on the system, stuff looks like this:

/dev/sda3 is /
/dev/sda4 mounted at /home
/dev/sda1 mounted at /boot

The boot partition is laid out as follows

boot/
 |- EFI/
     |- refind_x64.efi
     |
     |- arch/
     |   |- vmlinuz-linux
     |   |- initramfs-linux.img
     |   |- refind_linux.conf
     |
     |- refind/
         |- refind.conf
         |
         |- icons/
         |- docs/

refind_linux.conf looks like:

"Boot with defaults" "root=PARTUUID=<my_root_partitions_uuid> rootfstype=ext4 ro add_efi_memmap systemd.unit=graphical.target"
"Boot to terminal"   "root=PARTUUID=<my_root_partitions_uuid> rootfstype=ext4 ro add_efi_memmap systemd.unit=multi-user.target"

And my setup in refind.conf looks like:

menuentry Arch {
    loader /EFI/arch/vmlinuz-linux
    loader /EFI/arch/initramfs-linux.img
    ostype Linux
    icon /EFI/refind/icons/os_linux.icns
}

Can anyone tell me why this is behaving like this?

Last edited by dusktreader (2013-01-25 08:03:53)

Offline

#2 2013-01-24 09:46:18

swordfish
Member
Registered: 2012-01-14
Posts: 160

Re: [solved] rEFInd not detected at boot without USB rEFInd/archiso

Hm, your setup is a little bit different from the advise given in the wiki. Maybe it's a good idea to check this.

Another point: Did you use efibootmgr to create an entry for rEFInd?

I mean, did you do something like this:

# modprobe efivars
# efibootmgr -c -g -d /dev/sda -p 1 -w -L "rEFInd" -l '\EFI\refindx_64.efi'


Arch_x64 on Thinkpad Edge E520 (Intel Core i5, 4 GB RAM, 128 GB Crucial M4 SSD) + ITX-Desktop (Asrock H77M-ITX, Intel Core i3-2120T, 8GB RAM, 64 GB Samsung 830 SSD)

Offline

#3 2013-01-24 18:33:28

dusktreader
Member
Registered: 2013-01-22
Posts: 9

Re: [solved] rEFInd not detected at boot without USB rEFInd/archiso

swordfish wrote:

Hm, your setup is a little bit different from the advise given in the wiki. Maybe it's a good idea to check this.

I worked through the wiki rather extensively, and tried a setup exactly as it described.  However, with the setup described in the wiki, my system wouldn't launch the HDD instance of Arch at all.  So, I used the information in the wiki along with information from the rEFInd homepage regarding booting linux with rEFInd.  This allowed me to put together a configuration that boots my Arch install.

swordfish wrote:

Another point: Did you use efibootmgr to create an entry for rEFInd?

I did try this, but it didn't seem to do anything but "create an entry" on my USB rEFInd configuration which was less than desirable.  After that incidence, I started over with the rEFInd setup and ended up with the configuration I now have.  By the way, when the wiki says "create an entry", what is it specifically referencing?  I assume that it means creating entries in the boot manager's configuration files.  I may be wrong on that, but I don't think so.  I set up my configuration manually in refind.conf.


I've become convinced that my problem is stemming from using a GPT partition table on my hard disk that my UEFI firmware flatly refuses to recognize.  I really don't want to start over with MBR since I have a system that is a hair's breadth away from working, but I may have to do that.

By the way, my system's UEFI firmware is Phoenix Secure Core Tiano.  Right now, it shows a very, very sparse bios-like menu for setup, and about the only meaningful setting that I can change are the boot order for disks (i.e. USB HDD, USB FDD, HDD, CD, etc).  I have twiddled those settings quite a bit as well.

Any ideas?

Offline

#4 2013-01-24 20:49:08

Bluerider
Member
Registered: 2012-07-22
Posts: 96

Re: [solved] rEFInd not detected at boot without USB rEFInd/archiso

Are you trying to boot with arch linux with a usb stick containing refind?

If refind has been installed in the UEFISYS partition (/boot/efi/), then you need to inform your efibootmgr that refind is a valid efi application to boot. That's what "creating an entry" means.

If you would like to boot up arch linux (in which the kernel stub has been placed in /boot/efi/EFI/arch) you need to place the "refind_linux.conf" in that directory.

The refind_linux.conf you posted is clearly wrong, you need to replace "<my_root_partitions_uuid>" with your actual root partition's uuid.

You do not need to add an entry in refind.conf to boot arch linux (or any other distribution). If you properly formatted your "/boot/efi/EFI/arch/refind_linux.conf" refind should automatically detect arch linux and boot it.

Offline

#5 2013-01-24 20:51:54

Bluerider
Member
Registered: 2012-07-22
Posts: 96

Re: [solved] rEFInd not detected at boot without USB rEFInd/archiso

If you do not know your root partition's UUID, you can replace it with the partition # of your root (ie. /dev/sda3).
You would enter "root=/dev/sda3" instead of "root=PARTUUID=<my_root_partitions_uuid>"

Offline

#6 2013-01-24 21:07:00

Bluerider
Member
Registered: 2012-07-22
Posts: 96

Re: [solved] rEFInd not detected at boot without USB rEFInd/archiso

Please move "/boot/efi/EFI/refind_x64.efi" to "/boot/efi/EFI/refind/refind_x64.efi".
Then run efibootmgr :

# efibootmgr -c -g -d /dev/sdX -p Y -w -L "rEFInd" -l '\EFI\refind\refind_x64.efi' 

where if your efi partition is /dev/sda2; it would be

# efibootmgr -c -g -d /dev/sda -p 2 -w -L "rEFInd" -l '\EFI\refind\refind_x64.efi']

Note. Your efi application would have to be named "refind_x64.efi" and located in "/boot/efi/EFI/refind" in the example.

Offline

#7 2013-01-24 21:12:57

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

Re: [solved] rEFInd not detected at boot without USB rEFInd/archiso

dusktreader wrote:

The boot partition is laid out as follows

boot/
 |- EFI/
     |- refind_x64.efi
     |
     |- arch/
     |   |- vmlinuz-linux
     |   |- initramfs-linux.img
     |   |- refind_linux.conf
     |
     |- refind/
         |- refind.conf
         |
         |- icons/
         |- docs/

With the ESP mounted at /boot, the rEFInd binary should not be /boot/EFI/refind_x64.efi; it should be /boot/EFI/refind/refind_x64.efi, in the same directory with its configuration file and icons subdirectory.

refind_linux.conf looks like:

"Boot with defaults" "root=PARTUUID=<my_root_partitions_uuid> rootfstype=ext4 ro add_efi_memmap systemd.unit=graphical.target"
"Boot to terminal"   "root=PARTUUID=<my_root_partitions_uuid> rootfstype=ext4 ro add_efi_memmap systemd.unit=multi-user.target"

As others have said, you should have your root partition's actual UUID, not "<my_root_partitions_uuid>", as a kernel option. This isn't the cause of your current problem, but if that's how you've got it set up, it's likely to cause problems once you fix your current problem. Be aware that partition UUIDs aren't particularly sensitive, so if you've replaced the actual UUID with "<my_root_partitions_uuid>" to avoid posting that information, you've wasted some effort.

And my setup in refind.conf looks like:

menuentry Arch {
    loader /EFI/arch/vmlinuz-linux
    loader /EFI/arch/initramfs-linux.img
    ostype Linux
    icon /EFI/refind/icons/os_linux.icns
}

That's going to be redundant with the refind_linux.conf file, assuming you have other default refind.conf entries. (If you've excised all the standard refind.conf entries, though, it won't scan for Linux kernels without .efi extensions, so you'd need this entry or a scan_all_linux_kernels line.)

As others have said, you do need to register rEFInd (or any other boot loader you use) with your firmware by using efibootmgr (or bcfg in an EFI shell, or some other tool in another OS). Alternatively, if no other boot loaders are registered, you can rename /boot/EFI/refind to /boot/EFI/BOOT and rename the rEFInd binary within that directory from refind_x64.efi to bootx64.efi. This will cause rEFInd to launch as the fallback boot loader -- but if you subsequently install any other boot loader, it will likely take precedence.

Offline

#8 2013-01-24 21:23:15

dusktreader
Member
Registered: 2013-01-22
Posts: 9

Re: [solved] rEFInd not detected at boot without USB rEFInd/archiso

Bluerider wrote:

If you do not know your root partition's UUID, you can replace it with the partition # of your root (ie. /dev/sda3).
You would enter "root=/dev/sda3" instead of "root=PARTUUID=<my_root_partitions_uuid>"

<facepalm>

The config file doesn't actually have "<my_root_partitions_uuid>".  As that file is on my notebook and I couldn't copy-paste it, I thought I would spare myself the annoyance of retyping it on this forum.

For anyone else chiming in, have no worries, I put my actual root partition's UUID there...

Offline

#9 2013-01-24 21:24:29

dusktreader
Member
Registered: 2013-01-22
Posts: 9

Re: [solved] rEFInd not detected at boot without USB rEFInd/archiso

Bluerider wrote:

Are you trying to boot with arch linux with a usb stick containing refind?

No, as I said, I can do that now.  I want to be able to boot from the refind instance installed on the boot partition of my notebooks HDD

Offline

#10 2013-01-24 21:26:01

Bluerider
Member
Registered: 2012-07-22
Posts: 96

Re: [solved] rEFInd not detected at boot without USB rEFInd/archiso

Alternatively, you can use the script listed in the wiki : rEFInd : Systemd Automation
The script needs to be run as root, or with sudo privileges.

First you need to install refind-efi

Then you will need to make some edits in the script on the wiki: you need to replace

 declare -r esp=$(mount -l | awk '/ESP/ {print $1}')

with

 declare -r esp=/dev/sda2

if your EFI partition is "/dev/sda2".

If the script was successful it shouldn't report anything with the word "fail" in it.

Copy your "refind.conf" to "/boot/efi/EFI/refind/refind.conf". After this, refind should at least boot.

Then set up your "refind_linux.conf" in "/boot/efi/EFI/arch/refind_linux.conf" accordingly.

Last edited by Bluerider (2013-01-24 21:28:17)

Offline

#11 2013-01-24 21:31:09

dusktreader
Member
Registered: 2013-01-22
Posts: 9

Re: [solved] rEFInd not detected at boot without USB rEFInd/archiso

srs5694 wrote:

With the ESP mounted at /boot, the rEFInd binary should not be /boot/EFI/refind_x64.efi; it should be /boot/EFI/refind/refind_x64.efi, in the same directory with its configuration file and icons subdirectory.

I will try this.  I thought it wouldn't really matter because my firmware would scan the whole EFI partition for efi binaries.  This makes sense, though.  I will try it tonight.

srs5694 wrote:

That's going to be redundant with the refind_linux.conf file, assuming you have other default refind.conf entries. (If you've excised all the standard refind.conf entries, though, it won't scan for Linux kernels without .efi extensions, so you'd need this entry or a scan_all_linux_kernels line.)

Ok, good to know about the redundancy.  I will adjust that.  FYI, scan_all_linux_kernels is default now in rEFInd.

srs5694 wrote:

As others have said, you do need to register rEFInd (or any other boot loader you use) with your firmware by using efibootmgr (or bcfg in an EFI shell, or some other tool in another OS).

I will try this again.  It didn't seem to work the first time around.  In particular, modprobe efivars doesn't appear to do anything even when I run modprobe in verbose mode.  I found that worrisome.

I will update the thread tonight after I try some of these suggestions.  Thanks for taking the time

Offline

#12 2013-01-24 21:33:55

dusktreader
Member
Registered: 2013-01-22
Posts: 9

Re: [solved] rEFInd not detected at boot without USB rEFInd/archiso

Bluerider wrote:

Alternatively, you can use the script listed in the wiki : rEFInd : Systemd Automation
The script needs to be run as root, or with sudo privileges.

First you need to install refind-efi

Then you will need to make some edits in the script on the wiki: you need to replace

 declare -r esp=$(mount -l | awk '/ESP/ {print $1}')

with

 declare -r esp=/dev/sda2

if your EFI partition is "/dev/sda2".

If the script was successful it shouldn't report anything with the word "fail" in it.

Copy your "refind.conf" to "/boot/efi/EFI/refind/refind.conf". After this, refind should at least boot.

Then set up your "refind_linux.conf" in "/boot/efi/EFI/arch/refind_linux.conf" accordingly.


I'd prefer to avoid this method at this point.

By the way, I have found it poor practice in the past to use /dev paths in configuration files (like fstab for example) because they tend to be dynamic and will break your setup if your system decides to switch /dev locations for your disk.  For example, in consecutive boots I have had my HDD show up at /dev/sda and /dev/sdb respectively.  UUID's are, in my opinion, always the way to go here.

Offline

#13 2013-01-24 21:39:28

Bluerider
Member
Registered: 2012-07-22
Posts: 96

Re: [solved] rEFInd not detected at boot without USB rEFInd/archiso

I have not seen an option in efibootmgr that allows selecting UUID, if you know, please do tell so I can update the script.

Also, the script doesn't require systemd. Just save the script and execute it.

The systemd section basically calls the script every time refind-efi package is updated. It is the result of a bug filed with refind.

Last edited by Bluerider (2013-01-24 21:41:01)

Offline

#14 2013-01-25 02:30:13

dusktreader
Member
Registered: 2013-01-22
Posts: 9

Re: [solved] rEFInd not detected at boot without USB rEFInd/archiso

I tried adding an entry for refind using:

root@archiso ~ # modprobe efivars
root@archiso ~ # efibootmgr -cgw -d/dev/sda -p1 -L"rEFInd" -l"\EFI\refind\refind_x64.efi"

But it failed with the following message

Fatal: Couldn't open either sysfs or procfs directories for accessing EFI variables
Try 'modprobe efivars' as root.

I'm wondering if this is because, although I'm chrooted to my arch install, I'm still running archiso.

Next, I'm going to use refind on my USB drive to boot to the Arch install on my HDD and try registering refind with the efibootmgr again.

Offline

#15 2013-01-25 02:37:36

dusktreader
Member
Registered: 2013-01-22
Posts: 9

Re: [solved] rEFInd not detected at boot without USB rEFInd/archiso

SUCCESS!!!

I'm booting to my new Arch install using rEFInd bootloader!

Thanks so much for your help!

I plan to write up the whole procedure I went through to install Arch on a UEFI system from making an Archiso USB image to logging into new install for the first time.  When I'm done, I'll post the link.

I've learned an incredible amount of information about UEFI, file systems, and bootloaders in the last week, and I'd love to share this with others going through similar struggles.

Offline

#16 2013-01-25 03:13:46

Bluerider
Member
Registered: 2012-07-22
Posts: 96

Re: [solved] rEFInd not detected at boot without USB rEFInd/archiso

Well mark the topic as solved then. I'm also interested as to what kind of arch boot iso you used.

Offline

#17 2013-02-07 19:29:11

dusktreader
Member
Registered: 2013-01-22
Posts: 9

Re: [solved] rEFInd not detected at boot without USB rEFInd/archiso

Here's the document I've been working on describing my efforts.  It still needs more polish and a bit more information, but it's on its way.

https://docs.google.com/document/d/1pvg … kmn9I/edit

Offline

Board footer

Powered by FluxBB