0

After attempting to install a built kernel and rebooting I am receiving the error:

mount: mounting UUID=59c56381-e5ec-4a8b-8c2e-f9c6a66d524c on /sysroot failed: No such device

Why is this happening? How can I fix this to boot correctly?

About System

  • Alpine Linux 3.12_alpha20200319 (edge) -- Alpine Linux Virtual
  • Kernel 5.4.31-0-virt
  • Running inside VirtualBox

Kernel Build Steps

wget https://mirrors.edge.kernel/pub/linux/kernel/v5.x/linux-5.4.30.tar.xz
tar -xf linux-5.4.30.tar.xz
cp /boot/config-virt /home/name/build/.config
make -C /home/name/linux-5.4.30 O=/home/name/build listnewconfig
make -j4 -C /home/name/linux-5.4.30 O=/home/name/build
cd /home/name/build
make modules_install

The following steps I am uncertain about:

cp System.map /boot/System.map-virt
cp arch/x86_64/boot/bzImage /boot/vmlinuz-virt
cp .config /boot/config-virt

I don't run make install because it passes arch/x86/boot/bzImage. Because of this, I am GUESSING it is installing 32-bit and 64-bit. So I am trying to install manually instead.

My extlinux.conf file:

DEFAULT menu.c32
PROMPT 0
MENU TITLE Alpine/Linux Boot Menu
MENU HIDDEN
MENU AUTOBOOT Alpine will be booted automatically in # seconds
TIMEOUT 30
LABEL virt
  MENU LABEL linux virt
  LINUX vmlinuz-virt
  INITRD initramfs-virt
  APPEND root=UUID=59c56381-e5ec-4a8b-8c2e-f9c6a66d524c moudles=sd-mod,usb-storage,ext4 quiet rootfstype=ext4

MENU SEPARATOR

Attempts at fixing

(All of below still result in the same error)

  • Running mkinitfs in / directory before reboot
  • Running extlinux --install /boot
  • Running make install in the build directory instead and chaning the extlinux.conf line LINUX vmlinuz-virt to LINUX vmlinuz
  • Tried switching VirtualBox storage controllers to AHCI, virtio-scsi and PIIX4.

May be helpful:

I checked the UUID specified in the error and extlinux.conf. It identifies /dev/sda3. However when I enter the emergency recovery shell after the failed boot and check the /dev directory it is not present. No clue why.

lsmod shows no modules loaded. I assume this shouldn't be happening.

If I continue boot by typing exit I get the kernel panicKernel Panic Screenshot

Files

.config - https://github.com/alpinelinux/aports/blob/master/main/linux-lts/config-virt.x86_64

extlinux.conf - https://pastebin.com/QMkePsqS

mkinitfs.conf - https://pastebin.com/rksn7GcN

0

As mentioned in the post,

lsmod shows no modules loaded. I assume this shouldn't be happening

the problem was because modules were not being loaded into the kernel. The current version of the kernel running was 5.4.31-0-virt wand the version being built was 5.4.30. The modules being installed were being placed into the /lib/modules/5.4.30 directory. This caused the initial ram disk (initramfs) to be built without the correct modules for the kernel and hence not loaded on boot.

To fix this, after installing the kernel modules when building the initramfs the following command should be used instead:

mkinitfs -o /boot/initramfs-virt 5.4.30

This command includes the installed modules for the 5.4.30 kernel in the initramfs instead of defaulting to the uname -r version (in this case 5.4.31-0-virt). The kernel is then able to load the modules -> read the disks -> boot from the required disk.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.