Link to home
Start Free TrialLog in
Avatar of Jason Wilcox
Jason WilcoxFlag for United States of America

asked on

grub loading "error 15"

I've linux box that won't boot, after POST I get a "grub loading..." then a "error 15". That's it, it hangs at that point. The server is a Dell PE with a SATA/RAID controller.

I'm a linux novice and don't know the first place to begin in trouble shooting this. I'm also not familiar with this install, except that it's running as a VMWare host for guests that are hosting several web sites.

Where do I start?
Avatar of Daniel McAllister
Daniel McAllister
Flag of United States of America image

Your GRUB error is simply that it's not finding a bootloader where it was told it could find one...

The SIMPLE reason may simply be that hard drives have become re-ordered and what was once /dev/sda is now /dev/sdb or some such.

But there MAY be a more difficult problem -- it is possible that your Linux kernel has been deleted... but let' not go there just yet.

The easiest way to recover is to follow the steps below:

 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
Avatar of Jason Wilcox

ASKER

Excellent post Dan, very detailed.

I'm making some progress, Im at the point where I want to chroot to /mnt/rescue. Unfortunately I'm getting an error;
- entering the command '/dev$ chroot /mnt/rescue' gets me the following result "chroot: cannot change root directory to /mnt/rescue: operation not permitted"
- entering the command 'dev$ sudo chroot /mnt/rescue' gets me the following result "chroot: cannot run command '/bin/bash': no such file or directory".

How I got to this point, booted off a Ubuntu 9.04 CD (kernel 2.6.28). I was nervous running through the install when I got to the partition setup, CTRL-ALT-F2 wasn't getting me to a SHELL. So I booted into the "Try Ubuntu&" menu selection and opened a Terminal from the GUI.

Thoughts?
I figured out my error was due to several folders missing from /dev/sda1. I copied /lib, /bin and /sbin to /mnt/rescue. Then I was able to do a chroot /mnt/rescue.

Next I tried the ./grub-install --recheck /dev/sda and got the following error; "your /usr is broken; please fix it before calling this wrapper!"
ASKER CERTIFIED SOLUTION
Avatar of Daniel McAllister
Daniel McAllister
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Gave up on this thing, appeared to be missing files and it was a losing proposition when considering my time. I've restored the data from a backup. Thanks for your help Dan!