1

I think I have messed this one up royally...

I have done a clean install of centOS 5.6 (x86_64) on my system. I got through the installation process successfully and rebooted. Now I am greeted with a blinking cursor on a black screen. No grub, no menu, no nothing (the system does POST).

I did wipe the hard drive completely before doing the install. I am wondering if I wiped the MBR too, but I thought the centOS install would fix that. I am able to use bootable media with no issues. I have a copy of RIP Linux on a bootable USB so I am able to access the CentOS install files.

At this point Im not sure where to go from here. What should my next step be to troubleshoot this? How would I do a fix or even a check on the MBR?

Hari Seldon
  • 264
  • 2
  • 4
  • 11

2 Answers2

2
  1. Boot from your LiveUSB. Note that you may need one from CentOS to make sure your GRUB versions match.
  2. Become superuser if necessary by running su or prefixing the following commands with sudo.
  3. Run blkid and figure out your primary hard drive's device (most likely /dev/sda), boot partition (something like /dev/sda1) and root directory partition (something like /dev/sda2).
  4. Create a mount point directory for and mount your root partition: mkdir /mnt/myroot && mount /dev/sda2 /mnt/myroot
  5. Mount your boot partition where it belongs in your root partition: mount /dev/sda1 /mnt/myroot/boot
  6. Reinstall GRUB using the hard drive's device (without the partition number) and root directory, as follows: grub-install --root-directory=/mnt/myroot /dev/sda
Patches
  • 16,254
  • Thank You, it worked for me. CentOS installed a boot partition into the first partition, but grub had to be installed to the second partition containing the actual OS for it to work. I was going nuts trying to figure out why grub installed into the boot partition didnt work. – Hari Seldon Jun 11 '11 at 16:19
1

If you bootable Linux has the same grub installed as your CentOS install, you could boot into it, and try grub-install /dev/hda1 (or whatever your boot partition is). You could also chroot into the installed system, and try reinstalling grub using YUM. You also might be able to repair from the boot menu from the original CentOS install media.

Kirk
  • 2,412
  • 1
    If you chroot, remember to pass /bin/bash as the second argument, and don't forget to mount /proc and /dev/ on your target, and copy over a current /etc/resolv.conf before chrooting. Further details in the Gentoo install instructions. The nice thing about chroot is that you don't have to have the same GRUB on your rescue disk as your real disk. – Mike DeSimone Jun 11 '11 at 04:28