Tuesday, October 13, 2020

 Reinstalling GRUB using a Rescue Disk.

Initial step is to boot to Rescue mode and mount the installed OS to /mnt/sysimage directory as describe in Troubleshooting with Rescue Option.

After you have restored access to your server using a rescue disk, rsinstalling GRUB 2 is just 2 steps process:

Make sure to make the contents of the /mnt/sysimage directory available to the current environment, using the # chroot /mnt/sysimage command. 

 

 

 

 

 

Use the # grub2-install command, followed by the name of the device on which you want reinstall GRUB 2.
For KVM virtual machine, the command is # grub2-install /dev/vda
For physical server/VMware/Virtual Box virtual machine, the command is # grub2-install /dev/sda


Type exit and reboot after successfully reinstalling Grub2.

If your system is in a non-bootable state.  You need to first boot the system to Rescue mode and restore access to your system from the Rescue system.  Next is to mount your server's file system on /mnt/sysimage and using # chroot /mnt/sysimage to make the mounted system image your root image.
From here, just run # grub2-install to install GRUB 2 to the desired installation device. 
For KVM virtual machine, the command is # grub2-install /dev/vda
For physical server/VMware/Virtual Box virtual machine, the command is # grub2-install /dev/sda


No comments:

Post a Comment