[INFO] Experimenting with rEFInd - a users perspective

"Off-topic" but Linux related discussion, about ArcoLinux or other distributions.
Post Reply
User avatar
Jimmy
recruit crewman
Posts: 1
Joined: Wed Oct 20, 2021 6:41 am

[INFO] Experimenting with rEFInd - a users perspective

Post by Jimmy »



Just saw your latest video on rEFInd. For the last couple of years or so, I've had grub completely removed and have solely used rEFInd. When I install Arch, Arco, Debian, Mint, etc, I don't install a boot loader. Mounting the ESP isn't necessary either; as long as you have a NVRAM entry for rEFInd, you should be good. I add manual boot entries directly to refind.conf. An example:

Code: Select all

menuentry "Arco Linux" {
    icon	/EFI/refind/icons/os_arco.png
    volume  98444258-A9DE-4429-887D-416E47A26613
    loader	/boot/vmlinuz-linux
    initrd	/boot/initramfs-linux.img
    options	"root=UUID=227e6466-c7b1-424f-9a0f-36c405d9c620 rw"
    submenuentry "Boot using fallback initramfs" {
        initrd /boot/initramfs-linux-fallback.img
    }
    submenuentry "Boot to terminal" {
        add_options "systemd.unit=multi-user.target"
    }
}
The UUID for the volume is the Partition unique GUID for the root partition. That can be found with the following command:

Code: Select all

sudo sgdisk -i 1 /dev/sdx
The -i parameter is the partition number of the root partition on sdx
Output will look something like this:

Code: Select all

Partition GUID code: 0FC63DAF-8483-4772-8E79-3D69D8477DE4 (Linux filesystem)
Partition unique GUID: 98444258-A9DE-4429-887D-416E47A26613 ** This is the UUID needed for volume.
First sector: 2048 (at 1024.0 KiB)
Last sector: 468858879 (at 223.6 GiB)
Partition size: 468856832 sectors (223.6 GiB)
Attribute flags: 0000000000000000
Partition name: 'ArcoLinux'
The Partition name can be used for volume as well.

The UUID in the options line is simply the partition UUID of the root partition which can be found using sudo blkid

Here's my Linux Mint entry:

Code: Select all

menuentry "Linux Mint" {
    icon	/EFI/refind/icons/os_linuxmint.png
    volume  C693F40F-3340-4169-B68F-E35E8D1B67C3
    loader	/boot/vmlinuz
    initrd	/boot/initrd.img
    options	"root=UUID=c9f4b773-3420-4330-80c5-ed627633db2e rw"
    submenuentry "Boot using fallback initramfs" {
        initrd /boot/initrd.img.old
    }
    submenuentry "Boot to terminal" {
        add_options "systemd.unit=multi-user.target"
    }
}
As I mentioned before, I install Arch, Arco, etc. without a boot loader, vmlinuz and initramfs end up in the /boot directory of the root partition and not on the ESP.

I apologize if you already know all of this. I got the impression from the video that you would like to do away with grub completely. The only drawback to this is manually going in and adding these entries.

User avatar
erikdubois
Captain
Posts: 5109
Joined: Tue Nov 07, 2017 3:45 pm
Location: Belgium
Contact:

Re: [INFO] Experimenting with rEFInd - a users perspective

Post by erikdubois »

Thanks for the explanation.

I can always learn more.

Something to try out - not for the beginner that much is clear

Fun nevertheless

We stick to grub. That does not mean I have to. :lol: :mrgreen:

If you type "refind-install" I would think it will find the new partitions... or does it only check the content of /boot/efi
Learn, have fun and enjoy.
But first use the power of the Arch Wiki
use the tutorials on https://www.youtube.com/erikdubois
then use the power of google
then use the power of our moderators.

User avatar
Jimmy
recruit crewman
Posts: 1
Joined: Wed Oct 20, 2021 6:41 am

Re: [INFO] Experimenting with rEFInd - a users perspective

Post by Jimmy »

erikdubois wrote:
Mon Dec 06, 2021 6:31 am
Thanks for the explanation.

I can always learn more.

Something to try out - not for the beginner that much is clear

Fun nevertheless

We stick to grub. That does not mean I have to. :lol: :mrgreen:
I assumed this was for your own personal tinkering.
If you type "refind-install" I would think it will find the new partitions... or does it only check the content of /boot/efi
I haven't reinstalled refind in quite awhile. The last time I installed refined, I started tinkering with manual entries (stanzas as they're called in refind). I uninstalled grub completely and rely on the manual entries. I've been hesitant to use refind-install again. Don't want to break my setup. :lol:

There are a lot of options for how rEFInd scans for boot loaders and such that I really haven't tried. Here is my refind.conf. It doesn't include many of the options that are in the original sample conf:

Code: Select all

# Configuration file for the rEFInd boot menu

# Timeout in seconds for the main menu screen. Setting the timeout to 0
# disables automatic booting (i.e., no timeout). Setting it to -1 causes
# an immediate boot to the default OS *UNLESS* a keypress is in the buffer
# when rEFInd launches, in which case that keypress is interpreted as a
# shortcut key. If no matching shortcut is found, rEFInd displays its
# menu with no timeout.

timeout 30


# Set the name of a subdirectory in which icons are stored. Icons must
# have the same names they have in the standard directory. The directory
# name is specified relative to the main rEFInd binary's directory. If
# an icon can't be found in the specified directory, an attempt is made
# to load it from the default directory; thus, you can replace just some
# icons in your own directory and rely on the default for others.
# Default is "icons".

#icons_dir icons/custom


# Use a custom title banner instead of the rEFInd icon and name. The file
# path is relative to the directory where refind.efi is located. The color
# in the top left corner of the image is used as the background color
# for the menu screens. Currently uncompressed BMP images with color
# depths of 24, 8, 4 or 1 bits are supported, as well as PNG images.

banner RedForest.png


# Specify how to handle banners that aren't exactly the same as the screen
# size:
#  noscale     - Crop if too big, show with border if too small
#  fillscreen  - Fill the screen
# Default is noscale

banner_scale fillscreen


# Icon sizes. All icons are square, so just one value is specified. The
# big icons are used for OS selectors in the first row and the small
# icons are used for tools on the second row. Drive-type badges are 1/4
# the size of the big icons. Legal values are 32 and above. If the icon
# files do not hold icons of the proper size, the icons are scaled to
# the specified size. The default values are 48 and 128 for small and
# big icons, respectively.

small_icon_size 64
big_icon_size 192


# Set the screen's video resolution. Pass this option either:
#  * two values, corresponding to the X and Y resolutions
#  * one value, corresponding to a GOP (UEFI) video mode
# Note that not all resolutions are supported. On UEFI systems, passing
# an incorrect value results in a message being shown on the screen to
# that effect, along with a list of supported modes. On EFI 1.x systems
# (e.g., Macintoshes), setting an incorrect mode silently fails. On both
# types of systems, setting an incorrect resolution results in the default
# resolution being used. A resolution of 1024x768 usually works, but higher
# values often don't.
# Default is "0 0" (use the system default resolution, usually 800x600).

resolution 1920 1080


# Launch specified OSes in graphics mode. By default, rEFInd switches
# to text mode and displays basic pre-launch information when launching
# all OSes except macOS. Using graphics mode can produce a more seamless
# transition, but displays no information, which can make matters
# difficult if you must debug a problem. Also, on at least one known
# computer, using graphics mode prevents a crash when using the Linux
# kernel's EFI stub loader. You can specify an empty list to boot all
# OSes in text mode.
# Valid options:
#   osx     - macOS
#   linux   - A Linux kernel with EFI stub loader
#   elilo   - The ELILO boot loader
#   grub    - The GRUB (Legacy or 2) boot loader
#   windows - Microsoft Windows
# Default value: osx

use_graphics_for linux,windows


# Which non-bootloader tools to show on the tools line, and in what
# order to display them:
#  shell            - the EFI shell (requires external program; see rEFInd
#                     documentation for details)
#  memtest          - the memtest86 program, in EFI/tools, EFI/memtest86,
#                     EFI/memtest, EFI/tools/memtest86, or EFI/tools/memtest
#  gptsync          - the (dangerous) gptsync.efi utility (requires external
#                     program; see rEFInd documentation for details)
#  gdisk            - the gdisk partitioning program
#  apple_recovery   - boots the Apple Recovery HD partition, if present
#  windows_recovery - boots an OEM Windows recovery tool, if present
#                     (see also the windows_recovery_files option)
#  mok_tool         - makes available the Machine Owner Key (MOK) maintenance
#                     tool, MokManager.efi, used on Secure Boot systems
#  csr_rotate       - adjusts Apple System Integrity Protection (SIP)
#                     policy. Requires "csr_values" to be set.
#  about            - an "about this program" option
#  hidden_tags      - manage hidden tags
#  exit             - a tag to exit from rEFInd
#  shutdown         - shuts down the computer (a bug causes this to reboot
#                     many UEFI systems)
#  reboot           - a tag to reboot the computer
#  firmware         - a tag to reboot the computer into the firmware's
#                     user interface (ignored on older computers)
#  fwupdate         - a tag to update the firmware; launches the fwupx64.efi
#                     (or similar) program
#  netboot          - launch the ipxe.efi tool for network (PXE) booting
# Default is shell,memtest,gdisk,apple_recovery,windows_recovery,mok_tool,about,hidden_tags,shutdown,reboot,firmware,fwupdate

showtools shell, memtest, firmware, reboot, shutdown


# Which types of boot loaders to search, and in what order to display them:
#  internal      - internal EFI disk-based boot loaders
#  external      - external EFI disk-based boot loaders
#  optical       - EFI optical discs (CD, DVD, etc.)
#  netboot       - EFI network (PXE) boot options
#  hdbios        - BIOS disk-based boot loaders
#  biosexternal  - BIOS external boot loaders (USB, eSATA, etc.)
#  cd            - BIOS optical-disc boot loaders
#  manual        - use stanzas later in this configuration file
# Note that the legacy BIOS options require firmware support, which is
# not present on all computers.
# The netboot option is experimental and relies on the ipxe.efi and
# ipxe_discover.efi program files.
# On UEFI PCs, default is internal,external,optical,manual
# On Macs, default is internal,hdbios,external,biosexternal,optical,cd,manual

scanfor manual, external, optical


# Set the default menu selection.  The available arguments match the
# keyboard accelerators available within rEFInd.  You may select the
# default loader using:
#  - A digit between 1 and 9, in which case the Nth loader in the menu
#    will be the default.
#  - A "+" symbol at the start of the string, which refers to the most
#    recently booted loader.
#  - Any substring that corresponds to a portion of the loader's title
#    (usually the OS's name, boot loader's path, or a volume or
#    filesystem title).
# You may also specify multiple selectors by separating them with commas
# and enclosing the list in quotes. (The "+" option is only meaningful in
# this context.)
# If you follow the selector(s) with two times, in 24-hour format, the
# default will apply only between those times. The times are in the
# motherboard's time standard, whether that's UTC or local time, so if
# you use UTC, you'll need to adjust this from local time manually.
# Times may span midnight as in "23:30 00:30", which applies to 11:30 PM
# to 12:30 AM. You may specify multiple default_selection lines, in which
# case the last one to match takes precedence. Thus, you can set a main
# option without a time followed by one or more that include times to
# set different defaults for different times of day.
# The default behavior is to boot the previously-booted OS.

default_selection "Arco Linux"


# Manual Entries Follow:

