grub damaged boot up GRUB 2 startup prompt solution

  • 2020-05-15 03:20:06
  • OfStack

If set incorrectly, GRUB 2 May fail to load and then enter the startup prompt. To solve this problem, follow these steps:

1. List the drives identified by GRUB 2:

grub2 > ls

2. For a 3-partition dos partition table /dev/sda, the output looks like:

(hd0) (hd0,msdos3) (hd0,msdos2) (hd0,msdos1)

3. For a four-partition gpt partition table /dev/sda, the output looks like:

(hd0) (hd0,gpt4) (hd0,gpt3) (hd0,gpt2) (hd0,gpt1)

4. With this information you can probe and locate your vmlinuz and initramfs files in each partition of the drive:

ls (hd0,1)/
The files under /dev/sda1 will be listed. If the partition contains /boot, the output shows the full names of vmlinuz and initramfs.

5. With the address and full vmlinuz and initramfs names, you can start your system.

Declare your root partition:

grub > set root=(hd0,3)

Declare the kernel you want to use:

grub > linux (hd0,1)/vmlinuz-3.0.0-1.fc16.i686 root=/dev/sda3 rhgb quiet selinux=0
Note: add additional kernel parameters as needed
Note: change content against your own system

5c. Declare the initrd to be used:

grub > initrd (hd0,1)/initramfs-3.0.0-1.fc16.i686.img
Note: change content against your own system

5d. Notify GRUB 2 to launch the selected file:

grub > boot

6. After startup, open 1 terminal.

7. Use the grub2-mkconfig command to recreate the grub.cfg file required to start the grub 2 system:

grub2-mkconfig -o /boot/grub2/grub.cfg

8. Use the grub2-install command and install grub 2 to your hard drive according to the not allowed configuration:

grub2-install --boot-directory=/boot /dev/sda
Note: your drive may have a different device name. Output the check using the mount command.

Other GRUB 2 problems

Missing floppy disks: 1 some users have reported that the installation of GRUB 2 into the partition boot sector may fail if the computer floppy disk controller is active in BIOS but does not have an actual floppy disk. One possible alternative is to run from rescue mode (after system installation) :

grub2-install < target device > --no-floppy


Related articles: