Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 18th February 2009, 09:20 PM
goxi's Avatar
goxi Offline
Registered User
 
Join Date: Feb 2009
Location: Bitola, Macedonia
Posts: 24
How to REINSTALL GRUB with LiveCD F10

I reinstalled winXP and lost grub loader. I have LiveCD with Fedora 10. How can I reinstall GRUB using this CD ?
Reply With Quote
  #2  
Old 18th February 2009, 10:29 PM
sideways's Avatar
sideways Offline
Retired User
 
Join Date: Oct 2004
Location: London, UK
Posts: 4,999
Theoretically you can do it like this, but last time I tried the '-o dev' option in mount it didn't make the /dev nodes appear.

So probably best to do it from a rescue session or the super grub boot disk
Reply With Quote
  #3  
Old 18th February 2009, 11:16 PM
goxi's Avatar
goxi Offline
Registered User
 
Join Date: Feb 2009
Location: Bitola, Macedonia
Posts: 24
Smile

Quote:
Originally Posted by sideways View Post
Theoretically you can do it like this, but last time I tried the '-o dev' option in mount it didn't make the /dev nodes appear.

So probably best to do it from a rescue session or the super grub boot disk
Thanks sideways. I mange to repair grub with super grub disk, but with version 1.0 (1.5 not do the job). I first copied boot folder from ext3 partition on my winXP partition and loaded kernel image in super grub disk so I started fedora after reboot, and from fedora I reinstalled grub with
grub-install

Reply With Quote
  #4  
Old 23rd February 2009, 06:27 PM
stoat Offline
Registered User
 
Join Date: Jun 2006
Posts: 7,551
Quote:
Originally Posted by goxi

I mange to repair grub with super grub disk...
Hello goxi and sideways,

I think everyone who uses a GRUB-booted system should possess a Super Grub Disk. But the title question is still a good one. Here are some more LiveCD methods that should work (just for the record). I tested the following examples using a Fedora 10 LiveCD to re-install GRUB in the master boot record of /dev/sda. Boot with the LiveCD, and open a terminal, get root privileges with su -, and then...

When the busted system is in a single ext3 root partition (say, /dev/sda5)...
mkdir /mnt/temp
mount /dev/sda5 /mnt/temp
grub-install --root-directory=/mnt/temp /dev/sda
When the busted system has separate ext3 boot and root partitions (say, /dev/sda5 and /dev/sda6)...
mkdir -p /mnt/temp/boot
mount /dev/sda5 /mnt/temp/boot
mount /dev/sda6 /mnt/temp
grub-install --root-directory=/mnt/temp /dev/sda
When the busted system has a separate ext3 boot partition (say, /dev/sda5), and the root partition is a logical volume (say, /dev/VolGroup00/LogVol00 according to lvdisplay)...
mkdir -p /mnt/temp/boot
vgchange -a y
lvdisplay
mount /dev/sda5 /mnt/temp/boot
mount /dev/VolGroup00/LogVol00 /mnt/temp
grub-install --root-directory=/mnt/temp /dev/sda
If grub-install fails with a read error or the boot loader still doesn't work, always try the GRUB shell (and vice versa). They both accomplish the same thing, but different things occur in the background. It's not necessary to mount partitions when using the GRUB shell commands in the LiveCD. Change x & y in the example to the busted system's boot partition...
/sbin/grub
grub> root (hdx,y)
grub> setup (hd0)

Last edited by stoat; 17th June 2010 at 01:00 AM.
Reply With Quote
  #5  
Old 24th February 2009, 04:27 PM
goxi's Avatar
goxi Offline
Registered User
 
Join Date: Feb 2009
Location: Bitola, Macedonia
Posts: 24
Quote:
Originally Posted by stoat View Post
Hello goxi and sideways,

I think everyone that uses a GRUB-booted system should possess a Super Grub Disk. But the title question is still a good one. Here are some more LiveCD methods that should work (just for the record). I tested the following examples using a Fedora 10 LiveCD to re-install GRUB in the master boot record of /dev/sda. Boot with the LiveCD, and open a terminal, get root privileges with su -, and then...

When the busted system is in a single ext3 root partition (say, /dev/sda5)...
mkdir /mnt/temp
mount /dev/sda5 /mnt/temp
grub-install --root-directory=/mnt/temp /dev/sda
When the busted system has separate ext3 boot and root partitions (say, /dev/sda5 and /dev/sda6)...
mkdir -p /mnt/temp/boot
mount /dev/sda5 /mnt/temp/boot
mount /dev/sda6 /mnt/temp
grub-install --root-directory=/mnt/temp /dev/sda
When the busted system has a separate ext3 boot partition (say, /dev/sda5), and the root partition is a logical volume (say, /dev/VolGroup00/LogVol00 according to lvdisplay)...
mkdir -p /mnt/temp/boot
vgchange -a y
vgscan
lvdisplay
mount /dev/sda5 /mnt/temp/boot
mount /dev/VolGroup00/LogVol00 /mnt/temp
grub-install --root-directory=/mnt/temp /dev/sda
If grub-install fails with a read error or the boot loader still doesn't work, always try the GRUB shell (and vice versa). They both accomplish the same thing, but different things occur in the background...
/sbin/grub
grub> root (hdx,y)
grub> setup (hd0)
Thanks stoat. I tried something like this, but maybe I missed something. I hope that I will not have need to do this. Anyway your solution is more elegant
Reply With Quote
  #6  
Old 24th February 2009, 06:49 PM
stoat Offline
Registered User
 
Join Date: Jun 2006
Posts: 7,551
Quote:
Originally Posted by goxi

I tried something like this, but maybe I missed something. I hope that I will not have need to do this. Anyway your solution is more elegant
Well actually, even though I always have LiveCDs around, I never use them to repair the GRUB boot loader. I have always used the Super Grub Disk, or a GRUB boot floppy, or a GRUB boot CD (all of which I also always have handy) to boot the busted system. Then, once it's running, I use the GRUB shell or grub-install in a terminal of the now running system to re-install GRUB.

But I still think your original question was good and needed an answer. I tested every one of those examples on a computer that I use just for testing ideas. I published the results here just for the record and future readers who will come here only because they have the same question. But I'm glad that you fixed your own problem no matter how it was done.

Last edited by stoat; 24th February 2009 at 07:20 PM.
Reply With Quote
  #7  
Old 7th April 2009, 06:55 PM
alexuk Offline
Registered User
 
Join Date: Aug 2008
Location: London, UK
Posts: 69
I tried stoat's procedure (variant 3 given my case) but at the last step I am getting grub complaining about stage2 not being read correctly. Any ideas? Incidentally I do not know why I lost the mbr on this machine (dual boot vista/fc10) perhaps related with the install of the latest kernel.

The commands under grub do not work either (setting root(hd0,4) plus setup): says all checks succeeded but when rebooting all I get is a GRUB prompt.

Any help appreciated. Could download the rescue disc but I have little broadband from here and doing this with a livecd FC10.
Reply With Quote
  #8  
Old 7th April 2009, 07:20 PM
sideways's Avatar
sideways Offline
Retired User
 
Join Date: Oct 2004
Location: London, UK
Posts: 4,999
Do you mean you have a grub command prompt?

In that case you can follow from step 2 here
http://dailypackage.fedorabook.com/i...ling-Grub.html
Reply With Quote
  #9  
Old 7th April 2009, 07:53 PM
alexuk Offline
Registered User
 
Join Date: Aug 2008
Location: London, UK
Posts: 69
Quote:
Originally Posted by sideways View Post
Do you mean you have a grub command prompt?

In that case you can follow from step 2 here
http://dailypackage.fedorabook.com/i...ling-Grub.html
I can get a grub prompt either through the live image on usb and through booting hd0. However as I was trying to say above, if I do a root (hd0,4) and setup (hd0) grub reports success but the machine does not boot (gives a grub prompt). This's happened to me before but I always fixed it easily - I must be missing something.
Reply With Quote
  #10  
Old 7th April 2009, 08:22 PM
sideways's Avatar
sideways Offline
Retired User
 
Join Date: Oct 2004
Location: London, UK
Posts: 4,999
what does

find /grub/grub.conf

or

find /boot/grub/grub.conf

return when you boot from the hard disk?
Reply With Quote
  #11  
Old 7th April 2009, 08:30 PM
alexuk Offline
Registered User
 
Join Date: Aug 2008
Location: London, UK
Posts: 69
Quote:
Originally Posted by sideways View Post
what does

find /grub/grub.conf

or

find /boot/grub/grub.conf

return when you boot from the hard disk?
Thanks.

find /grub/grub.conf returns (hd0,4) while find /boot/grub/grub.conf returns file not found.

Last edited by alexuk; 7th April 2009 at 08:41 PM. Reason: results reported
Reply With Quote
  #12  
Old 7th April 2009, 08:40 PM
sideways's Avatar
sideways Offline
Retired User
 
Join Date: Oct 2004
Location: London, UK
Posts: 4,999
yes it's possible that one grub is installed in the mbr and another in the (first sector of the) boot partition
Reply With Quote
  #13  
Old 7th April 2009, 10:22 PM
alexuk Offline
Registered User
 
Join Date: Aug 2008
Location: London, UK
Posts: 69
OK, managed to boot by passing grub:

grub> configfile (hd0,4)/grub/grub.conf

and then ran grub-install /dev/sda from there.

Thanks to sideways and to the excellent http://forums.fedoraforum.org/showthread.php?t=197514

A big boo to yum which messed up the mbr while installing a kernel update (at least I think).
Reply With Quote
  #14  
Old 7th April 2009, 10:43 PM
sideways's Avatar
sideways Offline
Retired User
 
Join Date: Oct 2004
Location: London, UK
Posts: 4,999
When yum installs a new kernel it does not reinstall grub, all it does is update grub.conf wherever it is located for the current installation. Now, if you are multibooting it's possible your grub bootloader in the mbr doesn't read grub.conf from your current /boot/grub directory - it may be read from an existing separate /boot partition.

I suspect that's what's happened here, in that case you may just be booting the old kernel unless you edit the grub.conf in the separate partition to point to the new kernel.
Reply With Quote
  #15  
Old 8th April 2009, 07:40 AM
alexuk Offline
Registered User
 
Join Date: Aug 2008
Location: London, UK
Posts: 69
I checked and I am running 21-170 which is the latest I installed I think. It'd be good to get to the bottom of this but happy it's all up and running now. Thanks again.
Reply With Quote
Reply

Tags
f10, grub, livecd, reinstall

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
LiveCD, grub and MBR juszczec Installation and Live Media 2 1st March 2008 10:33 PM
Reinstall Grub michi Installation and Live Media 2 27th April 2006 06:10 PM
cant use grub after reinstall xp!help c4danger Installation and Live Media 2 25th March 2006 02:09 PM
Q: Reinstall GRUB aero-z Installation and Live Media 2 19th July 2005 09:21 PM


Current GMT-time: 13:34 (Wednesday, 19-06-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat