how to add windows to grub

hey, I have windows xp and suse dual booted
or at least I did, the file system of suse developed a fault, and I had to run the repair scanner on the suse dvd.
out of many things it found wrong it claimed something was wrong with my boot loader, so when I let it get on with it, suddenly suse and failsafe suse was the only 2 listed, windows was gone, so I tried to manually add windows back.
I went to /mnt/windows/C/boot.ini

but this would appear to not be the write file as it’s not working. so yes? anyone know where the right file is? what the right procedure is?

You do this to get windows as an entry in Grub’s bootloader:

…go to Yast –> System –> Boot Loader. The Grub configuration screen comes up with the Tab “Section Management” activated. In the lower right is a drop-down selector labelled “Other”. Select from “Other” the option “Propose New Configuration” and then wait for Grub to analyse your partitions and display a new configuration. This may take a while. Important: When that finishes, activate the tab labelled “Boot Loader Installation” and select to “Boot from the Master Boot Record”. [Yast will often default to booting from the root or boot partition rather than from the MBR but that’s for experts only – always choose the MBR.] Then click Finish to save the changes and install the reconfigured Grub into the hard drive’s MBR. If you get a message that "The bootloader boot sector will be written to a floppy disk … don’t bother with the floppy – just click OK to proceed and install to the MBR. Reboot and you should see windows in Grub’s menu listing.

Sometimes the windows entry in Grub stalls. That’s one small extra tweak to eliminate a bug in Yast’s bootloader configurator, but wait and see if it works first. If it doesn’t then copy back here the results of this console command and I’ll tell you what to do for the tweak:

 sudo cat /boot/grub/menu.lst

The quote is from here: GRUB Boot Multiboot openSUSE Windows (2000, XP, Vista) using the Grub bootloader.

thank you swerdna, that worked perfectly.
if anyone comes after me reading this thread they should know that I think the directory I pasted in was from the windows wine directory, not the dual boot windows, very stupid mistake I know

:wink: glad it worked

hello swerdna,
i have 2 questions:

  • ¿what is the extra trick for grub?
  • ¿how do i back up the current mbr before suse installs grub on it? (i mean: before finishing the suse installation process [before pressing the install button prior to format/copy files] or from XP before i attempt to install from dvd)

For some odd reason, grub keeps erasing the XP entry point although it appears as normal in menu.lst & grub.conf

Then, when i select suse, it loads the OS correctly. When i select XP, it tries to enter but it goes back to grub’s OS selection screen.

to regain access, i had to fdisk/mbr, reformat & reinstall XP after trying to configure grub to load both OS’s without success for several days. that’s why i’d like to back up this new mbr before i dare to install grub again.

what is going on with grub?
this system worked perfectly with previous lilo. Now with the new lilo, it just doesn’t work because the current lilo version is not supported anymore.

thanks for sharing your tips & knowledge on the topic.
<OF>

¿what is the extra trick for grub?
This is where Yast’s bootloader module writes the wrong code into menu.lst for the windows partition. It relates only to vista (IIRC). See the sticky here:
Fixing vista multiboot with openSUSE - openSUSE Forums
Probably not relevant because you have xp.

For some odd reason, grub keeps erasing the XP entry point although it appears as normal in menu.lst & grub.conf

There is/was a bug in 11.1 for Grub. I didn’t pay much attention so I don’t know what it was/is. But I recommend you get all the updates using Yast Online Update to make the bug maybe go away. The applet in the taskbar/panel/systray (whatever) on the desktop doesn’t get all the updates – use Y.O.U.

But that bug may not even relate to what’s happening here. So can you post your file menu.lst and your partitioning as diplayed by

sudo /sbin/fdisk -l

¿how do i back up the current mbr before suse installs grub on it?
Booting of windows XP in classical xp fashion (whereby you lose booting to openSUSE) can be re-installed by doing two things:
1: Make sure the windows partition that contains the bootloader files (usually sda1) is the active partition. You can check and manipulate that with this command in a console:

sudo /sbin/cfdisk

2: restore the generic win boot code to the MBR. Here’s three ways to do that:
[LIST=a]
[li]In Yast’s bootloader module, click the “Other” button lower right and select to Restore the MBR of the hard disk.
[/li][li]Boot from the xp installation disk and proceed to the final screen where you have the option to Repair Your Computer. Press “R” for Repair and log onto the Windows installation. When the command prompt appears, enter the command fixmbr. Confirm “yes” and you will receive confirmation of the reinstallation of Windows bootstrap code into the MBR.
[/li][li]Save the MBR code using this Linux root console command, maybe from a Live Linux CD like Knoppix or SystemRescueCd or openSUSE Live:[/li]```
dd if=/dev/sda of=/path_to/mbr.bak count=1 bs=512

and later you can restore it with this root console command:

dd if=/path_to/mbr.bak of=/dev/sda


[/LIST]

Hello. I am having a similar problem. I had Suse11.1 installed, installed WindowsXP in to a separate partition, and when I rebooted the system, I got disk errors. I figured out it was the boot information, and finally got Suse back up and running with GRUB, and followed your instructions.

Everytime I choose Windows, now, it gives me the following:

rootnoverify (hd0,3)
chainloader +1

Disk error
Press any key to restart
DISK BOOT FAILURE, INSERT SYSTEM DISK AND PRESS ENTER

Any suggestions on what the issue is? I have not have one issue with hardware since I got the computer. Now, after installing windows, everything goes nuts.

(hd0,3) looks like the first logical partition in the extended partition. I think that you can’t install windows there. To confirm the problem, can you post here the return you get from these two commands in a console window:

  • sudo /sbin/fdisk -l
  • sudo cat /boot/grub/menu.lst

…go to Yast –> System –> Boot Loader. The Grub configuration screen comes up with the Tab “Section Management” activated. In the lower right is a drop-down selector labelled “Other”. Select from “Other” the option “Propose New Configuration” and then wait for Grub to analyse your partitions and display a new configuration. This may take a while. Important: When that finishes, activate the tab labelled “Boot Loader Installation” and select to “Boot from the Master Boot Record”. [Yast will often default to booting from the root or boot partition rather than from the MBR but that’s for experts only – always choose the MBR.] Then click Finish to save the changes and install the reconfigured Grub into the hard drive’s MBR. If you get a message that "The bootloader boot sector will be written to a floppy disk … don’t bother with the floppy – just click OK to proceed and install to the MBR. Reboot and you should see windows in Grub’s menu listing.
Thanks swerdna,

Worked perfectly for me. Saved my butt big time!:slight_smile:

Great – :wink: