LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 11-25-2012, 07:57 AM   #1
pwrightfl
LQ Newbie
 
Registered: Nov 2012
Posts: 3

Rep: Reputation: Disabled
Grub2 refuses to boot Windows 7


Greetings,

For the past week and a half I've been trying to get Grub2 to boot Windows 7 with no luck. Selecting the Win7 menu item causes the machine to reboot and relaunch Grub. Grub is able to find windows 7 and make an entry via os-prober. My internet search has been very inconclusive to a solution and none work, the results are the same. I did come across that there is a possible bug and updating Grub 1.98 to 2.00 may fix the problem, but I'm not sure of the implications changing to a new version and the work-around is the same code (menu entry) generated by grub-update. There also seems to be confusion between grub and grub2, i.e. chainloader and ntldr and answers labeled as a fix don't work on this install. Another fix is to use the Win7 boot manager but I trying not to be dependent MS products.


General info:
Debian 6.0.6
---
fdisk -l

Device Boot Start End Blocks Id System
/dev/sda1 * 1 32 248832 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 32 24793 198896641 5 Extended
/dev/sda5 32 24793 198896640 8e Linux LVM

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 13 102400 7 HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sdb2 13 5100 40857600 7 HPFS/NTFS
---
grub-install -v
grub-install (GRUB) 1.98+20100804-14+squeeze1

---
Grub menu entry:

menuentry "Windows 7 (loader) (on /dev/sdb1)" {
insmod part_msdos
insmod ntfs
set root='(hd1,msdos1)'
search --no-floppy --fs-uuid --set f2a89d67a89d2b5d
chainloader +1
}

Currently, to get the machine to boot Win7 is to pull the cable on the Linux HD but that really is a bit crude. Any suggestions would be most grateful.

Cheers.
 
Old 11-25-2012, 11:33 AM   #2
yancek
Senior Member
 
Registered: Apr 2008
Distribution: PCLinux, Ubuntu, Slackware
Posts: 4,953

Rep: Reputation: 785Reputation: 785Reputation: 785Reputation: 785Reputation: 785Reputation: 785Reputation: 785
The problem is that windows is on the second drive and needs to be mapped so that windows "thinks" it is on the first drive. Take a look at the first 2 posts at the link below in which a solution is achieved. Reading all the posts will give you some more useful information:

http://forums.justlinux.com/showthre...mapping-drives
 
Old 11-25-2012, 11:33 AM   #3
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: /root
Distribution: Slackware & BSD
Posts: 1,218

Rep: Reputation: 231Reputation: 231Reputation: 231
Install grub2 again clearing whatever mapping it had:

Code:
grub-install --recheck /dev/sda
And also update-grub

Code:
update-grub
Then try to add a drive mapping entry after the set root command, edit your /boot/grub/grub.cfg that update-grub just created: example:

Code:
menuentry "Windows 7 (loader) (on /dev/sdb1)" {
insmod part_msdos
insmod ntfs
set root='(hd1,msdos1)'
drivemap -s hd0 hd1
search --no-floppy --fs-uuid --set f2a89d67a89d2b5d
chainloader +1
}
See if it works for you.

Last edited by malekmustaq; 11-25-2012 at 11:34 AM.
 
Old 11-25-2012, 12:06 PM   #4
jheengut
Member
 
Registered: Sep 2006
Location: Providence, Moka Mauritius
Distribution: Slackware, OpenSuse, Debian, Fedora, Mageia, Ubuntu, RedHat, BSD, Gentoo, Puppy
Posts: 182
Blog Entries: 2

Rep: Reputation: 3
Thumbs down

maybe it is better to stop using win7 in the first place.

I did it.

did you try lilo??
 
Old 11-25-2012, 02:06 PM   #5
pwrightfl
LQ Newbie
 
Registered: Nov 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks for looking.

malekmustaq and yancek, When I first saw mapdrive -s some time last week I thought is was a revelation. Unfortunately is doesn't work. I tried it again to be sure.

---
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows 7 (loader) (on /dev/sdb1)" {
insmod part_msdos
insmod ntfs
set root='(hd1,msdos1)'
drivemap -s hd0 hd1
search --no-floppy --fs-uuid --set f2a89d67a89d2b5d
chainloader +1
}
### END /etc/grub.d/30_os-prober ###

And trying to follow the logic, I also tried this:

menuentry "Windows 7 (loader) (on /dev/sdb1)" {
insmod part_msdos
insmod ntfs
drivemap -s hd0 hd1
set root='(hd0,msdos1)'

search --no-floppy --fs-uuid --set f2a89d67a89d2b5d
chainloader +1
}

The drives are swapped therefore point to the first partition on the first drive. No go.

Here are the results on the grub-install

# grub-install --recheck /dev/sda
Installation finished. No error reported.
# grub-install --recheck /dev/sdb
Installation finished. No error reported.

And jheengut; My intention is to distance myself from MS and when Steam fully supports LINUX, I'll be that much closer. Also AMD/Radeon say they are supporting video drivers for LINUX but they are not very good.

Cheers
 
Old 11-25-2012, 02:56 PM   #6
yancek
Senior Member
 
Registered: Apr 2008
Distribution: PCLinux, Ubuntu, Slackware
Posts: 4,953

Rep: Reputation: 785Reputation: 785Reputation: 785Reputation: 785Reputation: 785Reputation: 785Reputation: 785
Check to see if the uuid you have is correct for windows sdb1 (f2a89d67a89d2b5d) by running this command: blkid. I'm not sure if case sensitivity is necessary but that would be something to check easily. If the blkid shows uppercase letters, change the uuid entry.

You could try commenting out the "search" line by putting a hash mark (#) at the beginning of the line. I don't believe it is needed to chainload. After making the changes, reboot without running update-grub to see if it works. If it does, copy the entry to the /etc/grub.d/40_custom file, save it and run update-grub again. If it fails, note and messages or errors and post.

You could go to the site below and download/run the bootinfoscript and review its output, a results.txt file to see if that helps. You could also post it here.

http://sourceforge.net/projects/bootinfoscript/
 
Old 11-25-2012, 11:34 PM   #7
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: /root
Distribution: Slackware & BSD
Posts: 1,218

Rep: Reputation: 231Reputation: 231Reputation: 231
After editing /boot/grub/grub.cfg do not run either grub-install or update-grub, reboot directly. What is your current "cat"ting of your grub.cfg? Please provide us after failing to boot.

Try swapping the hd0 and hd1 at the drivemap, the chainloader might have confused a bit, try it this way--

Code:
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows 7 (loader) (on /dev/sdb1)" {
insmod part_msdos
insmod ntfs
set root='(hd1,msdos1)'
drivemap -s hd1 hd0
search --no-floppy --fs-uuid --set f2a89d67a89d2b5d
chainloader +1
}
Also, as Yancek suggested meantime comment out '#' the 'search' command as it is not necessary after you have set the root by the drivemap.

HOpe that helps.

Good luck.
 
Old 11-30-2012, 03:10 PM   #8
pwrightfl
LQ Newbie
 
Registered: Nov 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
Greetings again

So I have tried several of the suggestions, but no joy yet. As to the drivemap command,

drivemap -s hd0 hd1 is equivalent to
map hd0 hd1
map hd1 hd0
, but map is no longer supported.
I tried drivemap -s hd1 hd0 anyway and still no luck.

Other things I have tried with no luck: Both OS on one (first) HD; Both on one drive with the Win7 and 100MB partition removed; Installed Ubuntu instead of Debian. Ubuntu was able to find Win7 but grub still was unable to boot it.

I did come across this in the Grub 2.00 Manual, and several other places:

menuentry "Windows 7" {
insmod ntfs
search --set=root --label WINDOWS_7 --hint hd0,msdos2
ntldr /bootmgr
}

The file ntldr.mod is not available in Grub2 v1.98, but it is in Grub2 v2.00 and Debian experimental packages (grub-pc-bin (2.00-7)). How do you go about in doing just an upgrade to grub? It appears to need grub-pc, but that is only available at v1.98.

Cheers
 
Old 12-01-2012, 11:55 AM   #9
yancek
Senior Member
 
Registered: Apr 2008
Distribution: PCLinux, Ubuntu, Slackware
Posts: 4,953

Rep: Reputation: 785Reputation: 785Reputation: 785Reputation: 785Reputation: 785Reputation: 785Reputation: 785
You could post the output of the bootinfoscript I suggested several days ago.
 
Old 12-04-2012, 05:21 AM   #10
dhruvats
LQ Newbie
 
Registered: Jun 2012
Location: Bangalore,India
Distribution: Linux Mint 13 XFCE,Windows XP
Posts: 29

Rep: Reputation: Disabled
GRUB2 menu entry in my system looks like this:
menuentry "Windows 7 (loader) (on /dev/sda2)" --class windows --class os {
insmod part_msdos
insmod ntfs
set root='(hd0,msdos2)'
search --no-floppy --fs-uuid --set=root 0EC08012C07FFDE9
chainloader +1
}
In your GRUB2 entry, "root" keyword is missing as well as "--class windows --class os". Not sure whether these will be really needed.

Also, you could run "os-prober" as administrator in Terminal followed by "update-grub" just to make sure that entries are correctly added.
Post the output of bootinfoscript downloaded from sourceforge.net. This script will generate a Result file in the directory on which it is run.
 
Old 12-04-2012, 05:34 AM   #11
descendant_command
Member
 
Registered: Mar 2012
Posts: 802

Rep: Reputation: 182Reputation: 182
Are you sure the problem is not the windows bootloader?

Can you boot it from another boot manager? (Super-grub-disk or others on ubcd or such).
 
Old 02-12-2014, 04:50 PM   #12
koka400
LQ Newbie
 
Registered: Feb 2014
Posts: 1

Rep: Reputation: Disabled
menuentry "Windows 7 (loader) (on /dev/sdb1)" {

insmod ntfs
set root=(hd1,1)
drivemap -s (hd0) ($root)
chainloader +1

}

Omit this entry: "search --no-floppy --fs-uuid --set=root 0EC08012C07FFDE9" it will load by specifying partition only

set root to your partition: set root=(hd1,1)
then swap drives !!!very important!!!: drivemap -s (hd0) (hd1,1) <-- please note this is your partition not just whole hd1 !!!
chainload +1 or you can use: ntldr/bootmgr

Last edited by koka400; 02-12-2014 at 04:57 PM.
 
Old 02-12-2014, 09:21 PM   #13
ReaperX7
Senior Member
 
Registered: Jul 2011
Distribution: LFS-SVN, FreeBSD 10.0
Posts: 3,382
Blog Entries: 15

Rep: Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936
If you're booting from two separate hard drives you technically don't need to manage them with Grub.

There is a hotkey that will allow boot device selection, usually ESC. Just install the bootloader as normal on your Linux drive and when you need to switch just tap ESC at boot and select your drive that way.

It's not what you might be wanting but it's an easy solution.

Last edited by ReaperX7; 02-12-2014 at 09:22 PM.
 
  


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
Set up Windows as boot option in Grub2 arubin Slackware 1 09-07-2012 07:21 AM
[SOLVED] Editing Default GRUB2 Boot Entry from Windows newmanium2001 Linux - Software 2 04-01-2012 11:25 AM
grub2 can not boot windows 7 jtrol Slackware 1 12-10-2010 04:50 AM
[SOLVED] Multi-boot grub2 destroyed on windows 7 reboot hhoyt Linux - Software 5 08-17-2010 03:01 PM
windows xp refuses to boot bitmap Linux - General 6 07-09-2004 07:28 AM


All times are GMT -5. The time now is 05:29 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration