Solved

Re-establish GRUB bootloader

Posted on 2004-04-23
8
386 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
  • 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
 

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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to install software on a provisioned vagrant image 3 62
parse convert xml feed to text (python) 2 70
Choosing CentOS 16 58
Linux VM 6 49
Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
The purpose of this article is to demonstrate how we can use conditional statements using Python.
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.:
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.

895 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now