New EFI boot manager available: rEFInd

Chat about anything related to Linux Mint
Forum rules
Do not post support questions here. Before you post read the forum rules. Topics in this forum are automatically closed 6 months after creation.
Locked
srs5694
Level 6
Level 6
Posts: 1386
Joined: Mon Feb 27, 2012 1:42 pm

Re: New EFI boot manager available: rEFInd

Post by srs5694 »

YeeP wrote:Based on a previous post by you;
In a multi-Linux installation, you're likely to want a /boot/refind_linux.conf file for each distribution, so you'll need to generate this manually or run the mkrlconf.sh script for the second distribution.
I would guess that the steps in a simple description would be something like this

1) install first distro
2) reboot in CSM mode, install refind
3) reboot in EFI and check to make sure all is working, fix what is needed.
4) boot from live disc for distro #2 and install.
5) reboot distro 2, or just run the mkrlconf.sh script after install?
6) once script is complete make sure refind_linux.conf file is in the root of the boot folder, on ESP partition.
7) reboot in EFI mode and check rEFInd menu for additional distro
No; that's got a few errors. There are multiple ways to do it, but one would be:
  1. Install first distribution in EFI mode.
  2. In first distribution, install rEFInd. This will set rEFInd as the default boot loader and create a /boot/refind_linux.conf file for it.
  3. Install second distribution in EFI mode. This will result in that distribution's EFI boot loader becoming the default.
  4. Boot to second distribution.
  5. Re-install rEFInd in the second distribution. This will reset rEFInd as the primary boot loader and will generate /boot/refind_linux.conf for that distribution.
There are many possible variants on this procedure. For instance, you could use BIOS/CSM/legacy mode to install the second distribution; but then you would not re-install rEFInd, but you would have to manually create a /boot/refind_linux.conf file or run mkrlconf.sh. I actually started to write a series of options, but the number of possible combinations just started to get unmanageable -- most of the steps I've outlined have alternatives, and for each alternative, the total number of possible paths doubles, so you've got 2 raised to some value possible ways of doing it. If you don't like the procedure I've just outlined or if it doesn't work, your best hope is to understand the principles well enough to find your own way.
YeeP

Post by YeeP »

Good points in there. I think where my path varies, is mint 15 and kali cannot boot on a live disc in EFI mode. That is why I specified the other.
srs5694
Level 6
Level 6
Posts: 1386
Joined: Mon Feb 27, 2012 1:42 pm

Re: New EFI boot manager available: rEFInd

Post by srs5694 »

Mint 15 can definitely boot and install in EFI mode, at least speaking generically. There may be problems on specific computers, though. Assuming you've got such a problem, try this:
  1. Install first distribution in BIOS/CSM/legacy mode. Ensure that you create an ESP, and configure it to mount at /boot/efi.
  2. In first distribution, install rEFInd. This should install it using the default/fallback filename of EFI/BOOT/bootx64.efi on the ESP. More importantly, this will create a /boot/refind_linux.conf file.
  3. Install the second distribution in BIOS/CSM/legacy mode. Configure it to mount the same ESP you used for the first distribution.
  4. In the second distribution, install rEFInd. This will overwrite the original rEFInd files and create a /boot/refind_linux.conf file for the second distribution.
  5. Reconfigure the computer to boot in EFI mode.
The result should be that rEFInd will come up and give you the option of booting both your distributions, via their kernels. It's possible you'll want to set icons for both distributions to help distinguish them. (rEFInd is unlikely to guess right for either Mint or Kali.) If you've previously installed some other OS in EFI mode and if its boot loader is still present, that boot loader will probably launch, bypassing rEFInd. You'll need to delete that boot loader or remove its entry (via efibootmgr in Linux or other tools in other OSes) to get the default boot loader to run.
User avatar
Portreve
Level 13
Level 13
Posts: 4882
Joined: Mon Apr 18, 2011 12:03 am
Location: Within 20,004 km of YOU!
Contact:

Re: New EFI boot manager available: rEFInd

Post by Portreve »

Hey srs5694!

I figure I'll ask you this question because you're the most likely to be expert in such matters.

The following question assumes rEFInd, rEFIt, or any other such software is not installed.

