[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.

Welcome to the Slackware Documentation Project

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
howtos:slackware_admin:uefi_triple_boot_with_refind_on_slackware [2016/11/16 09:26 (UTC)] – [Installation of Linux distros] aragorn2101howtos:slackware_admin:uefi_triple_boot_with_refind_on_slackware [2017/01/25 08:49 (UTC)] (current) – [GRUB] aragorn2101
Line 45: 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 your newly installed system is mounted at /mnt. Use the df command to see what else is mounted and where.+Normally the newly installed system is mounted at /mnt. Use the **df** command to see what else is mounted and where.
  
 -> Mount some useful filesystems (if they are not already present): -> Mount some useful filesystems (if they are not already present):
 <code> <code>
-(mount the following if not already present) 
- 
 # mount -t vfat /dev/sda2 /mnt/boot/efi # mount -t vfat /dev/sda2 /mnt/boot/efi
  
-# 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
 </code> </code>
  
Line 79: Line 77:
 <note important>The modules efivars and efivarfs need to be loaded everytime before we use the **efibootmgr** command, here called by grub-install. Actually, it would have been loaded by grub-install automatically but we are mentioning this explicitly for completeness.</note> <note important>The modules efivars and efivarfs need to be loaded everytime before we use the **efibootmgr** command, here called by grub-install. Actually, it would have been loaded by grub-install automatically but we are mentioning this explicitly for completeness.</note>
 <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> <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>
-<note>One interesting thing here is that grub-mkconfig says it detected the Windows bootloader (bootmgfw.efi) but does not support it. So it will not be able to generate an entry for it in the grub.cfg. This is something we can work around with rEFInd.</note>+<note>One interesting thing here is that, in case Windows is installed, grub-mkconfig says it detects the Windows bootloader (bootmgfw.efi) but does not support it. So it will not be able to generate an entry for it in the grub.cfg. Then we should either put an entry manually in grub.cfg. This is something we can work around with rEFInd.</note>
 At this point we have the file EFI/GRUB/grubx64.efi and the /boot/grub tree. The grubx64.efi is registered in the firmware settings, so we can boot it. You can use the "-v" option with efibootmgr to see if everything is alright. If you need to change the order of some bootloaders, you can use the "-o" option. An example is shown below: At this point we have the file EFI/GRUB/grubx64.efi and the /boot/grub tree. The grubx64.efi is registered in the firmware settings, so we can boot it. You can use the "-v" option with efibootmgr to see if everything is alright. If you need to change the order of some bootloaders, you can use the "-o" option. An example is shown below:
  
Line 115: Line 113:
 efibootmgr -c -g -d /dev/sda -p 2 -w -L "ELILO" -l '\EFI\Slackware\elilo.efi' efibootmgr -c -g -d /dev/sda -p 2 -w -L "ELILO" -l '\EFI\Slackware\elilo.efi'
 </code> </code>
-Just observe that my EFI partition is /dev/sda2; that is why there are "-d /dev/sda" and "-p 2".+Just observe that our EFI partition is /dev/sda2; that is why there are "-d /dev/sda" and "-p 2". These two arguments tell efibootmgr that our EFI partition is the 2nd partition on the device /dev/sda.
  
  
 ===== Ubuntu ===== ===== Ubuntu =====
  
-Installation of Ubuntu is fairly straightforward. We boot into the DVD/USB and proceed with installation, since partitioning has already been done. Just be careful with Ubuntu where it asks where to install it. Ubuntu will detect Windows and will ask whether you want Ubuntu alongside, thus erasing the rest. So, be sure to stay in manual mode as much as possible. Choose "**Something else**" when prompted about the partitions. Also, make sure it detected the EFI partition.+Installation of Ubuntu is fairly straightforward. We boot into the DVD/USB and proceed with installation, since partitioning has already been done. Just be careful with Ubuntu where it asks where to install it. Ubuntu will detect Windows and will ask whether we want Ubuntu alongside, thus erasing the rest. So, be sure to stay in manual mode as much as possible. Choose "**Something else**" when prompted about the partitions. Also, make sure it detected the EFI partition.
  
-At the end of installation, Ubuntu will have installed its GRUB on the EFI partition in directory EFI/ubuntu and it would have run grub-mkconfig.+At the end of installation, Ubuntu will have installed its GRUB on the EFI partition in directory EFI/ubuntu and it would have run **grub-mkconfig** and **efibootmgr**.
  
 ====== Installing rEFInd ====== ====== Installing rEFInd ======
Line 132: Line 130:
 ${VERSION} should be replaced with the version. This command will normally detect the EFI partition and system architecture, and copy the necessary files. It might prompt if it did not get some information automatically. ${VERSION} should be replaced with the version. This command will normally detect the EFI partition and system architecture, and copy the necessary files. It might prompt if it did not get some information automatically.
  
-As for Ubuntu or other Linux distros, refind is most probably part of the official package repositories. Anyway, you only need to install refind on any one distro.+As for Ubuntu or other Linux distros, refind is most probably part of the official package repositories. Anyway, we only need to install refind on any one distro.
  
 ===== rEFInd Manual Install ===== ===== rEFInd Manual Install =====
Line 167: Line 165:
 ===== Tidying up ===== ===== Tidying up =====
  
-== Omit scan volumes ==+== Omit scanning volumes ==
 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
 <code> <code>
Line 173: Line 171:
 </code> </code>
  
-== Omit scan specific directories ==+== Omit scanning specific directories ==
 We do not want refind to detect all the EFI binaries automatically, because then, we will not be able to control the number of entries. So we do not want refind to scan the directories where the EFI binaries are found. refind.conf already has the entry We do not want refind to detect all the EFI binaries automatically, because then, we will not be able to control the number of entries. So we do not want refind to scan the directories where the EFI binaries are found. refind.conf already has the entry
 <code> <code>
Line 180: Line 178:
 We will add the following: We will add the following:
 <code> <code>
-(we need to start begin the list of directories with "+")+(we need to begin the list of directories with "+")
 dont_scan_dirs + EFI/Boot,EFI/Microsoft,EFI/Slackware,EFI/ubuntu dont_scan_dirs + EFI/Boot,EFI/Microsoft,EFI/Slackware,EFI/ubuntu
 </code> </code>
  
-== Omit scan specific files ==+== Omit scanning specific files ==
 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.
 <code> <code>
Line 191: 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 Linux kernels ==
 <code> <code>
 scan_all_linux_kernels false scan_all_linux_kernels false
Line 227: Line 225:
 </code> </code>
  
-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 other binaries we want to appear in the refind menu.+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:
 <code> <code>
 menuentry Windows { menuentry Windows {
-icon EFI/refind/icons/os_win8.png +  icon EFI/refind/icons/os_win8.png 
-loader EFI/Microsoft/Boot/bootmgfw.efi+  loader EFI/Microsoft/Boot/bootmgfw.efi
 } }
 </code> </code>
-Note that we can choose any of the icons from the icons/ directory. The size of icons is 128x128 and are of png format. You can make your own icons.+Note that we can choose any of the icons from the EFI/refind/icons/ directory. Later we describe the use of custom made icons.
  
 -> Entry for Slackware: -> Entry for Slackware:
 <code> <code>
 menuentry Slackware { menuentry Slackware {
-icon EFI/refind/icons/os_win8.png +  icon EFI/refind/icons/os_win8.png 
-loader EFI/Slackware/elilo.efi+  loader EFI/Slackware/elilo.efi
 } }
 </code> </code>
Line 249: Line 247:
 <code> <code>
 menuentry Ubuntu { menuentry Ubuntu {
-icon EFI/refind/icons/os_ubuntu.png +  icon EFI/refind/icons/os_ubuntu.png 
-volume 9f5b153d-d103-4314-bc98-455fa5d0c625 +  volume 9f5b153d-d103-4314-bc98-455fa5d0c625 
-loader EFI/ubuntu/grubx64.efi+  loader EFI/ubuntu/grubx64.efi
 } }
 </code> </code>
Line 257: Line 255:
  
 === Apple Mac === === Apple Mac ===
-For a Mac, refind will automatically detect the EFI binary. It is mos probably named "boot.efi", so just make sure boot.efi is not in the list of files not to scan for. You might also need to place an hfs driver in the EFI/tools directory:+For a Mac, refind will automatically detect the EFI binary. It is most probably named "boot.efi", so just make sure boot.efi is not in the list of files not to scan for. You might also need to place an hfs driver in the EFI/tools directory:
 <code> <code>
 # cp /usr/share/refind-${VERSION}/refind/drivers_x64/hfs_x64.efi /boot/efi/EFI/tools/ # cp /usr/share/refind-${VERSION}/refind/drivers_x64/hfs_x64.efi /boot/efi/EFI/tools/
Line 277: Line 275:
          |_ initrd-4.4.29.gz          |_ initrd-4.4.29.gz
                    
- |_ Ubuntu/+ |_ Ubuntu16.04/
        |_ 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 312: 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 357: 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, holding the booting options, in the same directory as the kernel. For example,+If we have placed a kernel on the EFI partition, like above, we can also place a file called refind_linux.conf, holding the booting options, in the same directory as the kernel. For example,
  
 -> EFI/Slackware14.2/refind_linux.conf : -> EFI/Slackware14.2/refind_linux.conf :
Line 394: 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/options, e.g. EFI shell, memtest, partitioning program, about, shutdown, reboot. We can choose which options to be visible in the menu.+In the refind menu, below the icons for bootloaders and kernels selection, there is a set of icons for useful tools/options, e.g. EFI shell, memtest, partitioning program, about, shutdown, reboot. We can choose which options to be visible in the menu using the **showtools** command:
 <code> <code>
 showtools reboot,shutdown,about showtools reboot,shutdown,about
Line 424: 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 in each entry. So we can make our own icons and place them in directory EFI/refind/icons/. The default type of icons is bmp or png. There are two types of icons, small ones for the non-bootloader options (e.g. shutdown, reboot, ...), and large ones for the bootloaders/kernel entries. All icons are square and default sizes are 48x48 for the small icons and 128x128 for the large icons. All icons must be more than 32x32 in size. The size of icons can be set using:+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/refind/icons/. The default type of icons is bmp or png. There are two types of icons, small ones for the non-bootloader options (e.g. shutdown, reboot, ...), and large ones for the bootloaders/kernel entries. All icons are square and default sizes are 48x48 for the small icons and 128x128 for the large icons. All icons must be more than 32x32 in size. The size of icons can be set using:
 <code> <code>
 large_icon 128 large_icon 128
Line 469: 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 "template" below before saving your new page --> <!-- You must remove the tag-word "template" below before saving your new page -->
-{{tag>howtos uefi efi boot slackware_administration author_aragorn2101 template}}+{{tag>howtos uefi efi boot slackware_administration author_aragorn2101}}
 howtos:slackware_admin:uefi_triple_boot_with_refind_on_slackware ()