LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-22-2011, 04:37 AM   #1
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Rep: Reputation: 62
How do I repair the GRUB from Fedora 11?


I'm going to be installing Windoze (because 3D graphics are still not there in Linux), but that will of course override the MBR. So how do I rewrite it? I just tried starting from the Fedora 11 DVD until it got into the 1st graphical screen, and then I tried to mount *any* of my Fedora partitions - I think it's made 5 of them (God knows why!!), but anyway,none of them would mount except /boot - kept saying "wrong fs type or superblock" etc. My plan was of course, to chroot my current Fedora partition, and then run grub-install, but of course I can't if the partition itself doesn't mount.

What do I do?


Thanks.
 
Old 01-22-2011, 04:45 PM   #2
RockDoctor
Senior Member
 
Registered: Nov 2003
Location: Minnesota, US
Distribution: Fedora, Ubuntu, Manjaro
Posts: 1,791

Rep: Reputation: 427Reputation: 427Reputation: 427Reputation: 427Reputation: 427
You should be able to run grub-install from the DVD. The important question is, what's in those other partitions? fdisk is your friend (but it'll turn on you the moment you make a mistake). Try(as root, in a terminal window)
Code:
fdisk -l /dev/sda
Once upon a time, I came upon the following, which I downloaded and keep with other misc documentation - my apologigies for not recording the author(s):
Quote:
Re: HOWTO: Restore GRUB (if your MBR is messed up)

Isn't it easier to do this:

1. Pop in the Live CD, boot from it until you reach the desktop.
2. Open a terminal window or switch to a tty.
3. Type "grub"
4. Type "root (hd0,6)", or whatever your harddisk + boot partition numbers are (my /boot is at /dev/sda7, which translates to hd0,6 for grub).
5. Type "setup (hd0)", ot whatever your harddisk nr is.
6. Quit grub by typing "quit".
7. Reboot.

If you've installed GRUB into the Root Partition instead of the MBR, the commands are a little different. Here's are the instructions that I have for my system:
How to Restore the Grub Menu after a Re-Ghosting:
1. Boot from a Live CD, like Ubuntu Live, Knoppix, Mepis, or similar.
2. Open a Terminal. Go SuperUser (that is, type "su"). Enter root passwords as necessary.
3. Type "grub" which makes a GRUB prompt appear.
4. Type "find /boot/grub/stage1". You'll get a response like "(hd0)" or in my case "(hd0,3)". Use whatever your computer spits out for the following lines.
5. Type "root (hd0,3)".
6. Type "setup (hd0,3)". This is key. Other instructions say to use "(hd0)", and that's fine if you want to write GRUB to the MBR. If you want to write it to your linux root partition, then you want the number after the comma, such as "(hd0,3)".
7. Type "quit".
8. Restart the system. Remove the bootable CD.
 
Old 01-22-2011, 06:47 PM   #3
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Did you install Ubuntu to this computer?
 
Old 01-23-2011, 01:32 AM   #4
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Original Poster
Rep: Reputation: 62
Quote:
Originally Posted by EDDY1 View Post
Did you install Ubuntu to this computer?
No - because Ubuntu Grub won't recognise my LVM Fedora partitions! I don't get this at all - this is Ubuntu 10.10 which I d/l'ed just about a month ago - surely this kernel is a *superset* of Fedora 11's? So how come it doesn't mount LVM partitions then??!!!
 
Old 01-23-2011, 02:16 AM   #5
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
It would if you were in Ubuntu and mounted root partition of fedora.
Then do
"os-prober"
"updsate-grub"

sudo if you have it setup
 
Old 01-23-2011, 02:17 AM   #6
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
http://www.linuxquestions.org/questi...-grub2-706272/
 
Old 01-23-2011, 02:22 AM   #7
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
What Os is installed?
 
Old 01-23-2011, 05:00 AM   #8
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Original Poster
Rep: Reputation: 62
Quote:
Originally Posted by EDDY1 View Post
It would if you were in Ubuntu and mounted root partition of fedora.
Then do
"os-prober"
"updsate-grub"

sudo if you have it setup
I can't MOUNT Fedora's root partition:

