LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How do I repair the GRUB from Fedora 11? (https://www.linuxquestions.org/questions/linux-software-2/how-do-i-repair-the-grub-from-fedora-11-a-857939/)

resetreset 01-22-2011 04:37 AM

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.

RockDoctor 01-22-2011 04:45 PM

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.

EDDY1 01-22-2011 06:47 PM

Did you install Ubuntu to this computer?

resetreset 01-23-2011 01:32 AM

Quote:

Originally Posted by EDDY1 (Post 4234437)
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??!!!

EDDY1 01-23-2011 02:16 AM

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

EDDY1 01-23-2011 02:17 AM

http://www.linuxquestions.org/questi...-grub2-706272/

EDDY1 01-23-2011 02:22 AM

What Os is installed?

resetreset 01-23-2011 05:00 AM

Quote:

Originally Posted by EDDY1 (Post 4234679)
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).

Larry Webb 01-23-2011 05:41 AM

We are all guessing, do as the RockDoctor suggested and from terminal as root give us the results of fdisk -l (small L).

EDDY1 01-23-2011 02:22 PM

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.

resetreset 01-24-2011 02:12 AM

Quote:

Originally Posted by Larry Webb (Post 4234778)
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

EDDY1 01-24-2011 03:11 AM

I think fdisk -l only lists partitions.
Is Ubuntu presently installed on this system and working?

resetreset 01-24-2011 04:21 AM

Quote:

Originally Posted by EDDY1 (Post 4235726)
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....

EDDY1 01-24-2011 04:29 AM

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

EDDY1 01-24-2011 04:48 AM

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.


All times are GMT -5. The time now is 07:11 PM.