Solved

Re-establish GRUB bootloader

Posted on 2004-04-23
8
403 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
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!

 

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

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

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

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.
Suggested Courses

623 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