LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 02-16-2007, 11:51 AM   #1
Scotteh
Member
 
Registered: May 2006
Distribution: Debian, Kubuntu Gutsy
Posts: 44

Rep: Reputation: 15
Booting into Winblows XP with GRUB


I know this is a common problem, but I've tried every solution that I've seen, and nothing works.

My hard drive setup:
/dev/hda1 = Debian
/dev/hda2 = Winblows XP

Relevent menu.lst lines:
title Debian GNU/Linux, kernel 2.6.18-4-486
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-4-486 root=/dev/hda1 ro
initrd /boot/initrd.img-2.6.18-4-486
savedefault

title Windows XP Professional (BOO!)
root (hd0,1)
chainloader +1

I previously had Windows XP installed on my computer, and I could boot into either OS fine, but I repartitioned to give Debian more space, and when a finally had a reason to use Windows (I find Palm Desktop much better than KPilot), I installed Windows and now I can't get GRUB to work. When I select Windows XP from the GRUB menu, It flashes some output and then goes right back to the menu.

Anyone feel like helping me tackle this problem?
 
Old 02-16-2007, 01:06 PM   #2
pljvaldez
Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Squeeze (x86)
Posts: 6,092

Rep: Reputation: 269Reputation: 269Reputation: 269
You can try changing "root" to "rootnoverify". Also, you might check your device map in the boot menu and fdisk -l to make sure they agree with your setup.
 
Old 02-16-2007, 01:11 PM   #3
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
Try add
Code:
makeactive
before the "chainloader +1" statement

Last edited by saikee; 02-16-2007 at 01:12 PM.
 
Old 02-17-2007, 09:39 AM   #4
Scotteh
Member
 
Registered: May 2006
Distribution: Debian, Kubuntu Gutsy
Posts: 44

Original Poster
Rep: Reputation: 15
I've tried having makeactive before chainloader before as well as having rootnoverify instead of root, but have had the same result.

Code:
~; sudo fdisk -l
   Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1        7295    58597056   83  Linux
/dev/hda2   *        7296        9666    19045057+   c  W95 FAT32 (LBA)
/dev/hda3            9667        9729      506016   82  Linux swap / Solaris
That's really weird. It's still saying my Windows partition is the booting partition...

Last edited by Scotteh; 02-17-2007 at 09:41 AM.
 
Old 02-17-2007, 10:40 AM   #5
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
Just a very basic question.

How do you convince us that your XP has been installed and work satisfactorily?

You said XP has been re-installed and you expect Grub to boot it. Had XP been installed properly we would expect NTLDR to nuke Grub away and take over the MBR by now. Have you re-installed Grub back to the MBR since?

If you omitted the above step then may be your XP wasn't in a working order any way. In such a case Grub just loads a faulty system that isn't bootable.
 
Old 02-18-2007, 09:38 AM   #6
Scotteh
Member
 
Registered: May 2006
Distribution: Debian, Kubuntu Gutsy
Posts: 44

Original Poster
Rep: Reputation: 15
Quote:
How do you convince us that your XP has been installed and work satisfactorily?
I get down on my knees and beg. lol

I installed Windows and installed my Palm software, then restored GRUB by using the Debian install disk. NTLDR did nuke GRUB, but I couldn't get GRUB to work with Windows after I had reinstalled GRUB.

Is there still a chance that Windows wasn't installed correctly? I would expect not, but I don't know that much about this kind of stuff.
 
Old 02-18-2007, 10:03 AM   #7
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
OK I accept you have tested the XP before restoring Grub.

Let's get into the meat of it then.

You have Debian Grub. At the boot screen instead of choosing a system to boot press the "c" key to drop into a Grub prompt. You then boot both systems manually.

For XP try commands
Code:
root (hd0,1)
chainloader +1
boot
for Debian use
Code:
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-4-486 root=/dev/hda1 ro
initrd /boot/initrd.img-2.6.18-4-486
boot
If you don't want to do typing the red bits can be replaced by the bule bit below
Code:
configfile /boot/grub/menu.lst
Pay attention to the Grub response if any system that doesn't boot and report back.

If Grub boots both system then then the Grub in MBR may be defective. You can restore Grub again by these two commands in a Grub prompt
Code:
root (hd0,0)
setup (hd0)
 
Old 02-19-2007, 09:24 AM   #8
Scotteh
Member
 
Registered: May 2006
Distribution: Debian, Kubuntu Gutsy
Posts: 44

Original Poster
Rep: Reputation: 15
Code:
grub> root (hd0,0)
Filesystem type is reiserfs, partition type 0x83

grub> kernel /boot/vmlinuz-2.6.18-4-486 root=/dev/hda1 ro
[Linux-bzimage, setup=0x1e00, size=0x127d63]

grub> initrd /boot/initrd.img-2.6.18-4-486
[Linux-initrd @ 0xfbc0000, 0x42b3e1 bytes]

grub> boot
Success. Now for Winblows...

Code:
grub> root (hd0,1)
Filesystem type is fat, partition type 0xc

grub> chainloader +1

grub> boot
GRUB Loading stage2...
And back to the GRUB menu...

Code:
grub> root (hd0,0)
Filesystem type is reiserfs, partition type 0x83

grub> setup (hd0)
That succeeded, but booting into Windows still didn't work. The same thing happened - it just went right back to the GRUB menu.

I'm concerned about my fdisk -l output.
Code:
~; sudo fdisk -l
   Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1        7295    58597056   83  Linux
/dev/hda2   *        7296        9666    19045057+   c  W95 FAT32 (LBA)
/dev/hda3            9667        9729      506016   82  Linux swap / Solaris
I don't like the asterisk under "Boot" for Windows. Any thoughts?
 
Old 02-19-2007, 09:49 AM   #9
dubz_444
Member
 
Registered: Mar 2006
Location: South Africa
Distribution: Arch Linux
Posts: 43

Rep: Reputation: 15
for 2 weeks i booted my windows like this due to shear laziness
Code:
root (hd0,1)
rootnoverify
makeactive
chainloader +1
boot
if you just dump this straight into /boot/grub/menu.1st it shall work


important!!

root (hd0,1). make sure this is the correct partition. hd0 - first hd. 1 being second partition on first hd

although from your post that should be correct
 
Old 02-19-2007, 12:33 PM   #10
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
The asterisk next to hda2 means it has been marked bootable. Since Debian doesn't use the bootable flag and you wouldn't touch it and so I didn't ask you to put in the statement
Code:
makeactive
as suggested by dubz 444.

The
Code:
rootnoverify
of dubz 444 also does little. Grub can save 1/100 second for no need to verify the XP partition but that is no concern of mind if it takes it another 1/100 second to verify it.

My conclusion on your current situation is that your XP may not be operational after the resizing exercise

I would drop a used floppy and save the Grub configuration in Debian terminal by command
Code:
sudo grub-install /dev/fd0
I shall then restore XP's MBR following the Task B1 or B2 in the last link of my signature, so that I can run XP and repair it. If I need Debian I use the floppy.

When both systems are back to normal I restore Grub back to the MBR by
Code:
sudo grub-install /dev/hd0
 
Old 02-19-2007, 05:25 PM   #11
Scotteh
Member
 
Registered: May 2006
Distribution: Debian, Kubuntu Gutsy
Posts: 44

Original Poster
Rep: Reputation: 15
I just read something from your "Just booting tips" post, and it got me thinking... Would making my Windows Fat32 partition "logical" vs. "primary" make a difference? If so, is there a way to change the Windows partition to being primary without affecting my Linux partition? Reformatting my Linux partition is not an option I will entertain.
 
Old 02-19-2007, 07:39 PM   #12
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
Your XP will not boot from a logical partition. XP can only be installed in a logical partition if you have another primary partition to house the NTLDR boot loader. In any case that is a re-installation you are talking about.

If you restore the XP's MBR then Linux is out of the way as far as XP is concerned and nobody can blame Linux if XP doesn't boot.

As with every resizing exercise you must check the health of the system after each step before leaping onto another one. Whenever a fat partition is involoved you should reboot otherwise you may be writing information wrongly because the Bios still working with the old hard disk setting.

The current information suggests when you boot XP Grub reported back it found partition type 0xc which is a fat32 and the only such partition is hda2. Therefore Grub has located it correctly but XP refuses to take control when it is given the driving seat by Grub.

My advice of restoring XP's MBR does not involve a re-installation but will get you back a 100% XP environment and so you will be able to see what error is being reported. At the moment you don't even know what is wrong with the XP partition.
 
Old 02-20-2007, 07:10 AM   #13
Scotteh
Member
 
Registered: May 2006
Distribution: Debian, Kubuntu Gutsy
Posts: 44

Original Poster
Rep: Reputation: 15
So you're recommending I reinstall Windows to see what it says about being a logical partition?

Is there any way to change Windows to a primary partition without affecting the data on my Linux partition?
 
Old 02-20-2007, 08:11 AM   #14
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
What make you think your XP is in a logical partition?

In Linux the first 4 partitions are reserved primaries. Since you do not have any partition higher than hda4 you haven't got any logical partition in your PC.

I do not recommend to reinstall XP.

I recommend to "restore" XP's MBR and that is the first 512 bytes of its boot loader.

MS has a common MBR. The role of this MBR is like a blind man searching the 4 primary partition. If it finds a primary partition has the booting flag in the "on" or "active" position (or marked bootable in Linux term) it loads that partition into the memory. That is why a standalone MS system must be installed in a primary partition.

If you have restore MS MBR the it is MS's own MBR booting XP. Grub is removed. The hard disk is under 100% MS system control. Hopefully you will see some error messages.

Restoring XP's MBR is a reversible operation.

Re-installing XP "may" not be reversible unless you know what you are doing.

Last edited by saikee; 02-20-2007 at 08:13 AM.
 
  


Reply

Tags
boot, grub, windows


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
Booting of raw ISO from GRUB/LILO (though preferably GRUB) Orkie Linux - Software 28 12-15-2013 10:37 PM
Booting my new ubuntu install = "GRUB GRUB GRUB GRUB GRUB" etc. dissolved soul Ubuntu 2 01-13-2007 01:55 PM
Now I've done it... GRUB overwritten by Winblows RAdams Ubuntu 2 10-02-2006 09:55 AM
how to edit grub.conf from grub shell during booting pashaikh Linux - Security 1 06-27-2006 06:01 AM
HELP!, I'm Using Winblows...... salmanal Suse/Novell 3 02-22-2006 03:52 PM


All times are GMT -5. The time now is 11:51 PM.

Main Menu
Advertisement
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