Centos booting with only "GRUB" and stuck there ?

Posted on 2009-07-03
Last Modified: 2013-12-15

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
Question by:smksa
LVL 88

Assisted Solution

rindi earned 50 total points
ID: 24773168
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.

Assisted Solution

glenthorne earned 50 total points
ID: 24773329
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.
LVL 20

Accepted Solution

Daniel McAllister earned 300 total points
ID: 24773551

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!


Assisted Solution

dontdig earned 50 total points
ID: 24773558
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)

LVL 35

Assisted Solution

torimar earned 50 total points
ID: 24776147
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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now