Fix kernel panic after unattended kernel upgrade#3
Open
pnc wants to merge 2 commits into
Open
Conversation
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>
Member
Author
|
@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!) |
Member
Author
|
@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. |
|
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.