You are not logged in.

#1 2010-06-14 16:54:35

JasonSage
Member
Registered: 2010-06-14
Posts: 11

Dual Boot with Windows 7 (Yes, I'm sorry)

I've just installed Arch Linux and have gotten my desktop environment working, and now I'm looking to be able to go back into my Windows 7 install, but this doesn't work.

I've done several edits of my menu.lst in the grub bootloader in hopes of finding a solution by trial-and-error, and the closest I've come is a "file not found" error when I booted to the partition windows is installed on.

I have also scoured the forums and wiki for a fix, to no avail.

My windows install is on /dev/sda2.

Here is my menu.lst:

# Config file for GRUB - The GNU GRand Unified Bootloader
# /boot/grub/menu.lst

...

# (0) Arch Linux
title  Arch Linux
root   (hd0,6)
kernel /vmlinuz26 root=/dev/sda5 ro
initrd /kernel26.img

# (1) Arch Linux
title  Arch Linux Fallback
root   (hd0,6)
kernel /vmlinuz26 root=/dev/sda5 ro
initrd /kernel26-fallback.img

# (2) Windows
title Windows
rootnoverify (hd0,1)
chainloader +1

I read about there being a separate partition that windows 7 creates when booting, but I do not have this partition, nor have I ever, I am positive.

Given this menu.lst, I get a "file not found" error (but not with a number).

Can this be repaired?

Last edited by JasonSage (2010-06-14 16:55:24)

Offline

#2 2010-06-14 17:08:10

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: Dual Boot with Windows 7 (Yes, I'm sorry)

Change this

# (2) Windows
title Windows
rootnoverify (hd0,1)
chainloader +1

to this

# (2) Windows
title Windows
rootnoverify (hd0,0)
chainloader +1

Grub hard drive numbers are 0-based.


P.S I think that should be the problem if you have done the installation correctly. If that does not work, post the output of the following 2 commands

sudo fdisk

and

 df -h

Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#3 2010-06-14 17:13:08

JasonSage
Member
Registered: 2010-06-14
Posts: 11

Re: Dual Boot with Windows 7 (Yes, I'm sorry)

My windows install is on /dev/sda2. That's hd0,1. hd0,0 is the system recovery partition that shipped with the computer. Ironically, I CAN boot to that, but if I went through with the process it would replace my windows install with XP and I would lose all my data (it is a full system restore).

fdisk -l :

Disk /dev/sda: 160.0 GB, 160000000000 bytes
255 heads, 63 sectors/track, 19452 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: 0xe3ebe3eb

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1           7       56196    6  FAT16
/dev/sda2   *           8       13612   109282162+   7  HPFS/NTFS
/dev/sda3           13613       19452    46909800    5  Extended
/dev/sda5           13613       18475    39062016   83  Linux
/dev/sda6           18476       18961     3903763+  83  Linux
/dev/sda7           18962       19452     3943926   83  Linux

df -h :

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda5              37G  3.0G   32G   9% /
udev                   10M  224K  9.8M   3% /dev
shm                   500M     0  500M   0% /dev/shm
/dev/sda7             3.8G   21M  3.5G   1% /boot
/dev/sr0              168M  168M     0 100% /media/ARCH_201005

Last edited by JasonSage (2010-06-14 17:13:42)

Offline

#4 2010-06-14 17:32:39

gamewolf
Member
Registered: 2009-12-02
Posts: 60

Re: Dual Boot with Windows 7 (Yes, I'm sorry)

When Windows 7 installed, bootmgr was probably installed to the MBR and not to the partition itself. So when you overwrote the MBR with grub, Windows no longer became bootable. What exactly is the error message when trying to boot from (hd0,1)?

Offline

#5 2010-06-14 17:33:27

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: Dual Boot with Windows 7 (Yes, I'm sorry)

JasonSage wrote:

My windows install is on /dev/sda2. That's hd0,1. hd0,0

Bah !! I must have missed that in your first post.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#6 2010-06-14 17:40:00

JasonSage
Member
Registered: 2010-06-14
Posts: 11

Re: Dual Boot with Windows 7 (Yes, I'm sorry)

gamewolf wrote:

When Windows 7 installed, bootmgr was probably installed to the MBR and not to the partition itself. So when you overwrote the MBR with grub, Windows no longer became bootable. What exactly is the error message when trying to boot from (hd0,1)?

The error is "error: file not found".

Offline

#7 2010-06-14 17:50:42

Julius2
Member
From: Canada
Registered: 2009-05-13
Posts: 68
Website

Re: Dual Boot with Windows 7 (Yes, I'm sorry)

As far as I remember, Windows always has to be on the first partition.


Blog .:. AUR .:. Wiki Contributions
Registered Linux User #506070.

Offline

#8 2010-06-14 17:54:17

gamewolf
Member
Registered: 2009-12-02
Posts: 60

Re: Dual Boot with Windows 7 (Yes, I'm sorry)

JasonSage wrote:
gamewolf wrote:

When Windows 7 installed, bootmgr was probably installed to the MBR and not to the partition itself. So when you overwrote the MBR with grub, Windows no longer became bootable. What exactly is the error message when trying to boot from (hd0,1)?

The error is "error: file not found".

Sorry didn't see that in your first post. So it seems that grub is not even able to reach windows at all. If it was there would be a "bootmgr not found" or no error at all. Based on what I found from google, you need to use your Windows 7 cd to repair the MBR, then reinstall GRUB from a livecd. Not exactly sure how it helps, but others got it to work.

Good luck.

Last edited by gamewolf (2010-06-14 17:58:16)

Offline

#9 2010-06-14 18:00:13

JasonSage
Member
Registered: 2010-06-14
Posts: 11

Re: Dual Boot with Windows 7 (Yes, I'm sorry)

I'll try that, but I'm curious... wouldn't that be the same as having windows installed on the machine already and then installing arch linux and grub, as the case is?

Hmm, I was previously using Grub with Ubuntu and dual booting with windows. So my mbr had already been edited for Ubuntu and Arch Linux failed to preserve the windows entry in the already edited mbr, and restoring the mbr and reinstalling grub would service to allow a dual boot AND remove any Ubuntu leftovers in the mbr.

Very nice, I'll try this and report back.

Offline

#10 2010-06-14 18:06:23

Trent
Member
From: Baltimore, MD (US)
Registered: 2009-04-16
Posts: 990

Re: Dual Boot with Windows 7 (Yes, I'm sorry)

Did you try booting from sda1 or are you assuming you know what will happen?

I don't mean any offense; I only ask because I was myself surprised to find that some laptops boot from the "recovery partition" for normal operation.  The recovery partition apparently has a chainloader that loads the real installation.  I have a friend who has such a machine; the boot flag was on the recovery partition and the GRUB menu had to be pointed to that partition.  It threw me for quite a loop.

When you installed Ubuntu, did the installer see one or two Windows partitions?

Edit:  By the way, your GRUB settings don't get stored on the MBR.  The MBR only houses the actual boot loader and information about where to find the settings on the drive.

Last edited by Trent (2010-06-14 18:09:25)

Offline

#11 2010-06-14 18:06:55

gamewolf
Member
Registered: 2009-12-02
Posts: 60

Re: Dual Boot with Windows 7 (Yes, I'm sorry)

JasonSage wrote:
# (2) Windows
title Windows
rootnoverify (hd0,1)
chainloader +1

I just noticed that you did not have the makeactive directive in your config. Add that and see if that helps.

Last edited by gamewolf (2010-06-14 18:10:19)

Offline

#12 2010-06-14 18:31:30

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: Dual Boot with Windows 7 (Yes, I'm sorry)

One thing that you can try is to boot the win7 install dvd, fixmbr, and then reinstall grub to mbr. That have worked for me a couple of times when I've had similar trouble. (with vista tho, not win7)


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#13 2010-06-14 18:41:04

JasonSage
Member
Registered: 2010-06-14
Posts: 11

Re: Dual Boot with Windows 7 (Yes, I'm sorry)

Did you try booting from sda1 or are you assuming you know what will happen?

...

When you installed Ubuntu, did the installer see one or two Windows partitions?

Why would I try sda1?

Ubuntu showed one windows partition.

I just noticed that you did not have the makeactive directive in your config. Add that and see if that helps.

I did try this in my trial-and-error adventure earlier, it did not work.

One thing that you can try is to boot the win7 install dvd, fixmbr, and then reinstall grub to mbr. That have worked for me a couple of times when I've had similar trouble. (with vista tho, not win7)

Indeed, this was the very first step I took. I inserted my Windows 7 dvd, but it would only install windows. I think this is because my Windows 7 copy is an upgrade. There was no way for me to restore my MBR.

Fortunately, I have a 98 SE disc laying around from when I had to rewrite my MBR with XP, so I figured I'd give it a try. I popped it in, got to the prompt, and typed fdisk /mbr.

Now wouldn't you know it, I restarted the machine and, lo and behold, I get a single grub error this time: "error: file not found" and it gives me a grub> rescue prompt. Only these two lines.

After much thought, I inserted my Arch Linux netinstall disc and tried to reinstall grub, but I had no network connection at that point. Instead of completely reinstalling Arch Linux, I went straight to grub and used the setup (hd0) command in the grub prompt to rewrite the MBR on that hard disk.

Restarted, I now have all the options, but windows still gives me the "error: file not found" report.

tongue Now what?

Offline

#14 2010-06-14 18:45:21

gamewolf
Member
Registered: 2009-12-02
Posts: 60

Re: Dual Boot with Windows 7 (Yes, I'm sorry)

Below the Install WIndows in the bottom left corner there should be Restore or something similar. its not big and obvious.

Offline

#15 2010-06-14 18:47:13

JasonSage
Member
Registered: 2010-06-14
Posts: 11

Re: Dual Boot with Windows 7 (Yes, I'm sorry)

gamewolf wrote:

Below the Install WIndows in the bottom left corner there should be Restore or something similar. its not big and obvious.

tongue Really? Haha, I must've missed it, I'll have another look.

Offline

#16 2010-06-14 18:53:41

655321
Member
From: Costa Rica
Registered: 2009-12-08
Posts: 412
Website

Re: Dual Boot with Windows 7 (Yes, I'm sorry)

I would say the easiest way to get your windows partition back is to use Super Grub Disk, Have saved me a couple of times and does it all automagically big_smile

Here is the link: http://www.supergrubdisk.org/

Just follow the menus and you should be good to go.


Linux user #498977
With microsoft you get windows and gates, with linux you get the whole house!
My Blog about ArchLinux and other stuff

Offline

#17 2010-06-14 19:10:01

JasonSage
Member
Registered: 2010-06-14
Posts: 11

Re: Dual Boot with Windows 7 (Yes, I'm sorry)

I tried the automatic repair and restart AND tried to diagnose and repair startup problems, and neither worked. I have access to a command prompt there, but didn't use it.

Any recommendations?

(@655321 I'll have a look)

Offline

#18 2010-06-14 19:23:05

gamewolf
Member
Registered: 2009-12-02
Posts: 60

Re: Dual Boot with Windows 7 (Yes, I'm sorry)

In the command prompt, run bootrec.exe /fixmbr and then bootrec.exe /fixboot. That should take care of it.

Offline

#19 2010-06-14 19:35:29

SiC
Member
From: Liverpool, England
Registered: 2008-01-10
Posts: 430

Re: Dual Boot with Windows 7 (Yes, I'm sorry)

gamewolf wrote:
JasonSage wrote:
# (2) Windows
title Windows
rootnoverify (hd0,1)
chainloader +1

I just noticed that you did not have the makeactive directive in your config. Add that and see if that helps.

^^ This

You should have

title Windows
rootnoverify (hd0,1)
makeactive
chainloader +1

Offline

#20 2010-06-14 19:39:38

gamewolf
Member
Registered: 2009-12-02
Posts: 60

Re: Dual Boot with Windows 7 (Yes, I'm sorry)

@SiC - We covered that in post #11

EDIT: You're right though, he should add makeactive when he's done reinstalling grub.

Last edited by gamewolf (2010-06-14 19:57:12)

Offline

#21 2010-06-14 19:59:07

JasonSage
Member
Registered: 2010-06-14
Posts: 11

Re: Dual Boot with Windows 7 (Yes, I'm sorry)

Excellent, those two commands restored the mbr and I am now booted into windows, and all I have to do now (should be) is download a live CD that I can install grub from (my archlive netinstall CD failed to do so), or at least give me the internet access I need to do so. I should be back in a little while with a perfect dual boot. Thanks folks!

(I will mark this as [solved] if it is so.)

Last edited by JasonSage (2010-06-14 19:59:47)

Offline

#22 2010-06-14 20:02:33

gamewolf
Member
Registered: 2009-12-02
Posts: 60

Re: Dual Boot with Windows 7 (Yes, I'm sorry)

No problem. Hope it all works.

Offline

#23 2010-06-15 01:17:35

JasonSage
Member
Registered: 2010-06-14
Posts: 11

Re: Dual Boot with Windows 7 (Yes, I'm sorry)

Ugh, and I'm now having trouble finding a way to install grub remotely. Does anybody know how?

Offline

#24 2010-06-15 08:09:25

demian
Member
From: Frankfurt, Germany
Registered: 2009-05-06
Posts: 709

Re: Dual Boot with Windows 7 (Yes, I'm sorry)

--root-directory=mountpoint

Last edited by demian (2010-06-15 08:09:39)


no place like /home
github

Offline

#25 2010-06-15 12:25:56

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: Dual Boot with Windows 7 (Yes, I'm sorry)

JasonSage wrote:

Ugh, and I'm now having trouble finding a way to install grub remotely. Does anybody know how?

http://wiki.archlinux.org/index.php/Gru … stallation
+
http://wiki.archlinux.org/index.php/Change_Root


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

Board footer

Powered by FluxBB