Solved

Re-establish GRUB bootloader

Posted on 2004-04-23
8
399 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
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
pvcreate issue 5 100
How to setup virtualization in Redhat? 4 44
Zimbra and Renewing SSL Certficate 9 62
AWS Linux EC2 question on group 7 91
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
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.

751 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