Solved

Re-establish GRUB bootloader

Posted on 2004-04-23
8
396 Views
Last Modified: 2010-04-20
Somehow GRUB was giving me a Hard Disk Error when I tried to boot up.
I've used the rescue option of the install disk get into the system.
It appears all the files are there under a /mnt/sysimage.  Is there a
command I can use to get things back as they were on the hard disk so
I can just boot up?
0
Comment
Question by:xoxomos
[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
  • 4
  • 4
8 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 10904882
From a rescue boot you'd need to execute:

chroot /mnt/sysimage
grub-install /dev/hda

replacing hda by whatever the disk device is (hda, hdb, sda, etc). You can see that from a 'df' in resuce mode.
0
 

Author Comment

by:xoxomos
ID: 10905235
Could you make that a bit more idiot-proof?
When I do df
/dev/root         5900       3506       2094     63%     /
/tmp/cdrom        660480     660480     0        100%    /mnt/source
/tmp/hda6         381139     34146      127315   65%     /mnt/sysimage
/tmp/hda1         46636      8998       35230    20%     /mnt/sysimage/boot
/tmp/hda5         17686464   10264360   6541672  61%     /mnt/sysimage/usr
/tmp/hda2         39697740   27130184   10551000 72%     /mnt/sysimage/usr
/tmp/hda7         256667     35490      207925   15%     /mnt/sysimage/var
/tmp/hda2         39697740   27130184   10551000 72%     /mount-hard-drive

The /mount-hard-drive is a directory I just made and mounted /dev/hda2 on it.
0
 
LVL 40

Expert Comment

by:jlevie
ID: 10905387
Your boot disk is /dev/hda
0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 

Author Comment

by:xoxomos
ID: 10905929
It looks like grub-install calls grub, but can't find it even though it's in the very same directory.
Error message just comes back 'grub not found'
0
 
LVL 40

Accepted Solution

by:
jlevie earned 300 total points
ID: 10906182
Did you execute 'chroot /mnt/sysimage' before executing grub-install? The grub-install command is simply a shell script that invokes /sbin/grub. Unless your system has been damaged in some manner such that the grub binary can't run or that the shared libs it uses needs aren't available grub-install should work. You can find out if that's the case by:

chroot /mnt/sysimage
/sbin/grub

That will start grub in interactive mode. If that fails it should emit an error message indicating what the problem is.
0
 

Author Comment

by:xoxomos
ID: 10906414
ok.  noi did not.  it'll have to wait till tomorrow
0
 
LVL 40

Expert Comment

by:jlevie
ID: 10907658
It is necessary to execute the chroot first so that grub-install will execute from your system image and not from the rescue envirormnet. Not doing so could be a good reason why it didn't work.
0
 

Author Comment

by:xoxomos
ID: 10909518
Mil gracias!!!!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
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.

740 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