Menu

How to make refind use udated kernel?

2016-03-09
2016-03-20
  • Jason R Keiter

    Jason R Keiter - 2016-03-09

    fat32 efi partition is /dev/sda1. Example linux installation is located at /dev/sda3.
    Kernals located in /dev/sda1/EFI/Xubuntu1510 etc. don't get updated.
    /dev/sda1 gets mounted by /etc/fstab on partition /dev/sda3 directory location /boot.
    Refind loads the kernel located at /EFI/Xubuntu1510 which is mounted at /dev/sda3/boot.
    Kernel that gets updated by ubuntu resides at /dev/sda3/boot NOT /dev/sda3/boot/EFI/Xubuntu1510.
    I have to manually copy the new kernal over to /dev/sda1/EFI/Xubuntu1510. Help?

     
  • Roderick W. Smith

    Most Linux distributions store their kernels in /boot and don't provide any easy mechanism to automatically move kernels elsewhere. For this reason, the easiest way to get rEFInd to pick up new kernels automatically is to have it scan the Linux /boot directory. It does so automatically IF it can read the relevant partition. Satisfying that conditional normally requires using an EFI filesystem driver, usually for ext4fs. rEFInd ships with such a driver, and it should have been installed automatically if you installed rEFInd from Linux using the refind-install script (which is called by the RPM and Debian packages I provide). If you installed using OS X, you must install the driver yourself.

    If you really want to do it the hard way, by copying newly-installed kernels, you may want to check out this Arch Linux wiki page, which describes using systemd to handle the task automatically. I've never used this method, even with Arch Linux, much less with Xubuntu, so I can't help you beyond providing the pointer; but you might be able to get it to work. I suppose you could also set up a shutdown script that looks for changes and copies the kernel if it finds them.

     
  • Jason R Keiter

    Jason R Keiter - 2016-03-10

    My linux installations are on Logical Volumes. It appears from http://www.rodsbooks.com/refind/drivers.html#using - "there's no EFI driver for Linux's Logical Volume Manager (LVM)". So refind cannot scan for installations on logical volumes as the efi driver does not support LVM. So for installations on Logical Volumes I must manually copy kernel updates over to FAT32 efi partition. Am I correct?

     
  • Roderick W. Smith

    Most installations that use LVM also use a separate /boot partition. Certainly this is the default for Ubuntu. Please check that detail. If you don't have a separate /boot partition, then you'll either need to adjust your partitions so that you add one or copy kernels and initrd files manually (or via some sort of automated script). Such copying is awkward, of course.

     
  • Jason R Keiter

    Jason R Keiter - 2016-03-16

    I now have separate boot partitions for each LVM installation of linux and they are mounted at /boot by /etc/fstab for each installation. I copied all the vmlinuz kernels and initrd etc. files from /boot to the corresponding boot partition. Upon boot refind loads vmlinuz-4.2.0-30-generic instead of vmlinuz-4.2.0-34-generic?? I removed the -30 version and now -34 loads as it should. I edited the /efi/refind/refind.conf file and uncommented the scan_all_linux_kernels and changed from false to true. Did the same for fold_linux_kernels true. Still not working?? I have to delete older kernels to force most recent to load. Help!

     
  • Jason R Keiter

    Jason R Keiter - 2016-03-17

    Oops. Missed this in your book. refind picks kernels based on modification time not version numbers. "rEFInd sorts boot loader entries within each directory by time stamp, so that the most recent entry comes first. Thus, if you specify a directory name (or a volume label, for loaders stored in a volume's root directory) as the default_selection, rEFInd will make the most recent loader in the directory the default." For some reason an older kernel version was 2 days newer on the modification time?

     
  • Roderick W. Smith

    Yes, unfortunately rEFInd's use of time stamps is an imperfect solution to the problem of figuring out which kernel should be the default. Unfortunately, I know of nothing else better -- kernel version strings are fairly complex and are therefore difficult to sort properly, especially when you consider differing version string formats across distributions. You might consider filing a bug report with your distribution maintainer on this point. Most distribution maintainers are likely to be unconcerned with this issue, since rEFInd isn't a common boot manager for most of them, but it's worth a shot.

    Note that, if you're using an Ubuntu long-term support (LTS) release, and if you install both the original kernel series (such as 3.13.0 for 14.04) and an updated one (such as 3.19.0), you can end up with kernels from both series installed. You'd probably want the latest 3.19.0 kernel to be your default, but a 3.13.0 kernel might legitimately have a more recent time stamp.

    As a workaround, you could consider writing a script that parses kernel versions and uses touch on the one you want to be the default, using whatever criteria you choose. You could then run this as a shutdown script, so that your preferred kernel has the latest time stamp whenever you shut off the computer.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.