Fedora Linux Support Community & Resources Center
  #1  
Old 5th December 2009, 11:14 PM
kfox112 Offline
Registered User
 
Join Date: Dec 2009
Posts: 3
windows_7firefox
Grub Overwrote my MBR :(

Hey Guys,

I'm wondering why this happened:
When installing Fedora alongside an existing windows 7 installation, I specified to install grub to the boot sector of my primary partition /dev/sda3 (Where /dev/sda1 was my 7 bootloader and /dev/sda2 was 7 itself). Yet my master boot record was still overwritten. Is that the way it's supposed to work?

If so, how would one go about installing fedora without overwriting the MBR, but still installing grub to the primary partition?

Thanks
Reply With Quote
  #2  
Old 5th December 2009, 11:26 PM
stoat Offline
Registered User
 
Join Date: Jun 2006
Posts: 7,551
windows_xp_2003ie
Hello kfox112,

If you installed Fedora 11 or later, then your master boot record was probably not overwritten. What actually happened is the active partition was changed from the Windows partition to the Fedora boot partition. Therefore, the MS boot code in the master boot record which used to load and execute the boot sector code of the Windows partition now loads and executes the GRUB stage1 that you installed in the Fedora boot sector. See what I mean? To the eye, it appears as though GRUB was installed in the master boot record. All you have to do is boot into Fedora and use fdisk or gparted to return the active partition to the Windows partition. Then Windows will boot directly from BIOS again. But Fedora will no longer boot until you configure Windows to boot it.
Reply With Quote
  #3  
Old 5th December 2009, 11:42 PM
kfox112 Offline
Registered User
 
Join Date: Dec 2009
Posts: 3
linuxfedorafirefox
Quote:
Originally Posted by stoat View Post
Hello kfox112,

If you installed Fedora 11 or later, then your master boot record was probably not overwritten. What actually happened is the active partition was changed from the Windows partition to the Fedora boot partition. Therefore, the MS boot code in the master boot record which used to load and execute the boot sector code of the Windows partition now loads and executes the GRUB stage1 that you installed in the Fedora boot sector. See what I mean? To the eye, it appears as though GRUB was installed in the master boot record. All you have to do is boot into Fedora and use fdisk or gparted to return the active partition to the Windows partition. Then Windows will boot directly from BIOS again. But Fedora will no longer boot until you configure Windows to boot it.
LMAO,

I'm in love with you if you are right. I'm currently installing fedora updates, so I have to wait to figure this out. But that sounds about right considering I spent the last hour trying to figure out why restoring my original MBR has not worked as I thought it would. Please dear got let that be all it is.
Reply With Quote
  #4  
Old 5th December 2009, 11:54 PM
stoat Offline
Registered User
 
Join Date: Jun 2006
Posts: 7,551
windows_xp_2003ie
Quote:
Originally Posted by kfox112

Please dear got let that be all it is.
Actually, I don't think this is so bad. Why not leave it this way? There is a good chance that "Other" in your Fedora boot menu will boot Windows right now. And if it doesn't, a simple tweak to the grub.conf file usually makes it happen. Before you do anything to the active partition, try "Other" in the Fedora boot menu. If it doesn't boot Windows, then return and post the results of these...
Code:
su
fdisk -l
cat /boot/grub/grub.conf



P.S.: This change-the-active-partition thing started with Fedora 11. I think there have already been changes made by the developers to stop this from happening next time. But for now, it could be viewed in a positive light... A new boot loader variation for the paranoid Windows user who wants no changes to the current Windows boot loader arrangement. The advantage is that no configuring of the Windows boot loader is needed for Fedora (and Windows) to boot. And all that is needed to bail out and go back to Windows is fix the active partition (easy to do). It's actually kind of a neat twist. It works in my head anyway. I hope you try it and confirm it.

P.P.S.: I'm not willing to bet our lives on it, but I still believe that your MS master boot record is safe and sound.

Last edited by stoat; 5th June 2010 at 02:35 PM.
Reply With Quote
  #5  
Old 6th December 2009, 12:37 AM
kfox112 Offline
Registered User
 
Join Date: Dec 2009
Posts: 3
linuxfedorafirefox
The MBR was fine, you were correct. I changed the boot flag to /dev/sda3 and all was well once again. I guess I'm a little confused about how the MBR works now though. I always thought that it was essentially a pointer to the location of boot code to execute. Which no longer makes sense given you can select a boot partition. I guess I need to read up on that.

But for the time being, I've got other issues to figure out. Fedora 12 x64 keeps giving me a kernel crash error ever two minutes or so. Everything seems stable otherwise.
Reply With Quote
  #6  
Old 6th December 2009, 01:05 AM
stoat Offline
Registered User
 
Join Date: Jun 2006
Posts: 7,551
windows_xp_2003ie
Quote:
Originally Posted by kfox112

I guess I'm a little confused about how the MBR works now though.
The boot code of an MS master boot record examines the partition table (also located in the master boot record) to determine the active partition. It then loads the boot sector code of that partition into memory and executes it. You already know what happens next. MS systems have always booted this way. Since forever. And still do today.

On the other hand, GRUB installed in a master boot record does not look at the partition table nor does it even care about the active partition (which seems odd to people since Anaconda now changes the active partition to Fedora's boot partition). GRUB stage1 in the master boot record has the sector address of the next stage embedded in it at the time it is written to the MBR. GRUB stage1 in an MBR loads the next stage which is stage1.5 located in the normally unused sectors of the so-called DOS Compatibility Area immediately following the master boot record (the first partition doesn't begin until sector 63). Stage1.5 can find the next stage in the filesystem (/boot/grub/stage2). And so on and on and on.

Last edited by stoat; 6th December 2009 at 01:13 AM.
Reply With Quote
Reply

Tags
grub, mbr, overwrote

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
Dumb move - overwrote fstab zak_neutron Using Fedora 5 23rd June 2009 01:47 PM
upgraded to vista, overwrote GRUB, can it be restored by doing an upgrade install? jsanders Using Fedora 2 12th February 2007 12:02 AM
I overwrote my /etc/fstab file!!! Please help! thesun Installation and Live Media 16 8th September 2005 10:06 PM
Overwrote crontab file blackarib Using Fedora 1 29th August 2005 02:20 AM
overwrote fc4 yum.conf w/ fc3 yum.conf mjkelly93 EOL (End Of Life) Versions 5 14th June 2005 10:23 PM


Current GMT-time: 04:01 (Thursday, 23-05-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