On Macs, when you create a bootable Linux CD/DVD or a LiveUSB flash drive, you can hold down the [Option] key and pick it, regardless of whether you reset the PRAM or not. However, if you have installed Linux and reset the PRAM, nothing comes up and there is no direct way to boot from the HDD install.

Does rEFInd solve this issue? Is there some other way to solve it?
Flying this flag in support of freedom 🇺🇦

Recommended keyboard layout: English (intl., with AltGR dead keys)

Podcasts: Linux Unplugged, Destination Linux

Also check out Thor Hartmannsson's Linux Tips YouTube Channel
srs5694
Level 6
Level 6
Posts: 1386
Joined: Mon Feb 27, 2012 1:42 pm

Re: New EFI boot manager available: rEFInd

Post by srs5694 »

Portreve,

I'm afraid I don't know what causes that problem, much less whether installing rEFInd would fix it. That said, rEFInd should theoretically obviate the need to use Apple's built-in boot manager, so installing rEFInd should make the problem a non-issue. I say theoretically because I've seen the occasional report of rEFInd being unable to launch some boot loaders that Apple's EFI can launch, so as a practical matter there may still be some cases where this could still be an issue.
YeeP

Re: New EFI boot manager available: rEFInd

Post by YeeP »

I have rEFInd up and running and it did recognize Mint with the icons. Pretty cool. Anyway, I have the same issue this time where it is finding two linux kernels. Here is a quote where you reccomended telling refind to not scan the directories:
An old quote from page 5 I believe
srs5694 wrote:Your BusyBox boot is actually a boot using your regular Mint kernel; it's just that Mint installs the kernel itself as /boot/vmlinuz-{version} and a symbolic link to it as /vmlinuz. This is an unnecessary link in most cases, although some boot loaders or tools might need it. It's booting into BusyBox because there's (presumably) no refind_linux.conf file in the Linux root (/) directory, so when you boot that OS tag, the kernel is not getting the options it needs to set everything up correctly. The easiest and safest way to get rid of the extra tag is to edit /boot/efi/EFI/refind/refind.conf and add or edit the "dont_scan_dirs" line as follows:

Code: Select all

dont_scan_dirs /
This will cause rEFInd to ignore the /vmlinuz symbolic link (and any other kernel or boot loader in the root of any partition; but you don't seem to have any such boot loaders).
I am ok with that, but will it cause an issue in the future when it comes time to install linux distro #2?

Edit:

I added:

Code: Select all

dont_scan_dirs /
to refind.conf, and it is still finding the vmlinuz-3.8.0-19-generic listing and adding it to the menu. Any ideas?

That kernel is way back in /boot while the refind.conf file is in /boot/efi/EFI/refind , is the "root" of that configuration the /boot directory? Hence dont_scan_dirs / ?
User avatar
Portreve
Level 13
Level 13
Posts: 4882
Joined: Mon Apr 18, 2011 12:03 am
Location: Within 20,004 km of YOU!
Contact:

Re: New EFI boot manager available: rEFInd

Post by Portreve »

srs5694 wrote:Portreve,

I'm afraid I don't know what causes that problem, much less whether installing rEFInd would fix it. That said, rEFInd should theoretically obviate the need to use Apple's built-in boot manager, so installing rEFInd should make the problem a non-issue. I say theoretically because I've seen the occasional report of rEFInd being unable to launch some boot loaders that Apple's EFI can launch, so as a practical matter there may still be some cases where this could still be an issue.
Hey srs5694!

Thanks for your honest response. I really do appreciate it. I guess in part what I'm wondering is how is the Live image set up that a real install is not?

In any event, I also realize that when you're working with Apple hardware, you are also greatly compromised and limited by Apple's willingness (or lack thereof) to play nicely. So, whereas with other EFI systems you might have a chance to make everything work perfectly reliably 100% of the time, Apple will keep mucking about and frankly not care how this impacts anyone.

As a side note, I can't wait to be able to sell off my MBP and get a System76 unit, and not have to put up with this crap ever again.
Flying this flag in support of freedom 🇺🇦

Recommended keyboard layout: English (intl., with AltGR dead keys)

Podcasts: Linux Unplugged, Destination Linux

Also check out Thor Hartmannsson's Linux Tips YouTube Channel
srs5694
Level 6
Level 6
Posts: 1386
Joined: Mon Feb 27, 2012 1:42 pm

Re: New EFI boot manager available: rEFInd

Post by srs5694 »

YeeP wrote:
srs5694 wrote:The easiest and safest way to get rid of the extra tag is to edit /boot/efi/EFI/refind/refind.conf and add or edit the "dont_scan_dirs" line as follows:

Code: Select all

dont_scan_dirs /
This will cause rEFInd to ignore the /vmlinuz symbolic link (and any other kernel or boot loader in the root of any partition; but you don't seem to have any such boot loaders).
I am ok with that, but will it cause an issue in the future when it comes time to install linux distro #2?
This should no longer be necessary; since writing that message, I've added code to rEFInd that causes it to ignore symbolic links, so it shouldn't be picking up duplicate entries like that.

As to causing problems, the "dont_scan_dirs /" line would cause rEFInd to ignore kernels if either distribution uses a separate /boot partition. If neither of your distributions uses a separate /boot partition, it shouldn't be an issue.
I added:

Code: Select all

dont_scan_dirs /
to refind.conf, and it is still finding the vmlinuz-3.8.0-19-generic listing and adding it to the menu. Any ideas?
Chances are you're seeing two distinct kernels showing up in rEFInd -- for instance, vmlinuz-3.8.0-19-generic and vmlinuz-3.8.0-17-generic. If so, this is by design, and is something that you should probably not fight, at least up to a certain point. Having multiple kernels available gives you a fallback in case a new kernel is buggy or in case an accident damages a kernel or destroys its associated modules or initial RAM disk file. That said, if you end up with too many kernel options, you can use dpkg to delete the extra kernels.

If you think that something else is happening, more details are necessary, such as the exact description of each kernel option.
srs5694
Level 6
Level 6
Posts: 1386
Joined: Mon Feb 27, 2012 1:42 pm

Re: New EFI boot manager available: rEFInd

Post by srs5694 »

Portreve wrote:Thanks for your honest response. I really do appreciate it. I guess in part what I'm wondering is how is the Live image set up that a real install is not?
If you mean a rEFInd live image, the differences are:
  • Different physical devices are used. (This is obvious, but bears mentioning because there can be effects if the firmware doesn't recognize the physical device.)
  • The CD-R and USB flash drive images both use the fallback filename (EFI/BOOT/boot{arch}.efi, where "{arch}" is "x64" for x86-64 or "ia32" x86/IA32), whereas hard disk installs typically use EFI/refind/refind_{arch}.efi).
  • A hard disk install adds an entry for rEFInd to the computer's NVRAM, whereas the live media don't do this. The nature of the NVRAM entry varies depending on the computer -- it's different for Macs than for all other EFI/UEFI computers.
  • On a Mac, rEFInd is installed to HFS+ by default, although it can be installed to the FAT ESP. The live media use FAT (inside an El Torito image in the case of the CD-R image). On a PC, FAT is the only way to install rEFInd, unless you use something else to load other filesystem drivers first.
In any event, I also realize that when you're working with Apple hardware, you are also greatly compromised and limited by Apple's willingness (or lack thereof) to play nicely. So, whereas with other EFI systems you might have a chance to make everything work perfectly reliably 100% of the time, Apple will keep mucking about and frankly not care how this impacts anyone.
Unfortunately, there's a lot of variability between different EFI implementations even outside of the Apple arena, so it's not quite as nice there as you might think. That said, I am having more trouble with variability between Mac implementations than I am on the PC side, perhaps because I own several UEFI PCs and so can experiment in a hands-on way, whereas I own just one (elderly 32-bit) Mac.
YeeP

Re: New EFI boot manager available: rEFInd

Post by YeeP »

I do agree with you that multiple kernels listed could be helpful if the sh*t hits the fan. However, this is a brand new install (one of which I would hope there is only a single kernel in), and only one distro thus far.
srs5694 wrote:If you think that something else is happening, more details are necessary, such as the exact description of each kernel option.
What kind of exact information can I provide?

I will remove that dont_scan_dirs / from the conf file. Can you tell me the root directory that refers to? (just saying typically "/" means root directory) I ask because if I would like to specify a certain directory, I will know where to start the mapping.

I really like this program, there will be no question in the future which way I go. :mrgreen: Thanks for dealing with my lack of knowledge.


BTW, if you care this is the order of installation that I ended up going with. It was not expected. I burned a new disc because I was unable to boot on the live disc in EFI mode. Maybe this can help someone in the future.

1) Installed Linux mint in EFI mode.
2) Rebooted, and saw nothing indicating a linux install, machine went straight to windows. (Note; there was a linuxmint folder inside of the /efi folder. I did not create it on my own)
3) Used the "manual install using Windows" steps on the website ... http://www.rodsbooks.com/refind/installing.html#windows
4) Booted machine and rEFInd menu came to screen, selected Linux Mint.
5) Opened terminal and edited fstab (in my case sda2 is the boot drive) so sda2 is mounted as /boot/efi.
6) Manually mounted the above and confirmed changes exist.

No steps required in CSM mode.

I am guessing when the time comes, Kali will need to be installed in CSM, but I have not tried to boot on the live disc in EFI yet.
dwd

Re: New EFI boot manager available: rEFInd

Post by dwd »

OK so I finally had time to have a look at the LM full USB install files and there is no path "EFI/Boot/boot64.efi . I looked in the root directory and all others. The closest I could come was "boot/efi.grub/x86_64-efi/" and then the only .efi file was called 'core/efi." I changed that to "boot64.efi" and no luck.
srs5694 wrote:
dwd wrote:Just to clarify before I go off on a wild goose chase, I installed LM 15 to a USB drive after booting from a LM Live USB drive. Do the naming changes above apply?
EFI boots as follows:
  1. The firmware scans its own boot loader list, maintained in NVRAM, and tries to boot each boot loader in that list in the order defined by the BootOrder variable.
  2. If this fails, the firmware may boot the EFI/BOOT/bootx64.efi file (on x86-64 hardware) from any disk that's marked as bootable, such as a USB flash drive.
Because USB flash drives are often moved from one computer to another, you can't count on an NVRAM entry existing for them. Thus, these devices almost always boot from a boot loader called EFI/BOOT/bootx64.efi. If you've installed something locally yourself, or if you've used efibootmgr or the like to create an NVRAM entry, it might work from some other name. Even then, though, some EFIs "helpfully" remove entries that they can see are invalid, so you might lose the entry if you unplug the USB device. Overall, then, the only safe name for a bootable USB flash drive's boot loader is EFI/BOOT/bootx64.efi (on x86-64 hardware; the name varies from one CPU type to another).
Also, I see in your renaming explanation a path and a file name. I'm not sure I understand what is going on in order to carry out the changes.
Use "mv" in Linux, or a file manager. EFI boot loaders are ordinary files.
srs5694
Level 6
Level 6
Posts: 1386
Joined: Mon Feb 27, 2012 1:42 pm

Re: New EFI boot manager available: rEFInd

Post by srs5694 »

YeeP wrote:I do agree with you that multiple kernels listed could be helpful if the sh*t hits the fan. However, this is a brand new install (one of which I would hope there is only a single kernel in), and only one distro thus far.
srs5694 wrote:If you think that something else is happening, more details are necessary, such as the exact description of each kernel option.
What kind of exact information can I provide?
As I said: the exact description of each kernel option. That is, when you highlight an option, you'll see a description of it, such as "Boot foo.efi from ESP". That identifies the file (foo.efi) and the volume (ESP).
I will remove that dont_scan_dirs / from the conf file. Can you tell me the root directory that refers to? (just saying typically "/" means root directory) I ask because if I would like to specify a certain directory, I will know where to start the mapping.
EFI is like DOS or Windows -- each filesystem is mounted independently and has its own root directory. rEFInd relies on the EFI to access files, so "dont_scan_dirs /" refers to the root of all the filesystems that the EFI can read. In Linux terms, this could be any number of directories. For instance, if you've got root (/), /boot, /home, and /boot/efi partitions that rEFInd can scan, it will refer to all of those directories (as seen from Linux).
dwd wrote:OK so I finally had time to have a look at the LM full USB install files and there is no path "EFI/Boot/boot64.efi . I looked in the root directory and all others. The closest I could come was "boot/efi.grub/x86_64-efi/" and then the only .efi file was called 'core/efi." I changed that to "boot64.efi" and no luck.
This sounds like whatever tool you used to create the USB flash drive omitted those critical files. Check the original .iso file to see if they're present in it. If so, copy them over, but be sure you're copying to a FAT filesystem. (If the USB flash drive has no FAT filesystem, then it won't be bootable under EFI -- at least, not unless you add filesystem drivers or if you're using an EFI that supports more than FAT. [Apple's EFI supports HFS+, for instance.])
dwd

Re: New EFI boot manager available: rEFInd

Post by dwd »

srs5694 wrote:
dwd wrote:OK so I finally had time to have a look at the LM full USB install files and there is no path "EFI/Boot/boot64.efi . I looked in the root directory and all others. The closest I could come was "boot/efi.grub/x86_64-efi/" and then the only .efi file was called 'core/efi." I changed that to "boot64.efi" and no luck.
This sounds like whatever tool you used to create the USB flash drive omitted those critical files. Check the original .iso file to see if they're present in it. If so, copy them over, but be sure you're copying to a FAT filesystem. (If the USB flash drive has no FAT filesystem, then it won't be bootable under EFI -- at least, not unless you add filesystem drivers or if you're using an EFI that supports more than FAT. [Apple's EFI supports HFS+, for instance.])
I checked and you are correct. The directory wasn't even there. However, the interesting part is that I used the Linux Mint install USB drive to install the 'full" version onto another USB drive. However, the /EFI/BOOT directory is on the Linux Mint Live USB drive. So the LM Live USB failed to install that directory.

I tried again reinstalling the full version to another USB drive, but at the end I got the message that the boot loader failed to install because of an unsigned EFI something or other. At this point, I don't k now what to do. I did copy the EFI directory to the old Full USB install, but still didn't get it to boot either. Also, it wasn't FAT it was the Linux ext4. Should I use FAT and try reinstalling again?
srs5694
Level 6
Level 6
Posts: 1386
Joined: Mon Feb 27, 2012 1:42 pm

Re: New EFI boot manager available: rEFInd

Post by srs5694 »

dwd wrote:I tried again reinstalling the full version to another USB drive, but at the end I got the message that the boot loader failed to install because of an unsigned EFI something or other. At this point, I don't k now what to do. I did copy the EFI directory to the old Full USB install, but still didn't get it to boot either. Also, it wasn't FAT it was the Linux ext4. Should I use FAT and try reinstalling again?
It's unclear to me if you're talking about preparing a USB flash drive with which to install Mint or about installing Mint on a hard disk. Either way, try installing the boot loader manually. If you're preparing a USB flash drive, just copy the files over to the EFI/BOOT directory. If you're installing to a computer, your best bet might be to use a rEFInd USB flash drive or CD-R to boot the computer, then install the EFI boot manager/loader of your choice to the computer's hard disk. If you choose to use rEFInd for this role, installing the Debian package should do the trick (although you must ensure that your ESP is mounted at /boot/efi).
phrostbyte

Re: New EFI boot manager available: rEFInd

Post by phrostbyte »

I talked about my problems installing Linux Mint 16 side by side with Windows 8.1 in this thread:

http://forums.linuxmint.com/viewtopic.php?f=46&t=151491&p=789973#p789973

I guess I'll boot into the Mint LIve USB and maybe trying installing rEFInd from there... maybe it'll help?

small update: I tried the rEFInd liveUSB image and it worked! It let me boot into both Windows 8.1 and LM16.. so I was happy. So I downloaded the .deb file from within LM and installed it.. it said that rEFInd was my new bootloader.. I rebooted and once again it automatically brought me into Windows. :(
srs5694
Level 6
Level 6
Posts: 1386
Joined: Mon Feb 27, 2012 1:42 pm

Re: New EFI boot manager available: rEFInd

Post by srs5694 »

phrostbyte wrote:small update: I tried the rEFInd liveUSB image and it worked! It let me boot into both Windows 8.1 and LM16.. so I was happy. So I downloaded the .deb file from within LM and installed it.. it said that rEFInd was my new bootloader.. I rebooted and once again it automatically brought me into Windows. :(
You probably need to mount the ESP at /boot/efi and then re-run rEFInd's install.sh script, which should be in /usr/share/refind-{version}/. You can identify the ESP via parted or gdisk, as in:

Code: Select all

$ sudo parted /dev/sda print
Model: ATA Hitachi HDP72505 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size   File system  Name                     Flags
 1      1049kB  200MB  199MB  fat32        EFI System               boot
 2      200MB   411MB  211MB  ext2         Gentoo /boot
 3      411MB   621MB  210MB  hfs+         Unused
 4      621MB   500GB  499GB               Linux LVM data (nessus)  lvm
 5      500GB   500GB  205kB               BIOS boot partition      bios_grub

$sudo gdisk -l /dev/sda
GPT fdisk (gdisk) version 0.8.8

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 976773168 sectors, 465.8 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): B322E151-7686-4B94-ACDF-F8F4CC2E9813
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 976773134
Partitions will be aligned on 8-sector boundaries
Total free space is 6690 sectors (3.3 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          390625   189.7 MiB   EF00  EFI System
   2          390626          803249   201.5 MiB   8300  Gentoo /boot
   3          803256         1212850   200.0 MiB   8300  Unused
   4         1212851       976768064   465.2 GiB   8E00  Linux LVM data (nessus)
   5       976768065       976768464   200.0 KiB   EF02  BIOS boot partition
In parted, the ESP is the partition with its "boot flag" set; in gdisk, it has a type code of EF00. In the case of this example system, the ESP is /dev/sda1.
phrostbyte

Re: New EFI boot manager available: rEFInd

Post by phrostbyte »

It was mounted the whole time.. eventually I had to trick Windows into thinking thso that reFINd was my only boot loader... basically setting it up took me all night. And then I ran into a new problem... first, the kernel didn't even recognize my GeForce 740m. I thought maybe installing the official drivers would help.. but that just made X crash continuously. In the end, I'm very sad to say.. that after looking forward to this new version so I can return to the world of Linux (been away in the army for a few years). I'm pretty disappointed.

I remember only a few years back when Linux Mint installed easily and you could even turn on propriety drivers with a simple included program. I know that UEFI has been a huge pain for Linux.. but how is that there's still no standard for GPU drivers? Aren't the steam boxes being released next year? I'm very sad about this. :(
srs5694
Level 6
Level 6
Posts: 1386
Joined: Mon Feb 27, 2012 1:42 pm

Re: New EFI boot manager available: rEFInd

Post by srs5694 »

phrostbyte wrote:I know that UEFI has been a huge pain for Linux.. but how is that there's still no standard for GPU drivers? Aren't the steam boxes being released next year? I'm very sad about this. :(
EFI is only peripherally involved in video driver issues. Basically, BIOS and EFI can initialize video hardware differently from each other, which can lead to inconsistencies in the way the hardware appears once the OS is booted. If the OS's driver can handle this difference, there will be no video problems under EFI; but if it can't, video hardware may not work, or may require special handling. (Maybe creating an xorg.conf file will help, for instance; or maybe passing a kernel option like "nomodeset" will help.)
phrostbyte

Re: New EFI boot manager available: rEFInd

Post by phrostbyte »

No, I realize that. I wasn't trying to imply the two problems were related. Just expressing my disappointment at the actual experience after waiting so long to try out the new LM. It's not like how I remember it was before I joined the army. :oops:
hflaxman

New EFI boot manager available: rEFInd

Post by hflaxman »

I've used rEfit awhile back with good result.

My question now relates to a 5,2 white MacBook that I want to run Mint 16 as the sole OS. I will not use OS X at all if it isn't needed.

Would there still be a need for rEfind or rEfit?

TIA

Harry


Sent from my iPod touch using [url=http://tapatalk.com/m?id=1]Tapatalk[/url]
Locked

Return to “Chat about Linux Mint”