-   Slackware (
-   -   How to boot Slackware using Grub EFI (

arubin 11-03-2012 04:00 PM

How to boot Slackware using Grub EFI
I have now got Slackware 14.0 booting using grub.efi. The advantage of this for me over elilo or my previous setup ( which was grub installed to the MBR of a second hard disk ) is that by default it brings up a menu and it will boot Windows. So far I have the boot disk on USB but the next stage when I am brave enough is to put this on by hard drive

What I did was as follows:
Follow the instructions here to create the usb stick. That is partition the USB drive with a GPT scheme having a FAT32 partition type code EF00

Add an ./EFI/BOOT/ structure to the drive.

Install grub2 using the slackbuild but modifying it by adding

--with-platform=efi \
to ./configure

I then followed some of the instructions here

Mount the usb at /boot/efi


# mount /dev/sdc1 -t vfat /boot/efi
# modprobe dm-mod
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug
# mkdir -p /boot/grub/locale
# cp /usr/share/locale/en\@quot/LC_MESSAGES/ /boot/grub/locale/
Configure grub.cfg with

grub-mkconfig -o /boot/grub/grub.cfg
This process created a file on the USB stick
/EFI/arch_grub/grubx64.efi. I found that my UEFI system was not seeing that so I copied it to /EFI/BOOT/bootx64.efi

I now was able to boot using UEFI from the USB via a grub menu. Grub.cfg needed manual editing to get the generic kernel as default and to add Windows.

This needs a little polishing up but I hope that people find it useful.


wildwizard 11-03-2012 04:15 PM


Originally Posted by arubin (Post 4821585)
/EFI/arch_grub/grubx64.efi. I found that my UEFI system was not seeing that so I copied it to /EFI/BOOT/bootx64.efi

There are only certain directories that are checked for. Not sure on a full list but it can be found somewhere.

Using "BOOT" is a good default choice as it is pretty generic.

arubin 11-03-2012 07:00 PM

I am looking into booting of the hard drive. I have added my grubx86.efi as /efi/Slackware/bootx64.efi but that is not seen by my UEFI setup. I have managed to get into an efi shell and it seems that all it sees on the hard drive is /efi/microsoft/boot/bootmgr.efi

My alternatives are either to:
overwrite this with grubx86.efi
to figure out how to add the option to the efi boot manager using the efi shell
install efibootmgr and figure out how to do it with that.

arubin 11-04-2012 06:30 AM

So to get my UEFI system to see my new option for booting with grubx86.efi

Download efibootmger from here

untar it, change into the folder and run make
Copy src/efibootmgr/efibootmgr into /usr/sbin (I chowned it to root as well)

To do the rest one must have booted using UEFI

Mount the efi partition to /boot/efi


mount /dev/sdXy -t vfat /boot/efi
where X = drive and y = partition


modprobe efivars

efibootmgr -c -g -d /dev/sdX -p Y -w -L "Linux" -l '\EFI\Slackware\bootx64.efi'
where X = drive and y = partition

On next reboot Linux with grubx64.efi come up as an option on the boot menu.

All times are GMT -5. The time now is 09:33 AM.