[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
howtos:slackware_admin:uefi_triple_boot_with_refind_on_slackware [2016/11/16 09:17 (UTC)] – [Sources] aragorn2101 | howtos:slackware_admin:uefi_triple_boot_with_refind_on_slackware [2017/01/25 08:49 (UTC)] (current) – [GRUB] aragorn2101 | ||
---|---|---|---|
Line 5: | Line 5: | ||
Machines are now coming in with the UEFI standard. It presents some advantages like the ability to boot from disks over 2TiB and flexible pre-OS environments as drivers can be loaded in the UEFI firmware. But Linux users found that, suddenly, it was more difficult to multi-boot as we used to do in the past. However, Linux users have a variety of resources and we found a way to work with the new standard. It is not as straightforward as in the past, but it is not that hard either. | Machines are now coming in with the UEFI standard. It presents some advantages like the ability to boot from disks over 2TiB and flexible pre-OS environments as drivers can be loaded in the UEFI firmware. But Linux users found that, suddenly, it was more difficult to multi-boot as we used to do in the past. However, Linux users have a variety of resources and we found a way to work with the new standard. It is not as straightforward as in the past, but it is not that hard either. | ||
- | rEFInd is principally a tool to manage bootloaders. Some advantages of using rEFInd are | + | rEFInd is principally a tool to manage bootloaders, i.e. a boot manager. Some advantages of using rEFInd are |
- Manage and boot various different EFI binaries (.efi files), | - Manage and boot various different EFI binaries (.efi files), | ||
- | - Boot Linux kernels placed on the EFI partition | + | - Boot Linux kernels placed on the EFI partition; so rEFInd can also be a bootloader in itself, |
- There might be no need to install GRUB or ELILO onto EFI partition, | - There might be no need to install GRUB or ELILO onto EFI partition, | ||
- A GUI screen with multiple pre-defined options to boot EFI binaries or kernels at boot, | - A GUI screen with multiple pre-defined options to boot EFI binaries or kernels at boot, | ||
- | - ;-) We can potentially have an ambitios | + | - ;-) We can potentially have an ambitious |
- | In this document, we will have a little summary of multi-booting on UEFI machines, going over the steps to make sure installation is done properly and how we can access our Linux distro(s); then we will describe the installation of rEFInd and how to use it. We will explain configuration of rEFInd carefully, as this will define the options and behaviour of our boot manager | + | In this article, we will have a little summary of multi-booting on UEFI machines, going over the steps to make sure installation is done properly and how we can access our Linux distro(s); then we will describe the installation of rEFInd and how to use it. We will explain configuration of rEFInd carefully, as this will define the options and behaviour of our boot manager. |
====== Installation of Linux distros ====== | ====== Installation of Linux distros ====== | ||
Line 18: | Line 18: | ||
From now on, we will assume we have a hard disk using GPT with the following configuration: | From now on, we will assume we have a hard disk using GPT with the following configuration: | ||
- | * sda1 - OEM software for security or any kind of maintainance software, | + | * sda1 (FAT) - OEM software for security or any kind of maintainance software, |
- | * sda2 - EFI partition | + | * sda2 (FAT) - EFI partition |
- | * sda3 - NTFS - Windows 10 | + | * sda3 (NTFS) - Windows 10 |
* sufficiently unallocated space | * sufficiently unallocated space | ||
- | Usually, | + | Usually, |
< | < | ||
Line 29: | Line 29: | ||
We will now proceed with our example. We assume we used gdisk and made the following partitions: | We will now proceed with our example. We assume we used gdisk and made the following partitions: | ||
* sda4 - swap | * sda4 - swap | ||
- | * sda5 - Linux - to install Slackware | + | * sda5 (Linux) - to install Slackware |
- | * sda6 - Linux - to install Ubuntu | + | * sda6 (Linux) - to install Ubuntu |
- | We consider the installation of Slackware | + | |
+ | We consider the installation of Slackware | ||
===== Slackware UEFI install ===== | ===== Slackware UEFI install ===== | ||
Line 44: | Line 45: | ||
If ELILO was not installed then we need to initialize GRUB in order to have a bootable system. So, just after the installation process, do not reboot. We will chroot into our newly installed system right away. | If ELILO was not installed then we need to initialize GRUB in order to have a bootable system. So, just after the installation process, do not reboot. We will chroot into our newly installed system right away. | ||
- | Normally | + | Normally |
-> Mount some useful filesystems (if they are not already present): | -> Mount some useful filesystems (if they are not already present): | ||
< | < | ||
- | (mount the following if not already present) | ||
- | |||
# mount -t vfat /dev/sda2 / | # mount -t vfat /dev/sda2 / | ||
- | # mount -t proc /proc proc | + | # mount -t proc /proc /mnt/proc |
- | # mount --rbind /sys sys | + | # mount --rbind /sys /mnt/sys |
- | # mount --rbind /dev dev | + | # mount --rbind /dev /mnt/dev |
- | # mount --rbind /run run | + | # mount --rbind /run /mnt/run |
</ | </ | ||
Line 78: | Line 77: | ||
<note important> | <note important> | ||
<note tip>The grub-install command above generates lots of output. You can redirect it to a log file to check it out later. Among the last lines of the output we should observe the use of the **efibootmgr** command to register the EFI binary into the UEFI firmware settings. I strongly recommend reading the man pages for **efibootmgr** to understand the command.</ | <note tip>The grub-install command above generates lots of output. You can redirect it to a log file to check it out later. Among the last lines of the output we should observe the use of the **efibootmgr** command to register the EFI binary into the UEFI firmware settings. I strongly recommend reading the man pages for **efibootmgr** to understand the command.</ | ||
- | < | + | < |
At this point we have the file EFI/ | At this point we have the file EFI/ | ||
Line 114: | Line 113: | ||
efibootmgr -c -g -d /dev/sda -p 2 -w -L " | efibootmgr -c -g -d /dev/sda -p 2 -w -L " | ||
</ | </ | ||
- | Just observe that my EFI partition is /dev/sda2; that is why there are "-d / | + | Just observe that our EFI partition is /dev/sda2; that is why there are "-d / |
===== Ubuntu ===== | ===== Ubuntu ===== | ||
- | Installation of Ubuntu is fairly straightforward. We boot into the DVD/USB and proceed with installation, | + | Installation of Ubuntu is fairly straightforward. We boot into the DVD/USB and proceed with installation, |
- | At the end of installation, | + | At the end of installation, |
====== Installing rEFInd ====== | ====== Installing rEFInd ====== | ||
Line 131: | Line 130: | ||
${VERSION} should be replaced with the version. This command will normally detect the EFI partition and system architecture, | ${VERSION} should be replaced with the version. This command will normally detect the EFI partition and system architecture, | ||
- | As for Ubuntu or other Linux distros, refind is most probably part of the official package repositories. Anyway, | + | As for Ubuntu or other Linux distros, refind is most probably part of the official package repositories. Anyway, |
===== rEFInd Manual Install ===== | ===== rEFInd Manual Install ===== | ||
Line 166: | Line 165: | ||
===== Tidying up ===== | ===== Tidying up ===== | ||
- | == Omit scan volumes == | + | == Omit scanning |
We can disable the scanning of certain volumes by using the **dont_scan_volumes** command. We use the command with volume labels. The entry in refind.conf is | We can disable the scanning of certain volumes by using the **dont_scan_volumes** command. We use the command with volume labels. The entry in refind.conf is | ||
< | < | ||
Line 172: | Line 171: | ||
</ | </ | ||
- | == Omit scan specific directories == | + | == Omit scanning |
We do not want refind to detect all the EFI binaries automatically, | We do not want refind to detect all the EFI binaries automatically, | ||
< | < | ||
Line 179: | Line 178: | ||
We will add the following: | We will add the following: | ||
< | < | ||
- | (we need to start begin the list of directories with " | + | (we need to begin the list of directories with " |
dont_scan_dirs + EFI/ | dont_scan_dirs + EFI/ | ||
</ | </ | ||
- | == Omit scan specific files == | + | == Omit scanning |
This will ultimately avoid listing certain specific EFI binaries, since we will add a single entry for each one later. | This will ultimately avoid listing certain specific EFI binaries, since we will add a single entry for each one later. | ||
< | < | ||
Line 190: | Line 189: | ||
This will prevent listing of the ELILO from the Slackware installation or from any other directory on the EFI partition. And, it will omit the Windows binaries. | This will prevent listing of the ELILO from the Slackware installation or from any other directory on the EFI partition. And, it will omit the Windows binaries. | ||
- | == Omit scan Linux kernels == | + | == Omit scanning |
< | < | ||
scan_all_linux_kernels false | scan_all_linux_kernels false | ||
Line 226: | Line 225: | ||
</ | </ | ||
- | The refind.efi binary will be booted automatically as it was added in the EFI firmwares using efibootmgr. | + | We should add custom entries for each of the EFI binaries we want to appear in the refind menu. |
-> Entry for Windows: | -> Entry for Windows: | ||
< | < | ||
menuentry Windows { | menuentry Windows { | ||
- | icon EFI/ | + | |
- | loader EFI/ | + | loader EFI/ |
} | } | ||
</ | </ | ||
- | Note that we can choose any of the icons from the icons/ directory. | + | Note that we can choose any of the icons from the EFI/refind/icons/ directory. |
-> Entry for Slackware: | -> Entry for Slackware: | ||
< | < | ||
menuentry Slackware { | menuentry Slackware { | ||
- | icon EFI/ | + | |
- | loader EFI/ | + | loader EFI/ |
} | } | ||
</ | </ | ||
Line 248: | Line 247: | ||
< | < | ||
menuentry Ubuntu { | menuentry Ubuntu { | ||
- | icon EFI/ | + | |
- | volume 9f5b153d-d103-4314-bc98-455fa5d0c625 | + | volume 9f5b153d-d103-4314-bc98-455fa5d0c625 |
- | loader EFI/ | + | loader EFI/ |
} | } | ||
</ | </ | ||
Line 256: | Line 255: | ||
=== Apple Mac === | === Apple Mac === | ||
- | For a Mac, refind will automatically detect the EFI binary. It is mos probably named " | + | For a Mac, refind will automatically detect the EFI binary. It is most probably named " |
< | < | ||
# cp / | # cp / | ||
Line 276: | Line 275: | ||
| | ||
| | ||
- | | + | |
|_ vmlinuz-4.4.16-21.generic | |_ vmlinuz-4.4.16-21.generic | ||
|_ initrd.img-4.4.16-21.generic | |_ initrd.img-4.4.16-21.generic | ||
Line 311: | Line 310: | ||
options "ro root=UUID=9f5b153d-d103-4314-bc98-455fa5d0c625" | options "ro root=UUID=9f5b153d-d103-4314-bc98-455fa5d0c625" | ||
} | } | ||
- | submenuentry "Linux 4.4.14 generic (recovery mode)" { | + | submenuentry "Linux 4.4.29 generic (recovery mode)" { |
options "ro root=UUID=9f5b153d-d103-4314-bc98-455fa5d0c625 single" | options "ro root=UUID=9f5b153d-d103-4314-bc98-455fa5d0c625 single" | ||
} | } | ||
Line 356: | Line 355: | ||
=== Using a refind_linux.conf file === | === Using a refind_linux.conf file === | ||
- | If we have placed a kernel on the EFI partition, like above with Slackware14.1 and Slackware14.2, we can also place a file called refind_linux.conf, | + | If we have placed a kernel on the EFI partition, like above, we can also place a file called refind_linux.conf, |
-> EFI/ | -> EFI/ | ||
Line 393: | Line 392: | ||
===== Non-bootloader tools ===== | ===== Non-bootloader tools ===== | ||
- | Below the icons for bootloaders and kernels selection, there is a set of icons for a set of useful tools/ | + | In the refind menu, below the icons for bootloaders and kernels selection, there is a set of icons for useful tools/ |
< | < | ||
showtools reboot, | showtools reboot, | ||
Line 423: | Line 422: | ||
=== Using custom icons === | === Using custom icons === | ||
- | As we saw above with the custom menu entries we can choose icons for each entry with the **icon** option | + | As we saw above with the custom menu entries we can choose icons for each entry with the **icon** option. So we can make our own icons and place them in directory EFI/ |
< | < | ||
large_icon 128 | large_icon 128 | ||
Line 468: | Line 467: | ||
<!-- Please do not modify anything below, except adding new tags.--> | <!-- Please do not modify anything below, except adding new tags.--> | ||
<!-- You must remove the tag-word " | <!-- You must remove the tag-word " | ||
- | {{tag> | + | {{tag> |