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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Postfix issues with spam/auth attempts under NAT 9 84
nagios monitor 3 54
VirtualBox in Fedora 25 Linux:  Unable to Install OS 11 222
Can't ping New Linux Servers 40 66
The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. Once you open the link you will see …
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

770 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