Skip to content

Instantly share code, notes, and snippets.

@reytech-dev
Created July 21, 2021 09:18
Show Gist options
  • Save reytech-dev/b47c3a120cafff80a602fa6db199e17f to your computer and use it in GitHub Desktop.
Save reytech-dev/b47c3a120cafff80a602fa6db199e17f to your computer and use it in GitHub Desktop.
Centos7 - No filesystem could mount root

Centos7 - Kernel Panic on boot: No filesystem could mount root

This issue is mostly caused through a failed kernel update. So far I experienced it only if the yum update transaction got interrupted.

How to fix

(tested with CentOS 7 and a Digital Ocean droplet)

  1. Boot Droplet with "Recovery ISO" (https://cloud.digitalocean.com/droplets/YOUR-ACCOUNT-ID/recovery?i=YOUR-DROPLET-ID)
  2. Mount required volumes
mount /dev/vda1 /mnt
mount --bind /dev /mnt/dev
mount --bind /dev/pts /mnt/dev/pts
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
  1. Chroot into root:
chroot /mnt/
  1. Re-install used kernel (Please update the command according to your kernel version, can be found in /boot/grub/grub.conf)
yum reinstall kernel-3.10.0-1160.31.1.el7
  1. Reboot with "Hard Drive" (https://cloud.digitalocean.com/droplets/YOUR-ACCOUNT-ID/recovery?i=YOUR-DROPLET-ID)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment