Set up rEFInd to boot Ubuntu directly (no Grub menu displayed)

Josiah

I would like to set up a menuentry in rEFInd to boot directly into Ubuntu, without using GRUB. I would like to keep Grub on hand, however, with a menu entry for that.

I've copied the most recent kernel and refind_linux.conf from /boot/ to /boot/efi/EFI/ubuntu, and created the following refind.conf:

#
# refind.conf
# Configuration file for the rEFInd boot menu
#

timeout 0
screensaver 300
banner mybanner.png
banner_scale fillscreen
scanfor manual,external,optical

menuentry Ubuntu {
    loader /EFI/ubuntu/vmlinuz-3.19.0-31-generic.efi.signed
    icon /EFI/refind/icons/os_linux.png
    ostype linux
    options "root=UUID=92f926f7-19f8-4a2b-9e9a-bf91db475a3c ro initrd=boot\initrd.img-3.19.0-31-generic"
    initrd boot\initrd.img-3.19.0-31-generic
}

menuentry Grub {
    loader /EFI/ubuntu/grubx64.efi
    icon /EFI/refind/icons-backup/os_unknown.png
}

The menuentry for Grub works great, but the menuentry for ubuntu so far only creates kernel panic (blinking capslock key, no boot) with and without the ostype and options. By adding initrd lines, it now just says that it cannot find initrd..., tries again higher up, and dies.

Ideally, I'd also like rEFInd to automatically update the ubuntu entry when the kernel gets upgraded.

As I mentioned, I'm keeping GRUB as well, so I'd be ok with passing control to grub transparently, but I couldn't figure out how to send options directly to grub if that's the recommended way of doing this.

Rod Smith

Unless you have reasons for not using rEFInd's auto-detection that you've not mentioned, you're going about this the wrong way. Namely, you should rely on auto-detection for both the GRUB and direct-boot options. A default install with default options should definitely pick up GRUB automatically. This would be equivalent to your menuentry Grub option, except that the description and icon shown by rEFInd would be different. (You can easily change the icon in a number of ways, as described here.)

Depending on where your kernel is and how you installed rEFInd, your kernels might or might not be auto-detected. If not, the usual solution is to install an EFI filesystem driver for whatever filesystem holds your kernel. Drivers for ext2/3fs, ext4fs, ReiserFS, Btrfs, and a few on which your kernels will likely not appear all ship with rEFInd; and drivers for lots more come in the efifs package. Drop the appropriate driver in the drivers or drivers_x64 subdirectory of your rEFInd installation directory and rEFInd should be able to detect your kernels in their normal location. (Note that rEFInd 0.10.0 made some changes that help when using Btrfs; with earlier versions, you had to add @/boot to the also_scan_dirs line in refind.conf to detect kernels on Btrfs volumes. This is no longer necessary with rEFInd 0.10.0.)

Using auto-detection has some big advantages over what you're trying to do:

  • There's no need to manually copy your kernel; rEFInd should detect them from their normal "homes."
  • When you upgrade your kernel, rEFInd will auto-detect the newly-installed version with no need for re-copying the kernel or updating your configuration file.
  • It's easier. In most cases, auto-detection "just works," or works with minimal extra configuration. (You may need to run mkrlconf in Ubuntu to get the right kernel options to be used in some cases.) The manual initrd= option can be finicky (non-obvious typos and simple mistakes often wreak havoc), but auto-detection of the initrd file is typically flawless on Ubuntu systems.

The biggest disadvantage to auto-detection is that you can't control the name displayed as a prompt for the kernel. IMHO, this is a small price to pay for the advantages.

If you insist on doing it the way you're trying, the problem you're having is caused by the fact that, unless I've missed something, you've copied the kernel, but not the initrd file, to the ESP. The easiest way to get it to work is to copy both files to the same location. You must then specify the initrd file using the same path you use to refer to the kernel. For instance:

menuentry Ubuntu {
    loader /EFI/ubuntu/vmlinuz-3.19.0-31-generic.efi.signed
    icon /EFI/refind/icons/os_linux.png
    ostype linux
    options "root=UUID=92f926f7-19f8-4a2b-9e9a-bf91db475a3c ro"
    initrd /EFI/ubuntu/initrd.img-3.19.0-31-generic
}

Note that you should identify the initrd file either on the options line or on a separate initrd line, not both. (It would probably work with redundant specifications, but I can't guarantee that. At best, it could lead to confusion and/or extra work when you need to modify the settings.)

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다debugcn@gmail.com 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

Grub menu not showing up at boot

분류에서Dev

Grub menu won't show up after updating Ubuntu, can boot only into Windows

분류에서Dev

Accidentally set GRUB_TIMEOUT=0, cannot boot into Ubuntu now

분류에서Dev

boot menu shows up but Ubuntu won't work

분류에서Dev

How to prevent GRUB from appearing after selecting Ubuntu from Windows' Dual Boot menu?

분류에서Dev

How to install Ubuntu dual boot with MacBook Pro refind?

분류에서Dev

Grub: configuration to boot on specific partition without menu

분류에서Dev

Grub takes 45 Secs to show boot menu

분류에서Dev

grub unable to add windows to boot menu

분류에서Dev

Ubuntu 14.04: Boot Repair is not working (No Boot Menu)

분류에서Dev

Can Ubuntu 16.04 / Windows 7 be set up as dual boot on separate HDDs?

분류에서Dev

Macbook Pro Ubuntu install freezes after grub menu

분류에서Dev

(rEFInd) Different icon for Ubuntu Recovery

분류에서Dev

Ubuntu Server Very Slow Boot up

분류에서Dev

Changed by mistake the grub default boot to memtest, now cant get back to the grub menu nor to boot from a live cd

분류에서Dev

No boot menu for Ubuntu 14.04 after dual boot installation

분류에서Dev

Unable to connect (trying to set up SSL in ubuntu)

분류에서Dev

Ubuntu 및 Windows 10 Dual Boot Grub 문제

분류에서Dev

Dual-Boot Windows 10 and Ubuntu, GRUB 2 not booting

분류에서Dev

Dual-boot Windows and Ubuntu laptop stuck on Lenovo screen (no grub)

분류에서Dev

rEFIt-rEFInd-Grub2 ..... Mac에서 Ubuntu 14.10의 "올바른 방법"은 무엇입니까?

분류에서Dev

Ubuntu 16.04 LTS 작업 업데이트 /boot/grub/grub.cfg

분류에서Dev

Blank screen problem in Ubuntu 15.04 after selecting Ubuntu from GRUB menu

분류에서Dev

Can I safely remove grub after installing rEFInd?

분류에서Dev

부팅 옵션을 변경할 때 빈 'Grub Boot Menu'

분류에서Dev

보안 도구 "tiger"에 따른 / boot / grub / menu의 권한

분류에서Dev

rEFInd bypassed on MacBook with Mac, Windows, Ubuntu

분류에서Dev

Dual boot menu not showing after installation of Ubuntu 12.04

분류에서Dev

How to remove "Ubuntu" from Boot Menu after deleting Ubuntu partition in Windows 10 (Dual Boot)

Related 관련 기사

  1. 1

    Grub menu not showing up at boot

  2. 2

    Grub menu won't show up after updating Ubuntu, can boot only into Windows

  3. 3

    Accidentally set GRUB_TIMEOUT=0, cannot boot into Ubuntu now

  4. 4

    boot menu shows up but Ubuntu won't work

  5. 5

    How to prevent GRUB from appearing after selecting Ubuntu from Windows' Dual Boot menu?

  6. 6

    How to install Ubuntu dual boot with MacBook Pro refind?

  7. 7

    Grub: configuration to boot on specific partition without menu

  8. 8

    Grub takes 45 Secs to show boot menu

  9. 9

    grub unable to add windows to boot menu

  10. 10

    Ubuntu 14.04: Boot Repair is not working (No Boot Menu)

  11. 11

    Can Ubuntu 16.04 / Windows 7 be set up as dual boot on separate HDDs?

  12. 12

    Macbook Pro Ubuntu install freezes after grub menu

  13. 13

    (rEFInd) Different icon for Ubuntu Recovery

  14. 14

    Ubuntu Server Very Slow Boot up

  15. 15

    Changed by mistake the grub default boot to memtest, now cant get back to the grub menu nor to boot from a live cd

  16. 16

    No boot menu for Ubuntu 14.04 after dual boot installation

  17. 17

    Unable to connect (trying to set up SSL in ubuntu)

  18. 18

    Ubuntu 및 Windows 10 Dual Boot Grub 문제

  19. 19

    Dual-Boot Windows 10 and Ubuntu, GRUB 2 not booting

  20. 20

    Dual-boot Windows and Ubuntu laptop stuck on Lenovo screen (no grub)

  21. 21

    rEFIt-rEFInd-Grub2 ..... Mac에서 Ubuntu 14.10의 "올바른 방법"은 무엇입니까?

  22. 22

    Ubuntu 16.04 LTS 작업 업데이트 /boot/grub/grub.cfg

  23. 23

    Blank screen problem in Ubuntu 15.04 after selecting Ubuntu from GRUB menu

  24. 24

    Can I safely remove grub after installing rEFInd?

  25. 25

    부팅 옵션을 변경할 때 빈 'Grub Boot Menu'

  26. 26

    보안 도구 "tiger"에 따른 / boot / grub / menu의 권한

  27. 27

    rEFInd bypassed on MacBook with Mac, Windows, Ubuntu

  28. 28

    Dual boot menu not showing after installation of Ubuntu 12.04

  29. 29

    How to remove "Ubuntu" from Boot Menu after deleting Ubuntu partition in Windows 10 (Dual Boot)

뜨겁다태그

보관