LinuxQuestions.org
Visit Jeremy's Blog.
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 12-26-2009, 07:18 PM   #1
tron_thomas
Member
 
Registered: May 2004
Posts: 221

Rep: Reputation: 30
Restore GRUB after installing Windows 7


I have an Intel Core2 Duo system that would dual boot via GRUB between Windows Vista and Fedora 10. I recently attempted to upgrade from Vista to Windows 7, however because the version of Vista I had would not upgrade to Windows 7, I had to perform a new installation.

This has removed the ability to boot into my Fedora 10 installation.

After some brief research on the Internet, I created a Live CD of Fedora 12, and booted into that. Accessing the terminal I tried typing:

[liveuser@localhost ~]$ su root
[root@localhost liveuser]# grub
Probing devices to guess BIOS drives. This may take a long time.


GNU GRUB version 0.97 (640K lower / 3072K upper memory)

[ Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists the possible
completions of a device/filename.]
grub> find /boot/grub/stage1
find /boot/grub/stage1

Error 15: File not found

What is needed so I can restore GRUB on my system and boot into Fedora again?
 
Old 12-26-2009, 08:00 PM   #2
conconga
LQ Newbie
 
Registered: Dec 2009
Posts: 22

Rep: Reputation: 1
First of all, remove all Window$ instalation; they are allergic to open source content.
Then, reinstall grub from your rescue cd/dvd.
 
0 members found this post helpful.
Old 12-26-2009, 08:14 PM   #3
tron_thomas
Member
 
Registered: May 2004
Posts: 221

Original Poster
Rep: Reputation: 30
That reply is not helpful. The reality is that I'm doing cross platform development and I need to support Windows even if I don't particularly like it.

Telling me to remove the operating system will not help to solve the problem.

Who is willing to provide some information that will be useful?
 
Old 12-26-2009, 08:38 PM   #4
MrChilly0
Member
 
Registered: Jan 2007
Location: midwest USA
Distribution: gentoo w/ funtoo overlay
Posts: 146

Rep: Reputation: 23
ok...here goes....

boot into the livecd...you'll need to know which partition your fc10 is on....
open a term and get root..(su)
make a dir to mount your partition mkdir /mnt/fc10
mount your fc10 part.. mount /dev/sda? /mnt/fc10
cd /mnt/fc10

mount -t proc none /mnt/fc10/proc
mount -o bind /dev /mnt/fc10/dev
chroot /bin/bash /mnt/fc10
grub-install --no-floppy /dev/sda (note...no partition number)


unmount everything, reboot, and you're golden. DOn't forget to add the chainloader option in your menu.lst for your new windows 7
 
Old 12-26-2009, 09:54 PM   #5
explodingzebras
Member
 
Registered: Oct 2007
Location: UK
Distribution: Ubuntu
Posts: 63

Rep: Reputation: 18
the easiest ways i found is to use the Super Grub Disk, a live cd for restoring or editing grub or restoring windows/linux boot

http://www.supergrubdisk.org/
 
1 members found this post helpful.
Old 12-27-2009, 10:39 AM   #6
tron_thomas
Member
 
Registered: May 2004
Posts: 221

Original Poster
Rep: Reputation: 30
I am not certain which partition my Fedora 10 installation is on. How can I determine that partition?
 
Old 12-27-2009, 01:07 PM   #7
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 8,969

Rep: Reputation: 1898Reputation: 1898Reputation: 1898Reputation: 1898Reputation: 1898Reputation: 1898Reputation: 1898Reputation: 1898Reputation: 1898Reputation: 1898Reputation: 1898
Quote:
I am not certain which partition my Fedora 10 installation is on. How can I determine that partition?
Load your Fedora Live CD, open a terminal and login as root. Some distributions allow you to just type "root" at the prompt and "root" again for the password. Sometimes you can just type "su" or "su -" (without quotes) and get to be root. It should tell you somewhere. Then as root type "fdisk -l" (lower case Letter l) to show your partition information to find where Fedora is. Fedora partition will show as "Linux".
 
Old 12-27-2009, 01:21 PM   #8
Brains
Member
 
Registered: Apr 2009
Distribution: Debian testing
Posts: 987

Rep: Reputation: 260Reputation: 260Reputation: 260
Take a look at tip #20.4 & #27 in this guide.
 
Old 12-27-2009, 07:58 PM   #9
gregorian
Member
 
Registered: Apr 2006
Posts: 509

Rep: Reputation: 34
I have assumed that you have installed Windows on the same partition (If you haven't, read instructions on configuring grub.conf). Boot from the live disc and get to terminal. Once you're at a terminal, attempt to mount every partition till you see your root partition. Let's say this partition is /dev/hda3 (or /dev/sda3) mounted at /mnt/mymount
Code:
chroot /mnt/mymount
grub-install /dev/hda (This must be the hard disk where you've installed windows)
exit
reboot
 
Old 12-28-2009, 12:23 AM   #10
tron_thomas
Member
 
Registered: May 2004
Posts: 221

Original Poster
Rep: Reputation: 30
I used the Fedora 12 install DVD to attempt run grub-install. This restored GRUB, but whenever I select my Linux partition to boot I get:

failed to read image
Press any key to enter the menu



Booting Fedora (2.6.28.41-170.2.117.fc10.i686) in 0 seconds...
Error 17: Cannot mount selected partition

Press any key to continue...

This might be because I used a Fedora 12 installation. I made a Fedora 10 installation and tried applying that, however it did not fix the problem.

I also could no longer boot into Windows until I use the Windows 7 installation diskt to restore it. Now I have GRUB and I can select windows from its menu to boot to Windows. However, I cannot boot into Linux.

What ideas do people have about what could be wrong?
 
Old 12-28-2009, 05:16 AM   #11
gregorian
Member
 
Registered: Apr 2006
Posts: 509

Rep: Reputation: 34
Since it's Grub, you can edit the boot parameters. You must be having root (hd0, x) in the linux parameters right? Try x from 0 to 9 and see if anything comes up.
 
Old 11-20-2010, 08:52 AM   #12
linuxtwitter
LQ Newbie
 
Registered: Nov 2010
Posts: 3

Rep: Reputation: 0
My system consists of 2 harddrives, with Windows XP installed in the primary harddrive and Ubuntu in the secondary harddrive. The MBR is in the primary harddrive, while the grub program is in the secondary harddrive.

Following are the steps I have taken that have finally helped me solve the problem, as well as some explanation for each step:

* Boot up using a ubuntu live CD.
* Open a terminal and type:

> sudo grub

* In the grub command line utility that appears, type the following:

grub> find /boot/grub/stage1

* The above command is for finding where your grub is located. In my case the value returned is: hd1,0. This means grub is in the 1st partition of my second harddrive. If your grub is in the 2nd partition of the first harddrive, the value returned should be hd0,1.
* The next command is to "tell" MBR where grub is located. So you should use the value found in the step above:

grub> root (hd1,0)

* Make sure there is a space between "root" and the opening bracket.
* Next step is to tell grub which MBR to fix. Typically, this should be the first harddrive, which means hd0 should be used. If you have only one harddrive then it should be hd0.

grub> setup (hd0)

* After that you should see some statements about the program is running and whether it is successful.
* Once the program has finished running, you can quit the utility:

grub> quit
 
  


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
Best Way to Backup & Restore Windows When Installing BSD tschima General 2 03-18-2008 10:03 AM
ubuntu: windows took over MBR and can't restore grub eantoranz Linux - Software 3 02-03-2006 08:29 PM
reinstalling windows deleted my grub master boot file; how do I restore it? sohmc Linux - General 3 01-12-2005 01:27 PM
How can i restore lilo after re-installing windows? elean Linux - General 3 06-14-2004 07:29 PM
How to remove Linux and restore Windows on Dual boot using Grub TheBaffledKing Linux - Newbie 13 04-14-2004 05:47 AM

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

All times are GMT -5. The time now is 09:58 PM.

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