Recently I installed rEFInd on my Elitebook 8530w. I'm using Windows 7 and Ubuntu 12.10. The switch from BIOS/MBR boot loader to UEFI was a fight, but in the end everything worked! I copied the linux kernel to the EFI system partition and boot them using rEFInd and a custom refind_linux.conf.
Now my question: Since kernel updates land in /boot on my root partition (which is ext4 formatted) the boot manager only sees my manually copied kernel. Are there any scripts around to copy the kernel directly to the ESP partition?
Thanks for ideas,
Stefan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The cleanest solution, and the one that applies most broadly to most systems, is to begin using your ESP as your /boot partition. This is pretty easy to do (do all of this as root):
Begin with your ESP mounted at /boot/efi.
Check your /boot directory to be sure it contains no links or other files that rely on Unix/Linux-style permissions or ownership. If it does, don't proceed, or at least research these files further to determine if you can work around the need for such permissions and ownership.
Type mv /boot/* /boot/efi. You'll see an error message about being unable to move /boot/efi into itself. Ignore this.
Type umount /boot/efi.
Edit /etc/fstab and change the mount point for /boot/efi to /boot.
Type mount -a to re-mount everything, including /boot. Check that your normal /boot files are all present, along with the new /boot/EFI directory, which holds what used to be /boot/efi/EFI. If something seems to be missing, then you should try to correct the problem.
Copy the refind_linux.conf file you created from /boot/EFI/ubuntu/ (or wherever you placed it) to /boot.
Check your refind.conf file (presumably in /boot/EFI/refind) to be sure that the scan_all_linux_kernels line is uncommented.
Optionally, type cd /boot/EFI/refind/icons/os_ubuntu.icns /boot/.VolumeIcon.icns to give loaders in /boot an Ubuntu icon.
Reboot to test it.
Set up in this way, your kernels will be dropped into the root of the ESP, where rEFInd will detect them automatically, so no copying is required. The main drawback is that this makes them vulnerable to damage or erasure should some other OS decide to erase the ESP. Thus, making a backup of /boot from time to time makes sense.
You could do a variant of this with another partition that uses ext2fs, ext3fs, or ReiserFS, and add appropriate EFI drivers for that filesystem. This would require you to create a new partition, though.
The method you inquired explicitly about is also possible, but the details vary from one distribution to another. Certain Arch Linux users have come up with this procedure, but that's designed for systemd, whereas Ubuntu uses Upstart, so it would have to be adapted. I can't say I've looked into this approach in more detail, since I designed rEFInd explicitly so that it wouldn't be necessary if the system were configured so that the EFI can read Linux's /boot directory -- a goal that's easily achieved with a little forethought or a little more after-the-fact reconfiguration.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
Recently I installed rEFInd on my Elitebook 8530w. I'm using Windows 7 and Ubuntu 12.10. The switch from BIOS/MBR boot loader to UEFI was a fight, but in the end everything worked! I copied the linux kernel to the EFI system partition and boot them using rEFInd and a custom refind_linux.conf.
Now my question: Since kernel updates land in /boot on my root partition (which is ext4 formatted) the boot manager only sees my manually copied kernel. Are there any scripts around to copy the kernel directly to the ESP partition?
Thanks for ideas,
Stefan
The cleanest solution, and the one that applies most broadly to most systems, is to begin using your ESP as your /boot partition. This is pretty easy to do (do all of this as root):
/boot/efi
./boot
directory to be sure it contains no links or other files that rely on Unix/Linux-style permissions or ownership. If it does, don't proceed, or at least research these files further to determine if you can work around the need for such permissions and ownership.mv /boot/* /boot/efi
. You'll see an error message about being unable to move/boot/efi
into itself. Ignore this.umount /boot/efi
./etc/fstab
and change the mount point for/boot/efi
to/boot
.mount -a
to re-mount everything, including/boot
. Check that your normal/boot
files are all present, along with the new/boot/EFI
directory, which holds what used to be/boot/efi/EFI
. If something seems to be missing, then you should try to correct the problem.refind_linux.conf
file you created from/boot/EFI/ubuntu/
(or wherever you placed it) to/boot
.refind.conf
file (presumably in/boot/EFI/refind
) to be sure that thescan_all_linux_kernels
line is uncommented.cd /boot/EFI/refind/icons/os_ubuntu.icns /boot/.VolumeIcon.icns
to give loaders in/boot
an Ubuntu icon.Set up in this way, your kernels will be dropped into the root of the ESP, where rEFInd will detect them automatically, so no copying is required. The main drawback is that this makes them vulnerable to damage or erasure should some other OS decide to erase the ESP. Thus, making a backup of /boot from time to time makes sense.
You could do a variant of this with another partition that uses ext2fs, ext3fs, or ReiserFS, and add appropriate EFI drivers for that filesystem. This would require you to create a new partition, though.
The method you inquired explicitly about is also possible, but the details vary from one distribution to another. Certain Arch Linux users have come up with this procedure, but that's designed for systemd, whereas Ubuntu uses Upstart, so it would have to be adapted. I can't say I've looked into this approach in more detail, since I designed rEFInd explicitly so that it wouldn't be necessary if the system were configured so that the EFI can read Linux's /boot directory -- a goal that's easily achieved with a little forethought or a little more after-the-fact reconfiguration.