You are not logged in.

#1 2012-11-24 21:49:50

darkreaper476
Member
Registered: 2010-05-17
Posts: 102

[solved] Windows 7 and grub 2

Just when I thought I had grub figured out grub2 took over..

So Windows is on /dev/sda (a 250GB hdd with a "Stuff" partition as well)

/dev/sda1 boot* I think this is also the "win7 100MB system partition"
/dev/sda2 Where Windows 7 is*
/dev/sda3 extended*
/dev/sda5 Stuff*

Arch is on a separate 40GB hdd = /dev/sdb

/dev/sdb1 boot*
/dev/sdb2 swap*

Here's the kicker The 40GB drive aka /dev/sdb is first to boot according to my bios, so I boot Arch no problem with grub2, now for the life of me I cant get windows 7 to boot.

I put

# (2) Windows 7
menuentry "Windows 7" {
    set root=(hd0,0)                    also tried hd0,1 through 3
    chainloader (hd0,0)+1
}

in /etc/grub.d/40_custom and ran grub-mkconfig -o /boot/grub/grub.cfg

Any help please. I need to get into windoze...

Thanks

P.S. This is a FRESH install of Arch.

Last edited by darkreaper476 (2012-12-30 05:31:57)

Offline

#2 2012-11-24 21:54:30

googol-1
Member
Registered: 2012-10-21
Posts: 22

Re: [solved] Windows 7 and grub 2

Install os-prober (remove the entry from 40_custom) and ran grub-mkconfig -o /boot/grub/grub.cfg

Offline

#3 2012-11-25 02:22:04

darkreaper476
Member
Registered: 2010-05-17
Posts: 102

Re: [solved] Windows 7 and grub 2

forgot to mention I tried that. results of running os-prober as root.

http://imgur.com/mst6I.jpg

Notice it doesn't show /dev/sda2 ......

thanks.

Last edited by darkreaper476 (2012-11-25 03:25:53)

Offline

#4 2012-11-25 07:13:06

the.ridikulus.rat
Member
From: Indiana, USA
Registered: 2011-10-04
Posts: 765

Offline

#5 2012-11-25 07:16:42

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [solved] Windows 7 and grub 2

Syslinux is more awesomer then grub2 I think.  Simplicity rules!

Offline

#6 2012-11-25 08:36:03

darkreaper476
Member
Registered: 2010-05-17
Posts: 102

Re: [solved] Windows 7 and grub 2

.... You really think I didn't go straight to the wiki?? Please don't assume that I haven't searched my self, I've been on every damn page about grub 2 and windows.... I need help. Direction.... Not a damn link I've seen a million times.

Anyone with actual insite to how I can fix this please post... I should have posted the necessary info to someone who knows grub 2 and multi HDDs

Last edited by darkreaper476 (2012-11-25 08:40:25)

Offline

#7 2012-11-25 09:11:26

SoleSoul
Member
From: Israel
Registered: 2009-06-29
Posts: 319

Re: [solved] Windows 7 and grub 2

This is not a definite answer, just some things I would have tried if I were you.
First, I always use "chainloader +1" without any (hdx,x). I don't think it matters but that's how it works here.
Secondly, a few times I was surprised by the number grub gave to a physical HD. I would try making sure what (hd1,0) contains. You can check by going to grub console (press "c" at the menu), write

set root=(hd1,0)

and then write

linux /<tab>

grub's autocompletion would show you the files and folders the partition contains. This way, when you are sure you are on the right partition by seeing windows files there, you can write

chainloader +1
boot

to boot Windows. If it works, change grub.cfg.

Something to note: As you said, Windows 7 needs a primary partition to put its boot information in. Maybe you installed something after Windows which overwritten the boot information for windows 7. To fix that you will have to fix the boot of Windows from its installation cd, and then boot Arch from a live media with grub and run grub-install again. I had to do it once.

Offline

#8 2012-11-25 15:47:46

shulamy
Member
From: israel
Registered: 2010-09-11
Posts: 451

Re: [solved] Windows 7 and grub 2

maybe you need "map" because of the different disks.

ezik

Offline

#9 2012-11-25 18:03:01

darkreaper476
Member
Registered: 2010-05-17
Posts: 102

Re: [solved] Windows 7 and grub 2

SoleSoul wrote:

This is not a definite answer, just some things I would have tried if I were you.
First, I always use "chainloader +1" without any (hdx,x). I don't think it matters but that's how it works here.
Secondly, a few times I was surprised by the number grub gave to a physical HD. I would try making sure what (hd1,0) contains. You can check by going to grub console (press "c" at the menu), write

set root=(hd1,0)

and then write

linux /<tab>

grub's autocompletion would show you the files and folders the partition contains. This way, when you are sure you are on the right partition by seeing windows files there, you can write

chainloader +1
boot

to boot Windows. If it works, change grub.cfg.

Something to note: As you said, Windows 7 needs a primary partition to put its boot information in. Maybe you installed something after Windows which overwritten the boot information for windows 7. To fix that you will have to fix the boot of Windows from its installation cd, and then boot Arch from a live media with grub and run grub-install again. I had to do it once.

I think you may be right about that partition being over written.... With the given info above, you can see fdisk shows that partition as boot.... Not being able to install grub and fix my system after a window install is what led me to reinstalling arch in the first place.... It was running strong since 2010......

Any way, I tried the tab trick and it didn't auto complete anything.. Though I don't know how it would.. I do know that /dev/sda2 is my windows partition.

thanks

Offline

#10 2012-11-25 18:05:50

SoleSoul
Member
From: Israel
Registered: 2009-06-29
Posts: 319

Re: [solved] Windows 7 and grub 2

I should have wrote

linux /<tab><tab>

It works here.
Sorry tongue

Edit: btw, do you remember how you tried to reinstall grub?

grub-install /dev/sdx

should have worked regardless of the state of the partitions themselves because it writes to the MBR, not to a boot sector of a partition, so I'm curious why it didn't work for you.

Last edited by SoleSoul (2012-11-25 18:09:23)

Offline

#11 2012-11-25 19:30:10

darkreaper476
Member
Registered: 2010-05-17
Posts: 102

Re: [solved] Windows 7 and grub 2

I know how auto finish tab works.. it just didnt show anything..

So after I ruined everything tring to fix the windows boot loader, this is what I did, and I'm not proud of it..

ok so when I installed win7 I did it on its own HDD while the linux hdd was unplugged.. I needed windoze... emergency.... So Now that I plugged in my linux hdd windows obvously got pissed it wasnt first to boot..... which is why grub couldnt boot it- the windows didnt even know where it was... SOOO I changed the order, put the windows drive first, fixxed the MBR in windows.. Booted into windows, used a program that adds linux to the windows bootloader and bam... now I can boot into both... yes its hacked... no Im not proud of this....... ugghh


thanks though. mark as solved.. I dont know how.. lol

Offline

#12 2012-11-25 20:05:36

SoleSoul
Member
From: Israel
Registered: 2009-06-29
Posts: 319

Re: [solved] Windows 7 and grub 2

I think this is a good solution as any. You just used another boot loader. Congratz.

Offline

#13 2012-12-07 23:19:10

supatortoiseboy
Member
Registered: 2012-12-04
Posts: 8

Re: [solved] Windows 7 and grub 2

Grub 2 has switched to partition indexinge so what was hd0,0 is now hd0,1 (I think this is the solution to get your boot working with your arch hdd as first in boot order)

If you do try to fix your grub2 boot please let me know if this solved it.

Offline

#14 2012-12-30 03:58:08

darkreaper476
Member
Registered: 2010-05-17
Posts: 102

Re: [solved] Windows 7 and grub 2

I already posted mark as solved.
Again, Thanks.

Offline

#15 2012-12-30 04:00:32

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: [solved] Windows 7 and grub 2

Edit the first post and add [solved] to the subject line.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

Board footer

Powered by FluxBB