Skip to content

Fix kernel panic after unattended kernel upgrade#3

Open
pnc wants to merge 2 commits into
eleostech:mainfrom
pnc:kernel-panic
Open

Fix kernel panic after unattended kernel upgrade#3
pnc wants to merge 2 commits into
eleostech:mainfrom
pnc:kernel-panic

Conversation

@pnc
Copy link
Copy Markdown
Member

@pnc pnc commented May 15, 2026

The update-initramfs symlink (to /bin/true) made the machine unbootable after updating the kernel (no real surprise there.)

Claude explanation:

When unattended-upgrades installed a new kernel, its postinst called update-initramfs which silently did nothing. GRUB picked up the new vmlinuz but with no initrd line. On next boot the kernel couldn't load virtio_blk (module in initramfs), so the root disk was invisible and it panicked with "VFS: Unable to mount root fs".

Fix: divert only during first-boot provisioning (guarded by boot-finished), then restore in runcmd so future kernel upgrades generate a working initramfs.

Add e2e test that installs a second kernel flavor, verifies the initrd is created, reboots, and confirms the VM comes back on the new kernel.

The update-initramfs diversion (to /bin/true) was permanent — applied
in bootcmd with no restore.  When unattended-upgrades installed a new
kernel, its postinst called update-initramfs which silently did nothing.
GRUB picked up the new vmlinuz but with no initrd line.  On next boot
the kernel couldn't load virtio_blk (module in initramfs), so the root
disk was invisible and it panicked with "VFS: Unable to mount root fs".

Fix: divert only during first-boot provisioning (guarded by
boot-finished), then restore in runcmd so future kernel upgrades
generate a working initramfs.

Add e2e test that installs a second kernel flavor, verifies the initrd
is created, reboots, and confirms the VM comes back on the new kernel.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@pnc pnc requested a review from ddellacosta May 15, 2026 12:05
@pnc
Copy link
Copy Markdown
Member Author

pnc commented May 15, 2026

@ddellacosta I finally had a little time to dig into the kernel panic we both saw. The call was coming from inside the house (overzealous "speed" hack!)

@pnc
Copy link
Copy Markdown
Member Author

pnc commented May 15, 2026

@ddellacosta You will probably want to undivert/unsymlink (per the "Undo" bit) your current VM and re-run update-initramfs so you don't lose your work again.

@ddellacosta
Copy link
Copy Markdown

Gotcha, will give it a shot!

The cloud kernel package name includes the arch suffix
(linux-image-cloud-arm64 vs linux-image-cloud-amd64). Use
dpkg --print-architecture inside the guest to pick the right one.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants