You are not logged in.
A while ago I got a new Lenovo desktop (an H3050), and since UEFI seems to be where everything's headed, I tried to go with a pure UEFI bootloader, using rEFInd.
There was much struggle, and when the dust cleared I was able to boot. But I'm not able to upgrade my kernel -- when the images are updated, they go into the wrong place (or something).
The problem seems to be that I don't really know where the images and the config files are meant to go. Simply running refind-install did not work, it resulted in an unbootable system (couldn't find my root partition). My understanding of this Lenovo desktop is that the boot stuff has to be located in /boot/EFI/Boot, but I'm not sure about that.
The embarrassing truth is that I made it "work" by copying the linux images and the refind configuration files all over the place: both into /boot and into /boot/EFI/Boot. I actually don't know which of these images I'm running right now. I also edited /etc/mkinitcpio.d/linux.preset to read:
ALL_config="/etc/mkinitcpio.conf"
ALL_kver="/boot/EFI/Boot/vmlinuz-linux"
PRESETS=('default' 'fallback')
#default_config="/etc/mkinitcpio.conf"
default_image="/boot/EFI/Boot/initramfs-linux.img"
#default_options=""
#fallback_config="/etc/mkinitcpio.conf"
fallback_image="/boot/EFI/Boot/initramfs-linux-fallback.img"
fallback_options="-S autodetect"
I thought this was necessary to put the image in the correct location. But Linux updated recently, and I got the whole "No modules were added to the image. This is probably not what you want". And then: "errors were encoutered during the build. The image may not be complete." The messages from that build do show that the images are being placed in /boot/EFI/Boot.
Further confusing the issue is that the refind.conf configuration file I'm trying to use seems to be ignored, whether I put it in /boot or in /boot/EFI/Boot. I'm just trying to switch to the text-only interface, but it's not getting picked up. I've got the same refind_linux.conf file in both /boot and /boot/EFI/Boot, and that must be getting picked up correctly otherwise the machine wouldn't have booted last time at all, but I don't know which of them is in effect.
In essence, I have made a bit of a mess. The kernel packages have updated, and now I can't reboot because I know it won't find the correct image. (The last time this happened it took a couple hours with an install USB and chroot and random copying to make it work.) I'm hoping someone can tell me where all these files are really supposed to be, and how I can set things up so that further kernel updates don't require manual intervention.
Thank you...
Eric
Offline
For me the refind-install did not work properly. However it was easy enough to install it by hand:
1) Copy the /usr/share/refind directory to the efi partition (in my system I can in fact use any FAT partition, but it is not guaranteed to work everywhere).
2) remove the drivers you don't need.
3) Put a refind.conf in the same directory as the refind efi binary. As an example here is mine:
timeout 5
scanfor manual
textonly true
textmode 1024
showtools shell, memtest, gdisk, apple_recovery, mok_tool, shutdown, reboot, firmware
default_selection ArchLinux
menuentry "ArchLinux" {
volume 71bd290b-d32a-4463-b4d7-99ee7c761af4
loader /boot/vmlinuz-linux
options "root=UUID=b61e88c7-153f-456b-9aac-421fc128b08a ipv6.disable=1 rw initrd=/boot/intel-ucode.img initrd=/boot/initramfs-linux.img"
submenuentry "Force fsck" {
add_options "fsck.mode=force"
}
submenuentry "Text mode" {
add_options "systemd.unit=multi-user.target nomodeset"
}
}
menuentry "System Rescue CD" {
volume 71bd290b-d32a-4463-b4d7-99ee7c761af4
loader /boot/sysrcd/isolinux/rescue64
options "subdir=/boot/sysrcd setkmap=be docache video=HDMI-A-1:d radeon.audio=0 initrd=/boot/sysrcd/isolinux/initram.igz"
}
menuentry "Windows 7" {
loader /efi/Microsoft/Boot/bootmgfw.efi
}
You can boot a kernel that reside in another directory as the refind binary, including in an ext4 partition, the volume key is the guid of the partition wanted.
4) Register the refind binary to appear in the UEFI boot manager. You must alraedy be running linux in efi mode for doing so, see: https://wiki.archlinux.org/index.php/Un … _Interface.
Last edited by olive (2015-04-08 08:23:38)
Offline
Thanks olive! Just to help me out a little further, can you tell me your value for "efi partition" and also "efi binary"? Which partition/directory is that, exactly, and what's the name of your binary? Also, did you need to adjust the mkinitcpio configuration files at all?
I think I'm coming up against the issue that my machine requires certain values for the above...
Thanks again
Last edited by girzel (2015-04-08 10:28:33)
Offline
@OP: Your motherboard can only read files on the EFI system partition.
Please post the output of:
lsblk -f
Jin, Jîyan, Azadî
Offline
Just to be clear, the motherboard does read files on the EFI system partition, and reads them successfully, it's just that I don't know where on the partition to place those files, and how to make sure that, when the kernel is updated, the new kernel files are placed in the correct location.
NAME FSTYPE LABEL UUID MOUNTPOINT
sda
└─sda1 crypto_LUKS 5bb93ec5-2ac0-44fd-a794-4bf9cc9c36c8
└─home ext4 6b15d18c-ceec-47d4-8e1b-494ab976e2b3 /home
sdb
├─sdb1 vfat 5D17-5190 /boot
├─sdb2 swap 5ff8fbde-720e-4c32-b0aa-06dcd62746ed [SWAP]
└─sdb3 ext4 aa0db1dc-3217-4e13-b0c4-5911637318b9 /
The /boot partition works fine, it's just a matter of where on the partition the kernel images and refind conf files are supposed to go...
Offline
The kernel image & initramfs are usually placed in /boot
As you already have /boot mounted to the ESP that should be fine.
You shouldn't have to modify /etc/mkinitcpio.conf
What is the output of:
# efibootmgr -v
Jin, Jîyan, Azadî
Offline
The efi partition is the partition of type ef00 (use gdisk for partitioning). Normally you have to use gpt partitions (hence gdisk, not fdisk) for UEFI but some motherboards accept MBR partitions too. Put the whole refind directory wherever you want in the efi partion and register the refind binary (refind_x64.efi) with efibootmgr, see: https://wiki.archlinux.org/index.php/REFInd for an example. You have to put refind.conf in the same directory as the refind binary.
The kernel and initrd are specified in refind.conf. You can use the volume keyword as in my example to load a kernel that resides in a different directory than the efi partition. After the volume keyword, set the GUID of the partition or the filesystem label. Refind will load the specified file from the specified partition when it boot. You can update the kernel without changing the configuration as long as it have the same name (it is the case for kernel updates in Archlinux). You do not have to use a special initrd.
Last edited by olive (2015-04-08 13:25:28)
Offline
What is the output of:
# efibootmgr -v
Here goes:
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0000,0001,0009,0004,0007,0008
Boot0000* rEFInd HD(1,800,31801,558428ba-e9d6-4131-81b9-36cd942b8e7c)File(\EFI\refind\refind_x64.efi)
Boot0001* Arch Linux HD(1,800,31801,558428ba-e9d6-4131-81b9-36cd942b8e7c)File(\EFI\Boot\vmlinuz-linux)r.o.o.t.=./.d.e.v./.s.d.b.3. .r.w. .i.n.i.t.r.d.=./.E.F.I./.B.o.o.t./.i.n.i.t.r.a.m.f.s.-.l.i.n.u.x...i.m.g.
Boot0004* KINGSTON SV300S37A60G BIOS(2,0,00)..BO
Boot0007* WDC WD5000AAKX-08U6AA0 BIOS(2,0,00)..BO
Boot0008* Generic Flash Disk 8.07 BIOS(2,0,00)..BO
Boot0009* UEFI: Generic Flash Disk 8.07 ACPI(a0341d0,0)PCI(1a,0)USB(1,0)USB(2,0)HD(1,fc,f800,612a5c68)..BO
/dev/sdb3 is my root partition. I dont quite know what the rest of the stuff is doing there (KINGSTON and the flash disks -- maybe that was the install disk I had in when I was trying to fix my setup?).
Do I really not need to have the images/refind.conf stuff in /boot/EFI/Boot? I'll give it a shot, putting everything diretly under /boot, but I'd like to get as much information as I can before I potentially brick my machine for another afternoon...
Thanks again to all!
Offline
BootCurrent: 0000 Timeout: 1 seconds BootOrder: 0000,0001,0009,0004,0007,0008 Boot0000* rEFInd HD(1,800,31801,558428ba-e9d6-4131-81b9-36cd942b8e7c)File(\EFI\refind\refind_x64.efi) Boot0001* Arch Linux HD(1,800,31801,558428ba-e9d6-4131-81b9-36cd942b8e7c)File(\EFI\Boot\vmlinuz-linux)r.o.o.t.=./.d.e.v./.s.d.b.3. .r.w. .i.n.i.t.r.d.=./.E.F.I./.B.o.o.t./.i.n.i.t.r.a.m.f.s.-.l.i.n.u.x...i.m.g. Boot0004* KINGSTON SV300S37A60G BIOS(2,0,00)..BO Boot0007* WDC WD5000AAKX-08U6AA0 BIOS(2,0,00)..BO Boot0008* Generic Flash Disk 8.07 BIOS(2,0,00)..BO Boot0009* UEFI: Generic Flash Disk 8.07 ACPI(a0341d0,0)PCI(1a,0)USB(1,0)USB(2,0)HD(1,fc,f800,612a5c68)..BO
Boot0000 is to launch refind. Boot0001 is to bot the linux kernel directly without additional boot manager (don't know if there are correctly configured). Boot0004 is to boot the harddisk in bios mode. Boot0007 is to boot another hard disk in Bios mode, Boot0008 is to boot some "fash disk" (usb key, card?) in Bios mode and Boot0009 is to boot the same flash disk in UEFI mode (the default \EFI\BOOT\BOOTX64.EFI ). It is normal for the firmaware to autodetect hard disk and to put some entry automatically.
Do I really not need to have the images/refind.conf stuff in /boot/EFI/Boot? I'll give it a shot, putting everything diretly under /boot, but I'd like to get as much information as I can before I potentially brick my machine for another afternoon...
You have to place them in the efi partition or possibly in another FAT partition (depends of your firmware). Although you can reconfigure this, it is best not to alter the structure of the refind directory. refind.conf must be in the same directory as refind_x64.efi. If you do not configure an entry, the firmware normally boot <efi partition>/efi/boot/bootx64.efi by default (you can use this if for some reason you are unable to add a correct firmware entry, it is usually used to make a UEFI bootable image, such as CD usb key, etc...).
Last edited by olive (2015-04-09 06:43:56)
Offline
@OP, dont get too confused with refind and folder locations and mounts. it's very straight forward.
Put your kernel images (vmlinuz, initrd) wherever you want on the EFI partition
you should have a "refind" folder in your EFI with a refind.conf in there
At he end of that file is a list of static boot order entries, along with examples. Edit one of those, and point it to your kernel files.
Done
An example of my refind.conf entry for Arch:
menuentry Arch {
icon /EFI/refind/icons/os_arch.png
loader EFI/arch/vmlinuz-linux-ck.efi
initrd EFI/arch/initramfs-linux-ck.img
options "rw root=/dev/sda2 quiet splash initrd=intel-ucode.img"
enabled
}
Once you have that working, have a look at https://wiki.archlinux.org/index.php/EF … tcpio_hook to automatically copy over any updated kernel files to the right location
Last edited by surfatwork (2015-04-09 09:00:15)
Offline
Actually using the refind the kernel images not necessarily have to be on the efi partition. I have a separate /boot partition where the kernel images go and update automatically.
using a manual stanza for refind using the volume option to locate the kernel. This way I don't need any special hooks.
Did you know there is a wiki page for refind?
I put at button on it. Yes. I wish to press it, but I'm not sure what will happen if I do. (Gune | Titan A.E.)
Offline
true, you could do that too.
Offline
Thanks everyone -- I'm going to clear my schedule a little bit (in anticipation of the worst!), and give this a shot tomorrow.
Offline
Okay, after one false step, it's up and running. Thanks again to everyone. I had psyched myself out a little bit (there's too much documentation!), but have it under control now. For posterity, the relevant portions of my /boot partition now look like this:
/boot
├── EFI
│ ├── refind
│ │ ├── bootx64.efi
│ │ ├── drivers
│ │ │ └── ext4_x64.efi
│ │ ├── refind.conf
│ └─└── refind_x64.efi
├── initramfs-linux-fallback.img
├── initramfs-linux.img
├── refind_linux.conf
└── vmlinuz-linux
One of bootx64.efi and refind_x64.efi is redundant, but I'm not messing with it.
The relevant part of refind.conf:
menuentry Linux {
volume 3
loader /boot/vmlinuz-linux
initrd /boot/initramfs-linux.img
options "ro root=UUID=aa0db1dc-3217-4e13-b0c4-5911637318b9"
}
And then refind_linux.conf:
"Boot with standard options" "ro root=UUID=aa0db1dc-3217-4e13-b0c4-5911637318b9 "
"Boot to single-user mode" "ro root=UUID=aa0db1dc-3217-4e13-b0c4-5911637318b9 single"
"Boot with minimal options" "ro root=UUID=aa0db1dc-3217-4e13-b0c4-5911637318b9"
Thanks again!
Offline