LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   [B]Can't Boot Windows Xp in a dual-boot e[/B] (https://www.linuxquestions.org/questions/ubuntu-63/%5Bb%5Dcan%27t-boot-windows-xp-in-a-dual-boot-e%5B-b%5D-569898/)

512upload 07-16-2007 03:48 PM

[B]Can't Boot Windows Xp in a dual-boot e[/B]
 
I installed Windows XP Professional SP2 in my ~150GB harddrive.

Then, I installed Ubuntu 7.04 from a live CD creating a 1GB FAT32 partition for shared files. So, at this point I had hda1 (Windows XP), hda2 (1GB FAT32 partition) and hda3 (ext3 - Ubuntu 7.04), if I'm not mistaken. Both XP and Ubuntu 7.04 occupy about 75GB. Windows XP was drive 'C:'.

I uninstalled all 2.6.20-15 software from synaptic because I already had updated it to 2.6.20-16.

Now, when I try to boot Windows XP from grub dual-boot, I get this error message:

"NTLDR is missing
[...] restart"

Now, gparted says I have:

/dev/hda1 extended
/dev/hda5 [!] ntfs
/dev/hda2 ext3 /
/dev/hda3 fat32 /media/hda2.

When I tried to enter the Windows XP CD's recovery console, I found Windows to be in D:\Windows and not C:\Windows! Why is that!?

What can I do to be able to enter both Ubuntu and Windows XP?


P.S.: I also installed ntfs-3g meanwhile. Does that have anything to do with the problem? Thanks.

jthuber 07-16-2007 04:36 PM

Booting WinXP with Grub
 
I highly recommend getting familiar with GRUB documentation available at http://www.gnu.org/software/grub/

I use something similar to the following which was gleaned from http://www.justlinux.com/forum/showt...hreadid=143973

Boot into your Ubuntu and edit the grub boot menu. Usually this is found in /boot/grub/menu.lst though you may need to check your distro's help documentation.

FIRST MAKE A BACKUP OF ANY FILES YOU INTEND TO EDIT

Next, as root, edit the Windows section of your boot list

Code:

title          XP pro @ hda5
hide          (hd0,0)
hide          (hd0,1)
hide          (hd0,2)
hide          (hd0,3)
hide          (hd0,4)
unhide        (hd0,5)
root          (hd0,5)
makeactive
chainloader    +1



You may have to tinker with hide / unhide options to get it perfect. Also, study the setup and the comments from the GRUB boot menu linked above.

512upload 07-16-2007 04:48 PM

Quote:

Originally Posted by jthuber
I highly recommend getting familiar with GRUB documentation available at http://www.gnu.org/software/grub/

I use something similar to the following which was gleaned from http://www.justlinux.com/forum/showt...hreadid=143973

Boot into your Ubuntu and edit the grub boot menu. Usually this is found in /boot/grub/menu.lst though you may need to check your distro's help documentation.

FIRST MAKE A BACKUP OF ANY FILES YOU INTEND TO EDIT

Next, as root, edit the Windows section of your boot list

Code:

title          XP pro @ hda5
hide          (hd0,0)
hide          (hd0,1)
hide          (hd0,2)
hide          (hd0,3)
hide          (hd0,4)
unhide        (hd0,5)
root          (hd0,5)
makeactive
chainloader    +1



You may have to tinker with hide / unhide options to get it perfect. Also, study the setup and the comments from the GRUB boot menu linked above.

I haven't tried this yet, but what do you mean by "You may have to tinker with hide / unhide options to get it perfect."?

jthuber 07-16-2007 04:56 PM

Quote:

Originally Posted by 512upload
I haven't tried this yet, but what do you mean by "You may have to tinker with hide / unhide options to get it perfect."?

Well, assuming your gparted output is correct, you shouldn't have to do any tinkering. The problem I always have on a dual boot system like this is that Windows XP wants to be on the first partition of the first hard drive your BIOS sees. So what you are doing with those commands is hiding the other partitions from Windows while it boots so it thinks hda5 is actually hda1.

However, if gparted is not reporting the harddrives the same way your BIOS does, it is possible that your Windows partition may be somewhere else.

[EDIT]
Actually I see where I screwed up already!!!
I included too many partitions in that grub code. Use the following instead
Code:

title          XP pro @ hda5
hide          (hd0,0)
hide          (hd0,1)
hide          (hd0,2)
hide          (hd0,3)
unhide        (hd0,4)
root          (hd0,4)
makeactive
chainloader    +1


512upload 07-16-2007 05:08 PM

Quote:

Originally Posted by jthuber
Well, assuming your gparted output is correct, you shouldn't have to do any tinkering. The problem I always have on a dual boot system like this is that Windows XP wants to be on the first partition of the first hard drive your BIOS sees. So what you are doing with those commands is hiding the other partitions from Windows while it boots so it thinks hda5 is actually hda1.

However, if gparted is not reporting the harddrives the same way your BIOS does, it is possible that your Windows partition may be somewhere else.

I have a major problem now

after doing what u suggested me to, I now get error 22 when trying to open Win "things" at hda5
and error 17 when trying to open linux.
i am using the live cd to send this message

please help me!

