Solved

dual boot windows 7 and  fedora 13

Posted on 2010-08-15
17
974 Views
Last Modified: 2013-12-06
Hi

I've installed Fedora 13 on my pc and now i can't boot into windows 7 the option isn't listed on the grub boot menu only fedora

hard drive set up

sda1  = windows 7
sda3 = fedora 13

sda2 = data

how do i edit the grub menu to include windows 7 preferably as defult boot

thank you
0
Comment
Question by:trevor1940
  • 8
  • 8
17 Comments
 
LVL 3

Expert Comment

by:Onity
Comment Utility
http://ubuntuforums.org/showthread.php?t=1035999

If you have a look at step 5 i believe that may help :)
0
 
LVL 1

Author Comment

by:trevor1940
Comment Utility
Hi

followed step 5 as suggested now get error 'BOOTMANGR missing'

attempted both root (hd0,0) and root (hd0,1)

fedora os is at root (hd0,2)
0
 
LVL 35

Expert Comment

by:torimar
Comment Utility
When it comes to boot manipulations, it is imperative to understand very well what one is doing, otherwise a complete system is easily rendered inoperational.

In the present case, you unfortunately followed the wrong guide. The guide was written for Linux systems where an additional Windows 7 gets installed, and the Windows bootloader overwrites the Linux Grub bootloader which then has to be reinstalled because Linux can no longer be booted. That is the exact opposite to your own case.

The correct instruction would have been to make you look into the grub.conf file and add boot information for chainloading the Windows bootloader.
By proceeding as you did, as I understand it, you instead made a twofold error:
1. you reinstalled Grub (which was already working) to the boot sectors of the Windows partitions, thus effectively overwriting any Windows boot code which might have been residing there, thus rendering Windows unbootable;
2. you overwrote the Grub information in the MBR (master boot record) in a way that makes it now look for its boot files on sda1 and/or sda2 where no Grub boot files are, thus rendering Linux unbootable as well.

Repairing these errors will require twofold action as well.

1. Boot your system from a Live CD, repeat the steps you took above (from the link), but this time install Grub to "root(hd0,2)".

Please take note of the following:
a) -- Make sure your partition setup actually is as you think it is; Windows 7 frequently makes use of a small hidden boot partition at the beginning of the drive - which, if it exists, would add +1 to all of your partitions, meaning that Fedora resides in sda4, not sda3. Also: the Fedora installation program could have set Fedora up on a logical partition (in which case it would be sda5) in order to be able to create an additional swap partition. So please run 'fdisk -l' first in order to get an impression of your actual partitioning scheme, then alter the 'root(hdx,x)' command accordingly.

b) -- It is imperative that you use a Fedora Live CD, not Ubuntu or some other popular distro, because most other current Linux distros use Grub2, and not the Grub Legacy that Fedora still uses. With Grub2, these steps will not work!

If all runs well, you will now be in the position you were in when you started this thread: Linux boots, but no Windows.

I shall deal with this in my next comment, but first let's make sure your regained Grub is safely backed up:
- copy the file /boot/grub/grub.conf to a USB flash drive or some other removable media;
- print its contents - we may need it later (on a Windows machine, if necessary: it's a simple text file);
- as root, run the command:
cp /boot/grub/grub.conf /boot/grub/grub.conf.bak
0
 
LVL 35

Expert Comment

by:torimar
Comment Utility
2. We are now going to try and make Windows boot again

In Fedora, as root, open /boot/grub/grub.conf for editing.
In the menu list (entries beginning with "title"), is there an entry for Windows that looks somewhat like this:

title Windows
     root (hd0,0)
     makeactive
     chainloader +1

If not so, add it. Save and reboot. Select the new Windows entry in the Grub boot menu. Does Windows 7 load?

If not so, this is not surprising and confirms the reports of problems I've read. The above entry would have booted any Windows up to Vista, but with Win7 Microsoft added needless complications.
Reboot to Fedora, open the menu file again and replace the above entry by this one:

title Windows 7
     rootnoverify (hd0,0)
     chainloader +2

Save and reboot. Select Windows 7 from the menu. Does it boot now? If yes: good, the trick is known by few people only, but it actually seems to work.
If not so: I fear we'll have to run a Windows 7 Startup Repair. Insert the Windows 7 DVD and follow this guide:
http://www.windowsreinstall.co.uk/win7enterprise/repairwin7startup/indexthumbs.htm

When done, two results are possible:
1. The Grub menu still shows on bootup, and the Windows 7 option now works.

2. The Grub menu is gone and Windows 7 loads automatically. In this case, install EasyBCD in Windows 7: http://neosmart.net/dl.php?id=1
and follow the documentaion here: http://neosmart.net/wiki/display/EBCD/Linux
If you find that EasyBCD will not offer you Linux as a bootable option rightaway, you may have to use its 'Neogrub' option. The boot menu entries required for your Fedora to be booted will be found in your grub.conf file (which you saved to flash drive and printed out, remember?)

Good luck.
0
 
LVL 1

Author Comment

by:trevor1940
Comment Utility
torimar

Hi i have a feeling i've totaly mesed this up

at stage 4 of the link
the out put from grub is
grub> find /boot/grub/stage1
find /boot/grub/stage1
 (hd5,0)
grub>

so i did
su grub
grub> root (hd5,0)
grub> setup (hd0)
grub> quit

on reboot all i got was a orange super grub splash screen taking the only option gave a second screen with options like linx auto linx manual windows auto etc

taking linux auto (I thing) didn't do anything except reboot

on reboot the system hangs at "verify DMI pool"
 

i've included the output from fdisk -l i beleave windows is at /dev/sda1 and the stage1 file is at /dev/sda5

root@localhost liveuser]# fdisk -l



Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes

255 heads, 63 sectors/track, 243201 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: 0x88dca560



   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1               1      243202  1953512448    7  HPFS/NTFS



Disk /dev/sdc: 2000.4 GB, 2000397852160 bytes

255 heads, 63 sectors/track, 243201 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: 0xa59c2689



   Device Boot      Start         End      Blocks   Id  System

/dev/sdc1   *           1      243202  1953511424    7  HPFS/NTFS



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: 0xa59c26bc



   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1        5100    40960000    7  HPFS/NTFS

/dev/sda2            5100        5164      512000   83  Linux

/dev/sda3            5164       10322    41431040    5  Extended

/dev/sda4           10322       19457    73383936    7  HPFS/NTFS

/dev/sda5            5164       10322    41430016   8e  Linux LVM



Disk /dev/sdd: 2000.4 GB, 2000398934016 bytes

255 heads, 63 sectors/track, 243201 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: 0x5f28307e



   Device Boot      Start         End      Blocks   Id  System

/dev/sdd1               1      243202  1953512448    7  HPFS/NTFS



Disk /dev/sde: 2000.4 GB, 2000398934016 bytes

255 heads, 63 sectors/track, 243201 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: 0x71857cb8

   Device Boot      Start         End      Blocks   Id  System

/dev/sde1               1      243202  1953512448    7  HPFS/NTFS



Disk /dev/sdf: 1028 MB, 1028653056 bytes

255 heads, 63 sectors/track, 125 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: 0x00000000



   Device Boot      Start         End      Blocks   Id  System

/dev/sdf1   *           1         126     1004480    b  W95 FAT32

Partition 1 has different physical/logical endings:

     phys=(124, 254, 63) logical=(125, 15, 18)



Disk /dev/dm-0: 3221 MB, 3221225472 bytes

255 heads, 63 sectors/track, 391 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: 0x00000000



Disk /dev/dm-0 doesn't contain a valid partition table



Disk /dev/dm-1: 3221 MB, 3221225472 bytes

255 heads, 63 sectors/track, 391 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: 0x00000000



Disk /dev/dm-1 doesn't contain a valid partition table



Disk /dev/dm-2: 36.8 GB, 36842766336 bytes

255 heads, 63 sectors/track, 4479 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: 0x00000000



Disk /dev/dm-2 doesn't contain a valid partition table



Disk /dev/dm-3: 5570 MB, 5570035712 bytes

255 heads, 63 sectors/track, 677 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: 0x00000000



Disk /dev/dm-3 doesn't contain a valid partition table

[root@localhost liveuser]# 

grub> find /boot/grub/stage1

find /boot/grub/stage1

 (hd5,0)

grub> 

Open in new window

0
 
LVL 1

Author Comment

by:trevor1940
Comment Utility
torimar:

Just read your second post again I ran a Windows 7 Startup Repair after i first got the error 'BOOTMANGR missing'

this is what distroyed the grub menu
0
 
LVL 35

Expert Comment

by:torimar
Comment Utility
As I presumed, the partition setup on your main HDD was not like you thought it was. Your data and your main Linux are in fact on logical partitions inside an extended.

I've contemplated the issue for a while now.
To cut a long story short: some things really have gone wrong here, and some things have been wrong from the start. I keep telling people to *not* use LVM (logical volume management), as unfortunately proposed by most modern Linux installers, on a multi-boot system. That makes things overcomplicated and impedes all easy repair steps.

To corroborate my statement, no /boot/grub/stage1 is presently found inside your sda5 (= hd0,4) - presumably because the grub shell can't read those logical volumes without a device manager running.
Instead, a /boot/grub/stage1 is found on hd5,0 - which is sdf, the sixth(!) of your hard drives. Whatever it is that you have there, it's got nothing to do with your Fedora/Win7 setup. Could be a SuperGrub Disk, because that's what you got after trying to boot from it.

Please: disconnect all external drives/media that you can disconnect! They are only a disturbance.
Please also only use the Fedora Live CD - no SuperGrub or anything else fancy.

As I see it, you have two options:

1. Reinstall Fedora doing it properly for multi-booting this time. You will not loose much or anything because you haven't yet used it. Please reply here if you choose this option, so I may give you some preparatory hints.

2. Reinstall Grub to the logical volume containing Fedora. This should, ideally, only take a minute or two, but it has 3 drawbacks: a) I never did it myself because I don't use LVM; b) there is no guarantee this will actually fix things; c) even if it works subsequent editing of the grub menu in order to make Windows boot will be more complicated than necessary.

For option #2, boot off the Fedora Live CD, then issue these commands in a terminal:

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
0
 
LVL 35

Expert Comment

by:torimar
Comment Utility
On a second thought:

If I were in your position, before doing anything else like reinstalling Grub or reinstalling Fedora, I'd try to find out if Windows still is bootable. After all, the Startup Repair did not work well although it removed the Grub code.
If Windows will no longer boot by itself, then obviously there isn't much hope that it will boot if invoked via Grub.

So please insert the Win7 DVD and run the Startup Repair a second time. If that won't do to make your system boot right into Win7, clear the MBR like described here: http://www.ehow.com/how_4836283_repair-mbr-windows.html
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 1

Author Comment

by:trevor1940
Comment Utility
torimar
Attempted to clear & rebuild the the MBR to no avail
from your coments i think i'm going to go for a  clean install of both win 7 and Fedora this shouldn't be much of an issue as no data is stored within os partions 'MY Documments' has it's own partion
so the System disk is a fast 160GB sata drive split in 3 the other drives are simply large internal Data drives

before i do this i'll attempt a system restore from an img file if  this fails what steps should i follow to acheive a muliboot system?

Thank you
0
 
LVL 35

Accepted Solution

by:
torimar earned 500 total points
Comment Utility
1. Prepartition
This will prevent Win7 from making the small hidden system partition which you neither need nor want, and it will make it easier to customize the Fedora installation.

Get the Parted Magic Live CD: www.partedmagic.com (small and invaluable for cases like this)
Boot off it and use the Partition Manager (actually GParted) to set your scheme up like this more or less:

sda1 Primary Ntfs - Win7 Sytem partition
sda2 Primary Ntfs or Fat32 - Data (Fat32 is 100% compatible with Linux, but will not allow files larger than ~4.4 GB size)
sda3 Extended
sda5 Logical Ext3/Ext4 - Linux
sda6 Logical Swap - Linux Swap (~ 2Gb)

Then install Win7 to the first partition, later (after checking point #2) install Fedora to sda5 (mountpoint /) and sda6 (mountpoint swap). Remember to not use LVM.


2. Select bootloader
You can use Grub (which will require Fedora to remain present on the system for it to be operational) or EasyBCD: http://neosmart.net/dl.php?id=1 from within Win7 (which will make Win7 your primary OS and OS loader).

We haven't yet found out why in your previous installation Grub would not boot Win7 - maybe it was just a configuration error on your side during installation. Unfortunately, the Fedora Anaconda installer (at least up to Fedora 12) doesn't come anywhere close to most of the other Linux installers with regards to ease of use.
As to Grub itself, I really like the old Grub Legacy (as used by Fedora) and am quite confident about it. I find it much easier to configure and troubleshoot than the new Grub2. But then, I have never personally run Grub Legacy together with Win7 in a multi-boot environment so far.

If you decide to use EasyBCD, take a close look at this guide: http://neosmart.net/wiki/display/EBCD/Linux

***Note***:
For EasyBCD to work it is imperative that you don't let Fedora install Grub to the MBR (master boot record) as it wants to do by default. Instead, have it install Grub into the Fedora root partition. Unfortunately, here the Anaconda installer makes it quite easy to overlook that configuration option, because it is hidden behind an 'Advanced options' button (or something called similar).
Maybe this page will help you get along: http://neosmart.net/wiki/display/EBCD/Fedora
If in doubt, simply abort the installation and report back here; I'll check and see if I can get some screenshots.
0
 
LVL 1

Author Comment

by:trevor1940
Comment Utility
torimar:

Hi the process you describe isn't something i can achieve during a couple of hours one evening so i'm going to leave it until the weekend

Just letting you know so your not thinking i didn't appreciate your help
0
 
LVL 35

Expert Comment

by:torimar
Comment Utility
Take your time.
These things should not be hastened.
0
 
LVL 1

Author Comment

by:trevor1940
Comment Utility
torimar
Some success but didn't quite go according to plan
using get parted formatted the disk as advise installed Win 7 and got that working, installed EasyBCD.
Then created an image just in case.

Installed Fedora but it re adjusted the Extended / Linux partition no big deal.
Followed instructions about loading Grub (I Thought) but on reboot I now get the fedora / grub boot menu this has two option default fedora and other.

Selecting other then loads the EasyBCD menu with options to boot into windows

So I can boot into both but is a bit of a fad. I'm tempted to remove Easy BCD then edit Grub is this possible?

As to why this went wrong to start with my hunch is that before I installed Fedora I was using Unbuto attempting to recover data from an External hard disk that had failed and simply instead Fedora over the top.
0
 
LVL 35

Expert Comment

by:torimar
Comment Utility
I don't think that hunch of yours is correct: Ubuntu and Fedora use two different versions of Grub that are incompatible with each other.

I guess it actually went wrong at the instant where you missed the option to have Fedora install Grub not to the MBR, but to the boot sector of its root partition. As I said above, this option is very very easy to miss - even if you are aware of that fact. Whenever I have to install Fedora on a multi-boot system, I get a little nervous.

But as it looks, you still have two options:
Either a) get rid of EasyBCD and use only Grub, or b) re-install EasyBCD to the MBR (should be just a mouse-click).
Depends on what you want, really.

As to a)
Uninstalling EasyBCD form within Win7 should remove its boot menu, so that booting "Other" from the Fedor Grub should load Win7 rightaway. Never proceeded like this myself, but I can't imagine that removing EasyBCD will render Win7 unbootable or leave any unpleasant remnants.

As to b)
Before doing so, boot into Fedora and save your /boot/grub/grub.conf to external media as a text file. Best try and print it out, too. You might need its boot information for the EasyBCD Neogrub module.

The /boot/grub/grub.conf is also the file that lets you customize the Fedora boot menu; you could, for instance, change the "title Other" to "title Windows 7"; you could adjust the timeout, and the default boot option etc.
0
 
LVL 1

Author Comment

by:trevor1940
Comment Utility
torimar:

Thank you for your help I was able to  re-install EasyBCD to the MBR so i now only have  one boot menu
0
 
LVL 35

Expert Comment

by:torimar
Comment Utility
I'm glad to hear you finally got there.

If the issue is solved would you mind closing the question?
0
 
LVL 1

Author Closing Comment

by:trevor1940
Comment Utility
Thank you
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This document is written for Red Hat Enterprise Linux AS release 4 and ORACLE 10g.  Earlier releases can be installed using this document as well however there are some additional steps for packages to be installed see Metalink. Disclaimer: I hav…
So many times I have seen the words written in a question "if only I could show you" or " I know how hard it is for you since you can't see it" in any zone. That has inspired me to write about this tool in windows 7 called "Problem Steps Recorder…
This Micro Tutorial will give you a basic overview of Windows Live Photo Gallery and show you various editing filters and touches to photos you can apply. This will be demonstrated using Windows Live Photo Gallery on Windows 7 operating system.
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

5 Experts available now in Live!

Get 1:1 Help Now