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?
LVL 3
Jason WilcoxAsked:
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.

Daniel McAllisterPresident, IT4SOHO, LLCCommented:
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
0
Jason WilcoxAuthor Commented:
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?
0
Jason WilcoxAuthor Commented:
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!"
0
Daniel McAllisterPresident, IT4SOHO, LLCCommented:
Check your /etc/fstab file -- are you mounting /usr from another partition?

If you originally installed your Linux with an old *NIX admin guide, it probably told you to create separate partitions for /usr, /var, /tmp, and others... Linux does not expect this, and if this is the case, then BEFORE you chroot to /mnt/rescue, you'll need to mount your /usr filesystem to the proper location.

For grins, I'll assume /usr is on /dev/sda5 (probably wrong, but you'll get the idea) -- you should be able to get the actual partition from the /etc/fstab file, or you may have to do some exploring with the e2label program to find the partition with the correct label for your /usr partition.

In my instructions above, just after steps 5 & 6 (where you mount your / partition), mount your /usr partition -- but remember that your "real" root partition is mounted on /mnt/rescue, so to put it in its proper place, you need to mount it to /mnt/rescue/usr!

So insert a Step 6.5:
  mount /dev/sda5 /mnt/rescue/usr

Then proceed to Step 7 (chroot to /mnt/rescue and run the grub-install)




If, however, you do NOT have a separate /usr partition (or drive), then you're looking at having to restore it -- hope you have a backup, otherwise you'll probably prefer to simply do a new install on a different drive, then copy your important files (including config files) over from the "bad" one.

Good Luck!

Dan
IT4SOHO
0

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
Jason WilcoxAuthor Commented:
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!
0
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
Linux

From novice to tech pro — start learning today.