Reinstalling the Boot Loader on CentOs 5.x January 31, 2011Posted by Tournas Dimitrios in Linux.
In many cases, the GRUB boot loader can mistakenly be deleted, corrupted, or replaced by other operating systems (during a dual boot installation ) .
The following steps detail the process on how GRUB is reinstalled on the master boot record:
- Boot the system from an installation boot medium.
- Type linux rescue at the installation boot prompt to enter the rescue environment.
- Type chroot /mnt/sysimage to mount the root partition.
- Type /sbin/grub-install /dev/hda to reinstall the GRUB boot loader, where /dev/hda is the boot partition.
- Review the /boot/grub/grub.conf file, as additional entries may be needed for GRUB to control additional operating systems.
- Reboot the system.
- If each OS is installed on a separate disk then copy all the partition table with the boot loader :
dd if=/dev/hda of=/root/myoldpartition.back bs=512 count=1
Now after the dual-boot installation is completed , if needed you can just recreate the old partition table with the following command :
dd if=/root/myoldpartition.back bs=512 count=1
- If both OS es are installed on one single disk the copy only the boot loader:
dd if=/dev/hda of=/root/myoldbootloader.back bs=446 count=1
Now after the dual-boot installation is completed , if needed you can just recreate the old boot loader with the following command :
dd if=/root/myoldbootloader.back bs=446 count=1