Solved

Centos booting with only "GRUB" and stuck there ?

Posted on 2009-07-03
5
1,301 Views
Last Modified: 2013-12-15
Hi,

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
0
Comment
Question by:smksa
5 Comments
 
LVL 88

Assisted Solution

by:rindi
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:

http://ultimatebootcd.com

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

http://distrowatch.com/table.php?distribution=partedmagic
0
 
LVL 3

Assisted Solution

by:glenthorne
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.
0
 
LVL 20

Accepted Solution

by:
Daniel McAllister earned 300 total points
ID: 24773551
OUCH!

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!

Dan
IT4SOHO
0
 
LVL 1

Assisted Solution

by:dontdig
dontdig earned 50 total points
ID: 24773558
do u see just like this?

grub>

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)

0
 
LVL 35

Assisted Solution

by:torimar
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
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
wifi not working on Raspberry Pi 3? 2 108
Rate limit for DNS queries 7 91
Install XRDP on Ubuntu Server 16.10 x64 3 56
check the file dates in unix 14 20
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
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.:
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

685 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