jthuber 07-16-2007 05:16 PM

Well, grub error 22 is "no such partition" so hopefully you saw the updated post with the corrected grub menu list.

Code:

title          XP pro @ hda5
hide          (hd0,0)
hide          (hd0,1)
hide          (hd0,2)
hide          (hd0,3)
unhide        (hd0,4)
root          (hd0,4)
makeactive
chainloader    +1

As always, if all else fails, restore the backup you made
when I said,
Quote:

FIRST MAKE A BACKUP OF ANY FILES YOU INTEND TO EDIT

512upload 07-16-2007 05:19 PM

Quote:

Originally Posted by jthuber
Well, grub error 22 is "no such partition" so hopefully you saw the updated post with the corrected grub menu list.

Code:

title          XP pro @ hda5
hide          (hd0,0)
hide          (hd0,1)
hide          (hd0,2)
hide          (hd0,3)
unhide        (hd0,4)
root          (hd0,4)
makeactive
chainloader    +1

As always, if all else fails, restore the backup you made
when I said,

But where can I find the folder where menu.lst is /question/mark i can-t find it

AceofSpades19 07-16-2007 05:20 PM

its in /boot/grub

512upload 07-16-2007 05:38 PM

Quote:

Originally Posted by AceofSpades19
its in /boot/grub

well, I finally found it in media/disk/boot/grub

but there is one thing that has changed
the partition mananger from the live cd says that there is

hda1 filesystem unknown 75GB
hda2 ext3 /media/disk 73.04GB
hda3 fat32 /media/LINUXP (the name i gave to the 1gb shared partition) 1GB flags boot hidden

without changing to what you edited, the grub simply won-t start

please help me! i am getting stressed and almost in panic

i started crying and i-m desperate

/////////////////////

does the unknown in the previously NTFS mean that I lost the information in my windows xp partition!_ i am really desperate

should i follow the grub troubleshooting in the first post of>

http://ubuntuforums.org/archive/index.php/t-24113.html
_

oh my god that didn't work either! please help me!

jthuber 07-16-2007 06:14 PM

First things first, don't panic.

The beauty of grub and Linux is that none of your data is lost, it always possible to boot your system and correct the errors as long as you aren't formatting your drive.

Please post your grub menu.lst as found in media/disk/boot/grub from your live CD.

Also, include the full output from your partition manager.

512upload 07-16-2007 06:22 PM

Quote:

Originally Posted by jthuber
First things first, don't panic.

The beauty of grub and Linux is that none of your data is lost, it always possible to boot your system and correct the errors as long as you aren't formatting your drive.

Please post your grub menu.lst as found in media/disk/boot/grub from your live CD.

Also, include the full output from your partition manager.

IMPORTANT updated

http://img402.imageshack.us/img402/6...eenshotfo6.png

is where the gparted information is hosted

i need to reboot so I can have the disks mounted again and tell you the menu.lst

after that, I'll edit this post with that information

thank you for not abbandoning me

here it is

///

default 0

timeout 5

title Ubuntu, kernel 2.6.20-16-generic
root (hd0,1)
kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=bf45cb71-3b7c-49be-b6cb-9acee2536802 ro quiet splash
initrd /boot/initrd.img-2.6.20-16-generic
quiet
savedefault

title Ubuntu, kernel 2.6.20-16-generic (recovery mode)
root (hd0,1)
kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=bf45cb71-3b7c-49be-b6cb-9acee2536802 ro single
initrd /boot/initrd.img-2.6.20-16-generic

title Ubuntu, memtest86+
root (hd0,1)
kernel /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hda3

title XP pro @ hda5
hide (hd0,0)
hide (hd0,1)
hide (hd0,2)
hide (hd0,3)
unhide (hd0,4)
root (hd0,4)
makeactive
chainloader +1

///
coment of mine now

i omitted many comment lines from the beggining of the file menu.lst

512upload 07-16-2007 06:48 PM

Please, don-t abandon me now.

syg00 07-16-2007 06:58 PM

Mmmmm - first up, change all those "hide" into "unhide". Only needed for older Windoze systems (Win95 e.g.).
Then try to boot Windoze (it'll still fail). That should allow Ubuntu to boot after that.
Then go back and remove all those lines.

Seems you have been screwed by the Ubuntu installer - and I don't know of an easy way to un-screw things.

Can you just throw everything away and re-install both XP and Ubuntu ???.

512upload 07-16-2007 07:03 PM

Quote:

Originally Posted by syg00
Mmmmm - first up, change all those "hide" into "unhide". Only needed for older Windoze systems (Win95 e.g.).
Then try to boot Windoze (it'll still fail). That should allow Ubuntu to boot after that.
Then go back and remove all those lines.

Seems you have been screwed by the Ubuntu installer - and I don't know of an easy way to un-screw things.

Can you just throw everything away and re-install both XP and Ubuntu ???.

No, I can-t.

i have gigabytes of photos of decades and other important things in both Windows xp and ubuntu

i am waiting for a reply of the person who told me to write down what i have in menu.lst and in the partitioning menu

512upload 07-16-2007 07:20 PM

come on, jthuber
don-t abandon me now!

:cry:


All times are GMT -5. The time now is 08:14 PM.