Centos booting with only "GRUB" and stuck there ?


I need an assistant.

It seems that my server failed to boot, when booting from the primary hard disk the screen just display GRUB with no other word and stuck there.

May i know if anybody can help to teach me on how to fix this ?

My O/S is Centos 5.3 Enterprise 64 Bit.

Thank you
Shamsul KamalJunior TechAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Did this previously work? If yes, you probably have a hardware error (bad HD or RAM). Test the disk using the HD manufacturer's diagnostic utility, and the RAM using memtest86+. You'll find those tools on the UBCD:


If both test turn out OK, boot with a Parted Magic, and run testdisk on your CentOS HD. that should repair any filesystem errors.

I concur with rindi.  I just dealt with this same problem last week.  If all you see if the word "GRUB" on the screen, then you probably have a haddrive problem.  Before you go too far, my preference is to boot to one of the linux distro's "Live" CDs or to a Knoppix distro.  This will allow you to get to the harddrive (if it is still accessible) and backup any data that you need.
Daniel McAllisterPresident, IT4SOHO, LLCCommented:

Before suspecting the HD, try first to re-install the GRUB boot-sector. Especially if you've done ANYTHING to this drive (like moving ports or removing other drives from the system).

The EASY way to do this is this:
 1) Boot from an installation disk -- it doesn't matter if it's the same version OS as your server is running, so long as the kernel family is the same. I just repaired a GRUB error on a Fedora Core 5 system using a Centos 5.3 install dvd!

 2) "Pretend" you're going to install a new system (that is, just press enter at the boot screen) -- and step through everything (SKIP any CD or DVD media check -- you won't be using it anyway!) UP TO the point where is searches for old installations -- AT THIS POINT, you have a kernel loaded that has scanned your IDE and SATA ports for hard drives and loaded drivers for them (so the /dev/hd* and /dev/sd* entries are there)... so now, all you have to do is get into them!

3) Press CONTROL-ALT-F2 -- which should get you a SHELL prompt...

4) Make sure you know which drive has your system... I usually do something like:
  cd /dev
  for i in sd?1 ; do e2label $i ; done

Which will show you the FileSystem Label (assuming you're using ext2 or ext3 filesystems -- which you SHOULD on boot partitions)

Let's assume that you find your ROOT partition at sda1 (likely, but not required)

5) Now let's mount that drive
   mkdir /mnt/rescue
   mount /dev/sda1 /mnt/rescue

6) If it reports an error, you MAY need to check the filesystem
   umount /mnt/rescue
   fsck -f /dev/sda1 (NOTE: you may want to run fsck with the -C option as well, so see the progression/status)

Then go back and re-mount it (DO NOT run FSCK on a mounted filesystem -- even a ROOT filesystem if you can help it!)
   mount /dev/sda1 /mnt/rescue

7) Here's the "tricky" part -- we're going to tell Linux to CHANGE the location of the kernel's root drive!
   chroot /mnt/rescue

You'll get a new prompt, and your PWD is now / (which is REALLY /mnt/rescue). Now you'll need to be careful, as no startup scripts have been run!

8) Now, all we need to do is re-install the GRUB boot block --
    cd /sbin
    ./grub-install --recheck /dev/sda   (NOTE: note that's /dev/sda, NOT /dev/sda1 !!!)

If GRUB comes back and tells you where fd0 and hd0 (and so forth) are located, you're in good shape!
If GRUB comes back with an error, well post your results here and we'll go from there

BUT -- assuming no error, you've just re-written your boot block and told GRUB how to access your root partition again. You can now reboot off your hard drive again.

HOWEVER: If you've made hardware changes, you MAY need to change your grub.conf file... if so, DO THIS BEFORE REBOOTING:
  cd /boot/grub
  vi grub.conf

The GOOD news is that changing the grub.conf file DOES NOT require you to re-run the grub-install program!

Best of luck!


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
do u see just like this?


if its tru then do the following

grub> root (hd0,0)
grub> setup (hd0)
grub> quit

if above doesnt omit any error then yours grub is good to go otherwise u will have to reinstall it ins rescue mode.

like this

grubinstall  /dev/hda(name of urs primary HDD)

I support the solution given by dontdig above. This is the first thing I personally would try.

However, it will only work if your root or boot partition is on sda1. To make sure you actually install with the correct settings, modify the grub commands like this:

grub> find /boot/grub/stage1
(*take the output from here and insert it into the line below*)
grub> root (hd0,0)  (<--- replace "hd0,0" by the output from above)
grub> setup (hd0)
grub> quit
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.