ubuntu@ubuntu:~$ sudo mount -t ext4 /dev/sda3 /mnt/
mount: wrong fs type, bad option, bad superblock on /dev/sda3,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so



And how do I find out which one the root partition IS? This is what FEdora did to my hard drive:


Device Boot Start End Blocks Id System
/dev/sda1 1 12748 102398278+ 7 HPFS/NTFS
/dev/sda2 12749 15358 20964825 5 Extended
/dev/sda3 15359 17968 20964825 83 Linux
/dev/sda4 17969 19457 11960392+ 83 Linux
/dev/sda5 * 12749 12774 204800 83 Linux
/dev/sda6 12774 15358 20759992+ 8e Linux LVM


By the way, mounting /dev/sda5 works fine! (that's the one with the kernel in it and stuff).

Last edited by resetreset; 01-23-2011 at 05:01 AM.
 
Old 01-23-2011, 05:41 AM   #9
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
We are all guessing, do as the RockDoctor suggested and from terminal as root give us the results of fdisk -l (small L).
 
Old 01-23-2011, 02:22 PM   #10
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Quote:
And how do I find out which one the root partition IS? This is what FEdora did to my hard drive:
Quote:
By the way, mounting /dev/sda5 works fine! (that's the one with the kernel in it and stuff).
If it boots on sda5 that's where your grub is.
It's also noted there by "*". Now all you have to do is mount again and repair your grub, the FEDORA way.
 
Old 01-24-2011, 02:12 AM   #11
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Original Poster
Rep: Reputation: 62
Quote:
Originally Posted by Larry Webb View Post
We are all guessing, do as the RockDoctor suggested and from terminal as root give us the results of fdisk -l (small L).
I just did....? Anyway here it is again:

sudo fdisk -l /dev/sda

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x13d713d6

Device Boot Start End Blocks Id System
/dev/sda1 1 12748 102398278+ 7 HPFS/NTFS
/dev/sda2 12749 15358 20964825 5 Extended
/dev/sda3 15359 17968 20964825 83 Linux
/dev/sda4 17969 19457 11960392+ 83 Linux
/dev/sda5 * 12749 12774 204800 83 Linux
/dev/sda6 12774 15358 20759992+ 8e Linux LVM
 
Old 01-24-2011, 03:11 AM   #12
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
I think fdisk -l only lists partitions.
Is Ubuntu presently installed on this system and working?
 
Old 01-24-2011, 04:21 AM   #13
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Original Poster
Rep: Reputation: 62
Quote:
Originally Posted by EDDY1 View Post
I think fdisk -l only lists partitions.
Is Ubuntu presently installed on this system and working?
No, I'm only running off the Live CD. I WANT to install it, providing I can still access Fedora and WinXP partitions....
 
Old 01-24-2011, 04:29 AM   #14
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Your 4 primary partitions are taken you would have to make room inside of logical
http://www.justlinux.com/forum/showt...hreadid=143973
http://www.justlinux.com/forum/showthread.php?t=147959
 
Old 01-24-2011, 04:48 AM   #15
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Windows
Quote:
/dev/sda1 1 12748 102398278+ 7 HPFS/NTFS
These 3 are 1 partition
Quote:
/dev/sda2 12749 15358 20964825 5 Extended
/dev/sda5 * 12749 12774 204800 83 Linux
/dev/sda6 12774 15358 20759992+ 8e Linux LVM
These 2 are individual
Quote:
/dev/sda3 15359 17968 20964825 83 Linux
/dev/sda4 17969 19457 11960392+ 83 Linux
Only 2 os'es present?
It looks like you prepartitioned for 3 or 4 os'es.
 
  


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
how to repair grub vineetdeepu Linux - Newbie 4 03-11-2010 08:17 AM
LXer: Super GRUB Disk--A GRUB Repair Utility LXer Syndicated Linux News 0 09-20-2008 10:20 PM
grub repair on laptop ( which has Windows XP + Fedora Core 6) break_sec Linux - Newbie 2 05-16-2008 09:22 PM
Repair grub? nyroc Linux - Newbie 1 01-09-2003 06:50 PM
Grub repair Snake007uk Linux - General 13 05-10-2002 07:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:16 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
Open Source Consulting | Domain Registration