LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-30-2006, 01:49 AM   #1
inadilemma
LQ Newbie
 
Registered: Feb 2005
Location: Bangladesh
Distribution: redhat
Posts: 7

Rep: Reputation: 0
problem with grub


I have been using windows xp together with linux FC4 with grub as the boot loader installed in the MBR.

but yesterday grub somehow got corrupted and I couldn't boot either windows or linux. The using the fixboot and fixmbr utilities from a windows cd I wrote a new MBR and could successfully boot windows xp.
My linux partition is still intact because I can browse my linux partitions using explore2fs.
How can I fix and reinstall grub from this position without reinstalling linux keeping both my operating systems intact.
 
Old 06-30-2006, 03:28 AM   #2
binary_y2k2
Member
 
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Blog Entries: 1

Rep: Reputation: 31
you need a rescue CD or a liveCD, then you need to use the command "grub-install /dev/hdX" where hdX is your HDD device.
 
Old 06-30-2006, 03:33 AM   #3
Zmyrgel
Senior Member
 
Registered: Dec 2005
Location: Finland
Distribution: Slackware, CentOS, RHEL, OpenBSD
Posts: 1,006

Rep: Reputation: 37
Get a linux boot disk or boot the linux with a liveCD.
Then mount your root (/) partition and /boot partition if you have one:
Code:
mount /dev/sda3 /mnt
mount /dev/sda1 /mnt/boot
Then chroot into it.
Code:
chroot /mnt
Now you just reinstall grub by as follows and unmount partitions and reboot machine
Code:
grub --no-floppy
>root (hd0,2)
>setup (hd0)
>quit
exit
umount /dev/sda1
umount /dev/sda3
reboot
Should refresh before posting
 
Old 06-30-2006, 08:55 AM   #4
inadilemma
LQ Newbie
 
Registered: Feb 2005
Location: Bangladesh
Distribution: redhat
Posts: 7

Original Poster
Rep: Reputation: 0
reply to binary_y2k2:
I tried this before but got the error:
/sbin/grub not found.
Am I missing something ?
 
Old 06-30-2006, 09:43 AM   #5
binary_y2k2
Member
 
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Blog Entries: 1

Rep: Reputation: 31
It looks like (somehow) grub is not installed.
I would suggest that you follow Zmyrgels instructions but install grub from an RPM before issuing the "grub" command. (as that wouldn't work otherwise )
If you have the CD you used to install it should be on that, if not you'll need to download it.
use "rmp -i /path/to/grub.rpm" then follow the commands above (Zmyrgels post)
if your linux partition is the 2nd primary partition then the root section would read "root (hd0,1)" as grub numbers the partitions from 0. Then it should work. As a last resort before a compleat reinstall you could see if your install CD has an upgrade option, or install without a format.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
GRUB dual boot problem: Boot "other" (windows) just restarts GRUB! stevod333 Linux - Software 13 04-06-2006 06:26 AM
grub problem? kyleca Linux - General 1 05-09-2005 07:25 PM
Problem with GRUB ksathya Linux - Software 2 11-18-2004 04:40 AM
HDD problem, scancode problem and grub EJ_INSIDE Debian 2 07-15-2004 10:36 AM
Grub setup problem (/boot/grub/stage1 not found) davidas Debian 2 04-28-2004 09:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration