CentOS/RHEL 7 now includes GRUB2 which uses a new way of installing to the MBR of your boot device. You may have to reinstall the GRUB2 bootloader if your system is not bootable after a failure. In order to reinstall GRUB2 you have to boot into rescue mode. Follow the steps below to boot into rescue mode and reinstall GRUB2 bootloader.
Booting into rescue mode and reinstalling GRUB2
1. Boot from the RHEL7 installation DVD by altering the boot order in Bios and selecting DVD media as the first booting preference.
Note : Older version of RHEL 7 DVD will not work here. So make sure you have latest version RHEL 7 DVD with you.
2. At the boot screen, Select the Troubleshooting option at the end of the screen.
3. At the next screen, select the option Rescue a CentOS Linux system.
4. On the next screen, press enter to continue. When asked if you would like Rescue to find your installation, choose Continue.
If you run into trouble detecting your install, retry using the Skip option and manually detect and mount your storage. You would get a message shown in the picture below if the rescue mode has detected the correct installation.
5. Next step is to change your root directory to /mnt/sysimage using the chroot command. This makes your system the root environment.
# chroot /mnt/sysimage
6. Use the grub2-install command to re-write the MBR to your boot device. The boot device is usually /dev/sda.
# grub2-install /dev/sda
You should get a successful installation message as shown below.
To reboot the system first exit from the chroot environment and the run reboot command.
Reinstalling grub2 on UEFI-based machines
If you are on an UEFI-based machine, make sure you add the below 2 steps as well before you re-install GRUB2 using “grub2-install” command.
1. If the EFI System Partition has been recreated or damaged, these files can be recovered by reinstalling the grub2-efi, grub2-efi-modules and shim packages.
# yum reinstall grub2-efi grub2-efi-modules shim
2. If /boot/efi/EFI/redhat/grub. cfg has been removed or damaged, it can be restored with the following command:
# grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
Filed Under: CentOS/RHEL 7, Linux
Some more articles you might also be interested in …
- lvcreate/lvremove Failed with Error “Can’t remove merging snapshot logical volume”CentOS/RHEL : How to configure vsftpd to use ports other than the default ports 20 and 21How to shrink root filesystem on CentOS/RHEL 6How to Move Swap From Disk Partition to LVM Volume in LinuxCentOS/RHEL LVM : Backing Up Volume Group MetadataCentOS/RHEL 7 : How to install and configure ftp server (vsftpd)CentOS/RHEL 7 : systemctl replacements of legacy commands service and chkconfigHow to Enable/Disable CPUs (Limiting CPU count) in CentOS/RHELHow to Create a Custom Log File Rotation by logrotate in LinuxHow to Remove/ Disable Bash shell Command History on Linux
- Centos7 Start Error: Entering emergency mode.Exit the shell to continue
- [Solved] Virtual Machine Centos7 Startup Error: Entering emergency mode
- [Solved] RHEL 7 installs Oracle RAC 22.214.171.124, executes root.sh error ohasd: failed to start
- How to fix the ERROR: Failed to build gem native extension in Centos 8
- CentOS: How to Solve Python File Run Error
- Prompt “entering emergency mode. Exit the shell to continue” if the Linux operating system does not start normally
- Centos7.6 vsftpd access error, 500 oops [How to Solve]
- ./configure Command Execute error (Centos7 Install erlang)
- Solutions to errors in installing xunsearch engine in centos8.0
- [Solved] CentOS Use Yum to install dependency: error: rpmdb open failed
- [Solved] Keepalived Configurate Error: Unicast peers are not supported in strict mode
- [Solved] Linux Compile Error: error: ‘for’ loop initial declarations are only allowed in C99 mode
- Centos7 Error: initramfs not found
- linux yum Error: PYCURL ERROR 6 – “Couldn’t resolve host ‘mirrorlist.centos.org’”
- [Solved] Exception in replication between CentOS virtual machine and host
- CentOS 8: No URLs in mirrorlist error [How to Solve]
- CentOS7 Failed to start LSB: Bring up/down networking [How to Solve]
- How to Solve Error: “Hdaudio hdaudioc0d2: unable to bind codec”
- Error report when executing ifconfig under centos7