kernel panic: unable to mount root fs after switching to an nvme drive. is my data gone??

initramfskernel-paniclinux16 replies 路 368 views 路 started
  1. Weird one. After switching to an NVMe drive, my Arch install panics on boot:

    2.481214 VFS: Cannot open root device "sda2" or unknown-block(0,0): error -6

    [    2.481214] VFS: Cannot open root device "sda2" or unknown-block(0,0): error -6
    [    2.481362] Please append a correct "root=" boot option; here are the available partitions:
    [    2.481513] 0b00         1048575 sr0
    [    2.481601]  driver: sr
    [    2.481702] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
    [    2.481843] CPU: 3 PID: 1 Comm: swapper/0 Not tainted
    [    2.481957] Call Trace:
    [    2.482010]  <TASK>
    [    2.482078]  dump_stack_lvl+0x48/0x70
    [    2.482155]  panic+0x118/0x300
    [    2.482231]  mount_block_root+0x1d3/0x1e0
    [    2.482309]  prepare_namespace+0x136/0x165
    [    2.482398] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs ]---
    

    But if i pick the previous kernel under advanced options in GRUB, it boots fine and everything works. So teh disk isnt dead. Whats different about teh new kernel entry? Id like to fix teh new kernel properly instead of picking the old one manually every morning. Im guessing something didnt get generated during the update, but i dont know what to check.

    rage

    9
  2. Does teh previous kernel in GRUBs advanced options boot? ??

    15 0 helpful
  3. ahh right older kernel boots... in /boot the new version has a vmlinuz but no initrd file at all. sorry for the wall of text lol

    5 0 helpful
  4. if the older kernel wont boot either, use your live USB and chroot:

    sudo mount /dev/nvme0n1p2 /mnt
    sudo mount /dev/nvme0n1p1 /mnt/boot/efi
    for d in dev proc sys run; do sudo mount --bind /$d /mnt/$d; done
    sudo chroot /mnt
    

    adjust teh device names to match lsblk, then regenerate the initramfs inside teh chroot.

    1 0 helpful
  5. on Debian, Ubuntu, Mint and Pop!_OS, regenerate it and refresh GRUB:

    sudo update-initramfs -c -k all
    sudo update-grub
    

    on Fedora use sudo dracut --regenerate-all --force. On Arch use sudo mkinitcpio -P.

    9 0 helpful
  6. oof if u changed the disk or partition layout, compare the UUIDs from blkid with /etc/fstab and the root= parameter in your GRUB entry. A stale UUID gives the same panic. good luck man!

    2 0 helpful
  7. oof unknown-block(0,0) usually means the kernel has no initramfs, or the initramfs lacks teh driver for your root disk. Boot the older kernel and check:

    ls -l /boot
    

    If theres a vmlinuz for teh new version without a matching initrd.img / initramfs file, thats it. good luck man!

    12 0 helpful
  8. Your data is almost certainly fine. Before any repair, boot teh live USB and copy the important folders to an external drive lmao It costs ten minutes and removes all teh stress. lmk how it goes

    2 3 helpful
  9. hmmm check that /boot wasnt full during teh update. A full boot partition causes exactly this: teh kernel copies, the initramfs doesnt. df -h /boot and remove old kenrels with your package manager, not by deleting files. hope that helps :)

    3 5 helpful
  10. for me it was the power plan. swapped it and boom, fixed. dumb question but how do i even check teh power plan lmk how it goes

    0 2 helpful
  11. honestly just reset the BIOS and save yourself teh pain 馃し @piad258 did u ever fix it?

    0 1 helpful
  12. oof try turning off teh default config first, fixed it for me. my gaming rig is officially haunted fingers crossed 馃

    4 0 helpful
  13. hmmmm not sure about that some will say reinstall, and honestly if u have a separate /home partition a reinstall is quick, but this specific panic is almost always fixable in a few commands. idk maybe im wrong lol

    lol

    4 0 helpful

Reply to this topic

Sign in or create an account to reply.