jump to navigation

Reinstalling the Boot Loader on CentOs 5.x January 31, 2011

Posted by Tournas Dimitrios in Linux.
trackback

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.
In cases where you need to set-up a dual-boot computer , always backup your partition table .
  • 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

Comments»

1. Password protect the bootloader on Centos 5.x « Tournas Dimitrios - February 1, 2011

[…] Reinstalling the boot-loader […]

2. GD - July 12, 2011

I am using AMD Phenom(tm)IIx4 core processor.
While installing the CentOS5.2 ,It shows the Error Kernel panic-not syncing:Fatal exception

can any one help

tournasdimitrios1 - July 12, 2011

@GD
You have to provide us with more information .
Is this a fresh installation ?
Have you installed in the past Linux on this box ?
A good place to starting investigating ” Hardware compatibility issues ” is the official help forum of CentOs .


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s