Rahul R

Sep 5, 20232 min

Kernal Panic : Unable to mount root fs

If you have encountered an issue with Digital Ocean VPS or any other Ubuntu based VPS Servers the following might be helpful.

At DEIENAMI, we understand that server issues can be a real headache, especially when it comes to boot problems and GRUB (Grand Unified Bootloader) errors. Fear not! We've got a step-by-step guide to help you recover your server in case of such mishaps.

1) First, boot your droplet back into the Recovery ISO then access the Droplet using the console via your Cloud Panel login, or you may access the Recovery ISO via SSH by connecting to your Droplet's IP while it's booted into the Recovery ISO.

2) Once connected to the recovery environment, use option #6 at the Recovery menu to be placed at a root BASH shell where the remaining steps can be performed.

3) Mount your Droplet's disk by issuing the below commands, one at a time:

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

4. Attempt to chroot into the filesystem you've just mounted:


 
chroot /mnt/
 

5. Reinstall the GRUB bootloader:


 
grub-install /dev/vda
 
update-grub
 

6. Navigate back to the Cloud panel, switch the Droplet back to booting from its own Hard Disk, and then power the Droplet off/on. If all went well, your Droplet should be able to boot normally. If you encounter any issues or errors during this process, please let us know, and don't forget to share screenshots demonstrating any problems you face. We're here to help and provide additional guidance.

While you do the above you might see the following error.

error:/usr/lib/grub/i386-pc/modinfo.sh doesn't exist. Please specify target or --directory.

I would recommend below steps by installing grub-pc:

$ sudo apt-get install grub-pc


 
After this, items under /usr/lib/grub change from:

grub-mkconfig_lib x86_64-efi x86_64-efi_signed
 
To:
 
grub-mkconfig_lib i386-pc x86_64-efi

    140
    0