menuentry "Arco Linux" {
    icon	/EFI/refind/icons/os_arco-x.png
    volume  98444258-A9DE-4429-887D-416E47A26613
    loader	/boot/vmlinuz-linux
    initrd	/boot/initramfs-linux.img
    options	"root=UUID=227e6466-c7b1-424f-9a0f-36c405d9c620 rw"
    submenuentry "Boot using fallback initramfs" {
        initrd /boot/initramfs-linux-fallback.img
    }
    submenuentry "Boot to terminal" {
        add_options "systemd.unit=multi-user.target"
    }
}


menuentry "Linux Mint" {
    icon	/EFI/refind/icons/os_linuxmint.png
    volume  C693F40F-3340-4169-B68F-E35E8D1B67C3
    loader	/boot/vmlinuz
    initrd	/boot/initrd.img
    options	"root=UUID=c9f4b773-3420-4330-80c5-ed627633db2e rw"
    submenuentry "Boot using fallback initramfs" {
        initrd /boot/initrd.img.old
    }
    submenuentry "Boot to terminal" {
        add_options "systemd.unit=multi-user.target"
    }
}


menuentry "Windows 10" {
    loader \EFI\Microsoft\Boot\bootmgfw.efi
}
I'm sure there are easier ways to do this but I've been sticking with what works for me.

Edit:
You can also add submenu entries for different kernels:

Code: Select all

menuentry "Arco Linux" {
    icon	/EFI/refind/icons/os_arco-x.png
    volume  98444258-A9DE-4429-887D-416E47A26613
    loader	/boot/vmlinuz-linux
    initrd	/boot/initramfs-linux.img
    options	"root=UUID=227e6466-c7b1-424f-9a0f-36c405d9c620 rw"
    submenuentry "Boot using fallback initramfs" {
        initrd /boot/initramfs-linux-fallback.img
    }
    
    submenuentry "Boot Zen Kernel" {
        loader /boot/vmlinuz-linux-zen
        initrd /boot/initramfs-linux-zen.img
    }
    
    submenuentry "Boot to terminal" {
        add_options "systemd.unit=multi-user.target"
    }
}
When in the rEFInd menu, pressing F2 or Insert will display respective submenu options.

I disabled my manual entries and added internal to the scanfor entry in refind.conf. It did detect my loaders and boot my installs. No custom icons though. The manual stanzas definitely give you more control over sub-entries for different kernels/options and icons.
Last edited by Jimmy on Mon Dec 06, 2021 12:07 pm, edited 3 times in total.

User avatar
erikdubois
Captain
Posts: 5109
Joined: Tue Nov 07, 2017 3:45 pm
Location: Belgium
Contact:

Re: [INFO] Experimenting with rEFInd - a users perspective

Post by erikdubois »

What I need for now is a way to completely remove Grub for 100% and still be able to boot in rEFInd

I was unsuccessful last time.

seems that it is hard what I could find online

next thing I would do (time permitting) is an Arch Linux install and instead of using grub I would install refind then I will not have the issue of removing grub being impossible
Learn, have fun and enjoy.
But first use the power of the Arch Wiki
use the tutorials on https://www.youtube.com/erikdubois
then use the power of google
then use the power of our moderators.

Brakmaren
recruit crewman
Posts: 1
Joined: Tue Dec 07, 2021 5:47 am

Re: [INFO] Experimenting with rEFInd - a users perspective

Post by Brakmaren »

Thanks..... This is absolutely awesome :D

User avatar
erikdubois
Captain
Posts: 5109
Joined: Tue Nov 07, 2017 3:45 pm
Location: Belgium
Contact:

Re: [INFO] Experimenting with rEFInd - a users perspective

Post by erikdubois »

Learn, have fun and enjoy.
But first use the power of the Arch Wiki
use the tutorials on https://www.youtube.com/erikdubois
then use the power of google
then use the power of our moderators.

Post Reply

Return to “ArcoLinux and General Linux Discussion”