?
Solved

grub loading "error 15"

Posted on 2009-07-08
5
Medium Priority
?
1,707 Views
Last Modified: 2013-12-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?
0
Comment
Question by:Jason Wilcox
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 20

Expert Comment

by:Daniel McAllister
ID: 24809560
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
 
LVL 3

Author Comment

by:Jason Wilcox
ID: 24816333
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
 
LVL 3

Author Comment

by:Jason Wilcox
ID: 24818705
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
 
LVL 20

Accepted Solution

by:
Daniel McAllister earned 2000 total points
ID: 24824068
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
 
LVL 3

Author Closing Comment

by:Jason Wilcox
ID: 31601339
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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
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.
Suggested Courses
Course of the Month15 days, 2 hours left to enroll

771 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