Issue:
How can I fix a dual-booting system if I had to reinstall Windows and now I can no longer boot to Red Hat Enterprise Linux?
Resolution:
When Windows is reinstalled, it overwrites the GRUB bootloader in the Master Boot Record (MBR). The next time the system is booted, the usual GRUB menu will no longer be available and the system boots straight to Windows. This can be easily fixed.
Boot from Red Hat Enterprise Linux installation CD #1. At the installation boot prompt, type linux rescue then hit Enter. Follow the instructions as you would in a normal installation process. (There is no need to enable networking.) It will then inquire if you want to search for a Red Hat Enterprise Linux installation. Select Continue and the installer will now attempt to search for the operating system in your drives. If the search is successful, the rescue environment will mount it in /mnt/sysimage. You will be given a minimal shell.
At the shell prompt, do the following:
# chroot /mnt/sysimage# cd /boot/grub# head grub.conf The last command will show something similar to the following:
# grub.conf generated by anaconda## Note that you do not have to rerun grub after making changes to this file# NOTICE: You do not have a /boot partition. This means that# all kernel and initrd paths are relative to /, eg.# root (hd0,1)# kernel /boot/vmlinuz-version ro root=/dev/hda2# initrd /boot/initrd-version.img#boot=/dev/hdadefault=0 Notice the commented line #boot=/dev/hda. This shows where the GRUB bootloader was previously installed. In this case it is in the MBR of the first IDE drive. To restore the bootloader, execute:
# grub-install /dev/hda Reboot the system exiting the shell (twice) by executing:
# exit# exit The original GRUB bootloader should now be restored.
No comments:
Post a Comment