0

I was sent here from another forum. I'll repeat my entire post here for completeness:

I'm trying to get refind to boot the Lubuntu kernel directly instead of maintaining the manual config and using grub in between. For some reason though, refind only finds the grubx64.efi file (on the ESP), but never the kernel files (on Lubuntu's own partition). I have a virtualbox set up with refind and arch installed, where refind does find the arch kernel directly. Its configuration is the same so I don't know why detecting the kernel doesn't work on the real machine.

UEFI, GPT disks, secure boot off. File permissions are the same, drivers for the file systems are installed (btrfs).

File details Arch virtualbox

  • /boot:

    /boot

  • refind_linux.conf:

    "Boot with standard options" "rw root=UUID=ab4286d4-fe06-453a-8bdf-0b52f53639ee "
    "Boot to single-user mode" "rw root=UUID=ab4286d4-fe06-453a-8bdf-0b52f53639ee single"
    "Boot with minimal options" "rw root=UUID=ab4286d4-fe06-453a-8bdf-0b52f53639ee"
    
  • refind.conf:

    scanfor internal
    also_scan_dirs boot
    

Win8/Lubuntu dualboot real machine

  • /boot:

    /boot

  • refind_linux.conf:

    "default" "rw root=UUID=d1570108-1546-4109-ba6c-5bb35b71c20b" #uuid from gparted for /
    
  • refind.conf:

    #graphics omitted
    use_graphics_for linux, windows, osx, grub
    scanfor internal
    also_scan_dirs boot
    scan_all_linux_kernels 1
    

Any help in finding out why Lubuntu kernels don't show up directly under refind would be much appreciated. :)

1 Answer 1

1

Your problem is caused by Btrfs quirks. Because it supports subvolumes, it's often necessary to specify unusual options to get rEFInd to scan the right subdirectory and to get the kernel to recognize the right location as its root.

To get rEFInd to scan the kernels, you must add the following line to refind.conf:

also_scan_dirs +,@/boot

This assumes that you do not have a separate /boot partition. (My guess is it would be +,@ if you have such a partition, but I've never tried that.) If this doesn't work, you could open an EFI shell and use it to try to find your kernels, then add whatever their location is in a similar way. This might not be necessary in Arch because Arch and Ubuntu might set up their Btrfs volumes in different ways.

With that change in place, rEFInd should detect your kernels, but attempting to boot them will fail. This problem can be overcome by making changes to your /boot/refind_linux.conf file. In particular, you must add the following to the boot options:

rootflags=subvol=@

Be sure to add that in addition to the normal root={whatever} and any other kernel options you use.

Also, be sure that the EFI driver for Btrfs is present in the rEFInd drivers or drivers_x64 subdirectory. I realize you mentioned that drivers are installed, but it wasn't 100% clear that you meant the EFI driver, so I want to make that explicit.

1
  • worked like a charm! Thanks Rod! I honestly think rEFInd is one of the most enjoyable pieces of software I've ever used :)
    – user435508
    Aug 1, 2015 at 20:32

You must log in to answer this question.