2

I have two Archlinux installations on an EFI system set up with gummiboot. One is rooted at /dev/sda2, the other at /dev/sdb1. Both use /dev/sda1, the EFI system partition, as their /boot partition, but place their kernel images in different locations:

/boot/loader/entries/arch.conf:

title   Arch Linux
linux   /vmlinuz-linux
initrd  /intel-ucode.img
initrd  /initramfs-linux.img
options root=/dev/sda2 rw

/boot/loader/entries/arch-here.conf:

title   HERE Arch Linux
linux   /here-img/vmlinuz-linux
initrd  /here-img/intel-ucode.img
initrd  /here-img/initramfs-linux.img
options cryptdevice=/dev/sdb1:cryptroot root=/dev/mapper/cryptroot rw

This was fine until I updated the kernel from 4.8.13 to 4.9 on sdb. The next time I booted into sda, it failed with

Warning: /lib/modules/4.8.13-1-ARCH/modules.devname not found
...
ERROR: device '/dev/sda2 not found. Skipping fsck.
...

I booted back into sdb, reinstalled kernel 4.8.13, and found I could boot into sda again. However, now I could no longer boot into sdb, as it failed to load the encrypt hook needed to open /dev/sdb1.

I resolved this by chrooting into /dev/sdb1 from sda and installing 4.9 again. This allowed me to boot into sdb but not sda.

Now I'm stuck in a loop where I need to rebuild my kernel image every time I want to switch between installations. It seems that the two kernels are interfering somehow.

Here are the steps I go through on my sda install every time I want to boot into sdb:

sudo cryptsetup open /dev/sdb1 cryptroot
sudo mount /dev/mapper/cryptroot /mnt/
sudo mount /dev/sda1 /mnt/boot/
chroot /mnt/
sudo pacman -U /var/cache/pacman/pkg/linux-4.8.13-1-x86_64.pkg.tar.xz /var/cache/pacman/pkg/nvidia-375.20-3-x86_64.pkg.tar.xz /var/cache/pacman/pkg/nvidia-utils-375.20-3-x86_64.pkg.tar.xz

The steps I go through on sdb when I want to move to sda are similar, but fails with

/lib/modules/4.8.13-1-ARCH is not a valid kernel module directory

I resolve this by symlinking /lib/modules/4.9-1-ARCH to /lib/modules/4.8.13-1-ARCH.

I'm sure I'm doing at least one, if not many things wrong here (that symlink seems like a horrible hack). It seems like my kernels are interfering somehow. How can I fix this?

1 Answer 1

1

I managed to get some help on the Arch forums and wanted to share it here.

Although each system was writing to a different initramfs image, both were overwriting the same kernel. The linux package included in the repos always places the image at /boot/vmlinuz-linux. There were a few options discussed:

  1. Install a different mainline linux package on one system.
  2. Build a custom linux package from the AUR that renames the kernel.
  3. Use a separate EFI partition for each system.

I went with 1, as it seemed the simplest. Installing linux-lts instead of linux on one system prevented the kernels from interfering. The boot entries now look like this:

/boot/loader/entries/arch.conf

title   Arch Linux
linux   /vmlinuz-linux
initrd  /intel-ucode.img
initrd  /initramfs-linux.img
options root=/dev/sda2 rw

/boot/loader/entries/arch-here.conf

title   HERE Arch Linux
linux   /vmlinuz-linux-lts
initrd  /initramfs-linux-lts.img
options cryptdevice=/dev/sdb1:cryptroot root=/dev/mapper/cryptroot rw

Note that nvidia users who want to take this approach will need to install nvidia-lts instead of nvidia.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .