I had to install the GRUB boot loader to my MBS when I installed Debian 'etch'. This was because the Debian installer couldn't figure out that there was another operating system on the HDD. Now, however, I cannot boot my windows system.

I know that GRUB can be modified so it can boot Windows, even if it couldn't be found the first time. How would I go about doing this?

I have a compaq presario r3000, amd64, and I have 4 parts on my hdd:
C:\ - windows system drive - NTFS
D:\ - 20 GB disk for optional windows components and personal docs - NTFS
E:\ - 2 GB Swap Data for Debian
F:\ - root drive for Debian - Ext3 file system


any help is much appreciated, as always ^_^

can you post your grub.conf?
you should have something like this:

title=Windows XP
rootnoverify (hd0,1)
makeactive
chainloader +1

Well, this part I left alone:

title    Debian GNU/Linux, kernel 2.6.16-2-amd64-k8
root    (hd0,0)
kernel    /boot/vmlinuz-2.6.16-2-amd64-k8 root =/dev/
hda1 ro
initrd   /boot/initrd.img-2.6.16-2-amd64-k8
savedefault
boot

And this part I took out the single user mode (I don't use it) and replaced it with this:

title    Windows XP Home SP2
rootnoverify     (hd0,1)
makeactive
chainloader    +1

Will this work?

>Will this work?
Try it. :cheesy: (It should)

Well, this part I left alone:
Will this work?

The windows part will work but debian wont, i dont think. You didnt specify the partition for grub to use as the real root, i use sda3 so thats what I put (yours is probibly different). Also I leave out the root (hd0,0) part and just use it directly in the kernel line. Alsa you should be defining ro in /etc/fstab and not grub, IMHO, just makes things easier down the line if you need to mount the partition when you rebuild your kernel.

This is an example of what I would do, obviously change your video card settings accordingly. I also compile in framebuffer support into my kernels as well as terminal fonts, eyecandy is good =].

timeout 10
default 0 

title    Debian GNU/Linux, kernel 2.6.16-2-amd64-k8
kernel    (hd0,0)/vmlinuz-2.6.16-2-amd64-k8 root =/dev/sda3 video=vesafb:yrap,pimipal,1024x768-16@75
initrd  (hd0,0)/initrd.img-2.6.16-2-amd64-k8

title    Windows XP Home SP2
rootnoverify     (hd0,1)
makeactive
chainloader    +1

Well... Debian still works, but Windows will not. It doesn't matter what I numbers I put in (hd0,0) it still won't work. If I change the first number (which my professor told me was the partition number) it tells me that HDD doesn't exist, and if I change the second number it just cannot do it. I haven't gone through up to 5,6,7 on either, and I don't think I changed the first number more than 0,1,2.

Do I need to switch to LILO? Do I need to install something so GRUB can handle NTFS file systems? I don't know! I'm completely lost.

Gparted told me that the disk I want is a partition of a bigger partition(wtf?), and this was my distribution. (if it helps):

/dev/hda2/:
/dev/hda7/: Linux-Swap
/dev/hda5/: (Windows System Partition)
/dev/hda6/: (Windows Extraneous Files)
/dev/hda1/: Debian system root partition

PS and my GRUB doesn't use a grub.conf, it uses a menu.lst (I know, it's odd)

Gparted told me that the disk I want is a partition of a bigger partition

I think it was referring to Logical and Extended Partition(s).

/dev/hda2/:
/dev/hda7/: Linux-Swap
/dev/hda5/: (Windows System Partition)
/dev/hda6/: (Windows Extraneous Files)
/dev/hda1/: Debian system root partition

Well, since your Windows partition is at /dev/hda5, I would suggest setting the line in menu.lst to (hd4,0) or (hd5,0) , and see what happens.

Personally, I think LILO is easier to setup, so that's what I use. GRUB is more popular because it has more features and most people don't have to set it up, anyway. But since GRUB is almost properly configured, it's worth trying to get it to boot Windows.

@joe: shouldnt it be (hd0,4) if iwinblows is on the first disk, fifth partition?

@joe: shouldnt it be (hd0,4) if iwinblows is on the first disk, fifth partition?

Whoops, I was mixed up! It should be (hd0, 4) if you want to refer to the first disk, fifth partition.

ok. Well, I don't know what to say. I have tried to boot using every combination of the first ten digits in both sides of the comma. I never get a boot. What can ya do, huh? Seems like it just doesn't want to work. Do I have to specify the root=/........ next to anything? or should it be working? I just don't get it anymore...

can you post the latest version of your conf? Did you run a grub-install? or install the MBR from the grub command prompt?

Okay, I did some snooping around the interweb, and I found out that if you want this to work, you can't have GRUB on the Master Boot Record. because I have tried evrything. And that somehow makes sense.

What do you think? Should I get rid of GRUB and try LILO? Or should I give up all the work I've done so far to reinstall windows and Debian?

I think you CAN have grub on the MBR since thats how i fired up this machine ;-)

You can use LILO or GRUB if you want, just pick something and see it through. If you want to use GRUB then post your grub.conf again so we can see what you are working with.

The important part (windows part) is here:

title = Windows
root (hd0,4)
#rootnoverify did the same thing
makeactive
#that seems to be the problem
chainloader (hd0,4) +1
# I decided to try this, I found it somewhere online

okay, I feel it necessary to say that I have GRUB 0.9.2 installed on my MBR. I think that might help. Are there more recent versions?

Windows was there first right? Are you positive that /dev/hda5 is windows? can you run this, as root, and post the results:

fdisk -l /dev/hda
/dev/hda1  start - 3453  end - 4864  blocks - 11341890  ID - 83 System - Linux
/dev/hda2  start - 1  end - 3452  blocks - 27728158+  ID - f System - W95 ext'd (LBA)
/dev/hda5  start - 511  end - 1020  blocks - 4096543+  ID - 7 System - HPFS/NTFS
/dev/hda6  start - 1021  end - 3452  blocks - 19535008+  ID - 7 System - HPFS/NTFS
/dev/hda7  start - 1  end - 510  blocks - 4096480+  ID - 82 System - Linux Swap / Solaris

partition table entries are not in disk order

AH! I remember, now! I put the Linux Swap in the first partition space! I took it out of the old Win-64 partition. Could that be why Linux is insisting that it is HDA1? I was told that windows HAS to be in the first partition, but I know otherwise. I had this Windows system booting just fine when I had another windows partition before it.

In case you didn't have this figured out:
My windows partition is not in the first slot. I had more partitions before it when I was dual-booting Windows XP x64 and Windows XP home. I stuck with home, and ended up having to reinstall it. That is when I changed the partitions around a bit. But you can get the idea from the output above.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.