This blog post is sourced from the following web site
https://www.linuxfoundation.org/blog/blog/classic-sysadmin-how-to-rescue-a-non-booting-grub-2-on-linux
https://www.linuxfoundation.org/blog/blog/classic-sysadmin-how-to-rescue-a-non-booting-grub-2-on-linux
When you’re at the grub>
prompt, you have a lot of functionality similar to any command shell such as history and tab-completion.
- Use the ls command to list the contents of various partitions
and identify the linux root partition
grub> ls
- The boot/ folder in the root partition would contain the linux
kernel and intrd image (initial ramdisk image)
- Set the root partition, kernel and intrd image using grub> prompt
grub> set root=(hd0,gpt2)
grub> linux /boot/vmlinuz-3.13.0-29-generic root=/dev/sda2
grub> initrd /boot/initrd.img-3.13.0-29-generic
grub> boot
The first line sets the partition that the root filesystem is on. The second line tells GRUB the location of the kernel you want to use. Start typing
/boot/vmli
, and then use tab-completion to fill in the rest. Typeroot=/dev/sdX
to set the location of the root filesystem. Yes, this seems redundant, but if you leave this out you’ll get a kernel panic. How do you know the correct partition? hd0,1 = /dev/sda1. hd1,1 = /dev/sdb1. hd3,2 = /dev/sdd2. I think you can extrapolate the rest.The third line sets the
initrd
file, which must be the same version number as the kernel.The fourth line boots your system.
- When you have successfully booted your system, run these commands to fix GRUB permanently:
sudo update-grub
sudo grub-install /dev/sda
No comments:
Post a Comment