This is a discussion on Dual boot Win XP / Linux, using grub within the Linux Operating System forums, part of the Unix Operating Systems category; --> Hi! I just installed Win XP on the first (primary) partition, which was working fine. Then I set up ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi! I just installed Win XP on the first (primary) partition, which was working fine. Then I set up Linux (Debian) on the second partition using a boot floppy, which was still ok. Then I decided to use grub as boot loader. Since I haven't had any experience with it, I must have done something wrong here: I used 'grub-install /dev/hda' to write grub into the MBR and set up the operating systems in /boot/grub/menu.lst as follows: --- title Linux root (hd0,1) kernel /vmlinuz root=/dev/hda2 title WinXP rootnoverify (hd0,0) makeactive chainloader +1 --- Now I can boot to Linux, but I can't start Windows XP any more (it simply restarts when selecting the WinXP item). I wonder where windows XP stores its boot loader. If it was in the MBR it is overwritten now. But where should I have installed grub instead? And how can I restore WinXP's boot loader (ntldr)? The problem is, that I can't boot from CD, so I'm not able to start the Recovery Console. Is there anyone who could tell what I should have done to get things working? If someone had a solution to my problem I'd be even more happy, of course. Stefan |
| |||
| On Tue, 21 Oct 2003 23:13:06 +0200, Stefan Söffing wrote: > Hi! > > I just installed Win XP on the first (primary) partition, which was > working fine. Then I set up Linux (Debian) on the second partition using > a boot floppy, which was still ok. > > Then I decided to use grub as boot loader. Since I haven't had any > experience with it, I must have done something wrong here: > > I used 'grub-install /dev/hda' to write grub into the MBR and set up the > operating systems in /boot/grub/menu.lst as follows: > > --- > title Linux > root (hd0,1) > kernel /vmlinuz root=/dev/hda2 > > title WinXP > rootnoverify (hd0,0) > makeactive > chainloader +1 > --- > > Now I can boot to Linux, but I can't start Windows XP any more (it > simply restarts when selecting the WinXP item). > > I wonder where windows XP stores its boot loader. If it was in the MBR > it is overwritten now. But where should I have installed grub instead? > > And how can I restore WinXP's boot loader (ntldr)? The problem is, that > I can't boot from CD, so I'm not able to start the Recovery Console. > > Is there anyone who could tell what I should have done to get things > working? If someone had a solution to my problem I'd be even more happy, > of course. > > Stefan > It should work- if there are no other errors. I think grub-install failed for some reason. I prefer setting up from within the "grub shell," as opposed to grub-install. From the interactive shell, you can see if there are any problems with the setup. $grub grub>root (hd0,1) grub>setup (hd0) grub>quit Watch for error messages after each command. Notice the command root (hd0,1) specifies where menu.lst and the rest of grub is located, not the root filesystem. --Douglas Mayne |
| |||
| Douglas Mayne wrote: > On Tue, 21 Oct 2003 23:13:06 +0200, Stefan Söffing wrote: > > >>Hi! >> >>I just installed Win XP on the first (primary) partition, which was >>working fine. Then I set up Linux (Debian) on the second partition using >>a boot floppy, which was still ok. >> >>Then I decided to use grub as boot loader. Since I haven't had any >>experience with it, I must have done something wrong here: >> >>I used 'grub-install /dev/hda' to write grub into the MBR and set up the >> operating systems in /boot/grub/menu.lst as follows: >> >>--- >>title Linux >> root (hd0,1) >> kernel /vmlinuz root=/dev/hda2 >> >>title WinXP >> rootnoverify (hd0,0) >> makeactive >> chainloader +1 >>--- >> >>Now I can boot to Linux, but I can't start Windows XP any more (it >>simply restarts when selecting the WinXP item). >> >>I wonder where windows XP stores its boot loader. If it was in the MBR >>it is overwritten now. But where should I have installed grub instead? >> >>And how can I restore WinXP's boot loader (ntldr)? The problem is, that >>I can't boot from CD, so I'm not able to start the Recovery Console. >> >>Is there anyone who could tell what I should have done to get things >>working? If someone had a solution to my problem I'd be even more happy, >>of course. >> >>Stefan >> > > It should work- if there are no other errors. I think grub-install failed > for some reason. > > I prefer setting up from within the "grub shell," as opposed to > grub-install. From the interactive shell, you can see if there are any > problems with the setup. > > $grub > grub>root (hd0,1) > grub>setup (hd0) > grub>quit > > Watch for error messages after each command. > > Notice the command root (hd0,1) specifies where menu.lst and the rest of > grub is located, not the root filesystem. > > --Douglas Mayne I did so, but everything seems to be ok - no error message. As I wrote above, booting to linux works fine - I just can't boot to windows. But can you tell me how this chainloader thing works? Where should be the ntldr for windows if there's already grub installed in the MBR? Stefan |
| |||
| On Wed, 22 Oct 2003 00:02:09 +0200, Stefan Söffing wrote: > Douglas Mayne wrote: >> On Tue, 21 Oct 2003 23:13:06 +0200, Stefan Söffing wrote: >> >> >>>Hi! >>> >>>I just installed Win XP on the first (primary) partition, which was >>>working fine. Then I set up Linux (Debian) on the second partition using >>>a boot floppy, which was still ok. >>> >>>Then I decided to use grub as boot loader. Since I haven't had any >>>experience with it, I must have done something wrong here: >>> >>>I used 'grub-install /dev/hda' to write grub into the MBR and set up the >>> operating systems in /boot/grub/menu.lst as follows: >>> >>>--- >>>title Linux >>> root (hd0,1) >>> kernel /vmlinuz root=/dev/hda2 >>> >>>title WinXP >>> rootnoverify (hd0,0) >>> makeactive >>> chainloader +1 >>>--- >>> >>>Now I can boot to Linux, but I can't start Windows XP any more (it >>>simply restarts when selecting the WinXP item). >>> >>>I wonder where windows XP stores its boot loader. If it was in the MBR >>>it is overwritten now. But where should I have installed grub instead? >>> >>>And how can I restore WinXP's boot loader (ntldr)? The problem is, that >>>I can't boot from CD, so I'm not able to start the Recovery Console. >>> >>>Is there anyone who could tell what I should have done to get things >>>working? If someone had a solution to my problem I'd be even more happy, >>>of course. >>> >>>Stefan >>> >> >> It should work- if there are no other errors. I think grub-install failed >> for some reason. >> >> I prefer setting up from within the "grub shell," as opposed to >> grub-install. From the interactive shell, you can see if there are any >> problems with the setup. >> >> $grub >> grub>root (hd0,1) >> grub>setup (hd0) >> grub>quit >> >> Watch for error messages after each command. >> >> Notice the command root (hd0,1) specifies where menu.lst and the rest of >> grub is located, not the root filesystem. >> >> --Douglas Mayne > > I did so, but everything seems to be ok - no error message. As I wrote > above, booting to linux works fine - I just can't boot to windows. > > But can you tell me how this chainloader thing works? Where should be > the ntldr for windows if there's already grub installed in the MBR? > > Stefan > AFAIK, three files are necessary to start NT and its derivatives: ntldr ntdetect.com boot.ini They should reside as files on the windows partition. ntldr and the MBR code are separate and serve different purposes. In my experience, grub's mbr code is the best choice for dual boot systems- which chainloads to the BPB code on the Windows partition: rootnoverify (hd0,0). I re-read your first post. Were you ever able to start your XP setup before installing Debian on this disk? --Douglas Mayne |
| |||
| On 2003-10-21, Stefan Söffing <soeffing@gmx.de> wrote: > Douglas Mayne wrote: >> On Tue, 21 Oct 2003 23:13:06 +0200, Stefan Söffing wrote: >> >> >>>Hi! >>> >>>I just installed Win XP on the first (primary) partition, which was >>>working fine. Then I set up Linux (Debian) on the second partition using >>>a boot floppy, which was still ok. >>> >>>Then I decided to use grub as boot loader. Since I haven't had any >>>experience with it, I must have done something wrong here: >>> >>>I used 'grub-install /dev/hda' to write grub into the MBR and set up the >>> operating systems in /boot/grub/menu.lst as follows: >>> >>>--- >>>title Linux >>> root (hd0,1) >>> kernel /vmlinuz root=/dev/hda2 >>> >>>title WinXP >>> rootnoverify (hd0,0) >>> makeactive >>> chainloader +1 >>>--- >>> >>>Now I can boot to Linux, but I can't start Windows XP any more (it >>>simply restarts when selecting the WinXP item). >>> >>>I wonder where windows XP stores its boot loader. If it was in the MBR >>>it is overwritten now. But where should I have installed grub instead? >>> >>>And how can I restore WinXP's boot loader (ntldr)? The problem is, that >>>I can't boot from CD, so I'm not able to start the Recovery Console. >>> >>>Is there anyone who could tell what I should have done to get things >>>working? If someone had a solution to my problem I'd be even more happy, >>>of course. >>> >>>Stefan >>> >> >> It should work- if there are no other errors. I think grub-install failed >> for some reason. >> >> I prefer setting up from within the "grub shell," as opposed to >> grub-install. From the interactive shell, you can see if there are any >> problems with the setup. >> >> $grub >> grub>root (hd0,1) >> grub>setup (hd0) >> grub>quit >> >> Watch for error messages after each command. >> >> Notice the command root (hd0,1) specifies where menu.lst and the rest of >> grub is located, not the root filesystem. >> >> --Douglas Mayne > > I did so, but everything seems to be ok - no error message. As I wrote > above, booting to linux works fine - I just can't boot to windows. > > But can you tell me how this chainloader thing works? Where should be > the ntldr for windows if there's already grub installed in the MBR? > > Stefan > If you can boot into linux fine and the trouble is with xp, then get into linux and do a fdisk to see if the xp partition is set as active. I think most linux installs, well at least SuSE, changes "active" partition to the linux boot partition. If the above is true, just "deactive" the linux partition and set the xp partition active with fdisk. The ntldr is still in the xp partition. Myself, I prefer to install grub in the linux boot partition and use nt to give me a selection to boot xp or linux. |
| |||
| On Tue, 21 Oct 2003 23:13:06 +0200, in article <3f95a17f$0$12506$9b622d9e@news.freenet.de>, Stefan Söffing wrote: > title WinXP > rootnoverify (hd0,0) > makeactive > chainloader +1 > > Now I can boot to Linux, but I can't start Windows XP any more (it > simply restarts when selecting the WinXP item). What restarts? GRUB? If it's GRUB, do you get an error message? I can boot Windows 2000 like this (with the 'makeactive' and 'chainloader' statements in the opposite order, but I seriously doubt this is relevant.) According to _Linux Administrator Handbook_ (Evi Nemeth, et al.), they have seen cases where GRUB wouldn't boot Windows and other situations where Windows' boot loader would boot GRUB. > I wonder where windows XP stores its boot loader. If it was in the MBR > it is overwritten now. XP wrote its primary bootstrap to the MBR. I think the file MS calls the "boot loader" is c:\ntldr, but there also are other files in c:\ used for booting. > And how can I restore WinXP's boot loader (ntldr)? In the old days, "fdisk /mbr" would do the trick. I read recently some other command was required for 2000/XP, but I don't seem to have saved the article. > Is there anyone who could tell what I should have done to get things > working? If someone had a solution to my problem I'd be even more happy, > of course. Based in the information you gave, that I snipped, it "should" have worked. If XP is important, there are several other boot methods. 1) save the GRUB boot sector to a floppy (before you overwrite it with XP's), give XP back its MBR, and use the XP boot loader to load GRUB. It's a simple process, if a bit tedious 2) try other boot managers. I've had very good luck with System Commander, but it isn't free. When I got GRUB to boot both Win2000 and Linux, I stopped using SC immediately. |
| |||
| On Wed, 22 Oct 2003 00:02:09 +0200, in article <3f95ace7$0$12898$9b622d9e@news.freenet.de>, Stefan Söffing wrote: > Douglas Mayne wrote: >> On Tue, 21 Oct 2003 23:13:06 +0200, Stefan Söffing wrote: >>>title WinXP >>> rootnoverify (hd0,0) >>> makeactive >>> chainloader +1 >>>[...] > > But can you tell me how this chainloader thing works? The combination of "rootnoverify (hd0,0)" and "chainloader +1" tells GRUB to read the first sector of (hd0,0) [a.k.a. /dev/hda1 and c:] into memory and then 'execute' it, just like the BIOS would. In theory, there's no reason why this shouldn't work, but as I mentioned in another article I just posted, I've read sometimes it just doesn't work. > Where should be > the ntldr for windows if there's already grub installed in the MBR? 'ntldr' is just another file in c:\, perhaps with the 'system' and 'hidden' bits set. It's special to the NT/2000/XP boot process but it's a file. (If you can boot Linux and mount the NTFS partition, you can find it in the XP root directory.) GRUB didn't mess with this file; it doesn't know how to deal with it either. That's part of what chainloading is all about. |
| |||
| On Wed, 22 Oct 2003 01:21:44 GMT, in article <slrnbpbmta.10d.paul@crane.li-po.edu>, a user wrote: > If you can boot into linux fine and the trouble is with xp, then get > into linux and do a fdisk [...] Also, check to make sure XP really is (hd0,0). > [...] to see if the xp partition is set as > active. I don't think Windows 2000 or XP "honor" the active flag. On my system, cfdisk says the "FS Type" of the (NTFS) Windows 2000 partition is "Hidden HPFS/NTFS". For Windows 2000, I used to use "unhide" and "makeactive" in GRUB but I took them out and Windows 2000 still booted. > I think most linux installs, well at least SuSE, changes > "active" partition to the linux boot partition. On my system /dev/hda1 (Windows 2000) and /dev/hda3 (Linux /boot) both are flagged "Boot". I don't think either Linux or Windows cares. > If the above is true, just "deactive" the linux partition and set the > xp partition active with fdisk. The ntldr is still in the xp partition. It's worth a try. > Myself, I prefer to install grub in the linux boot partition and use nt > to give me a selection to boot xp or linux. I like GRUB! When I used LILO, it was annoying to have to copy its updated boot sector to the WinNT partition after running /sbin/lilo. Fortunately, that's not a problem with GRUB. -- "[O]bviously Linux owes its heritage to Unix, but not its code. We would not, nor will not, make such a claim." -- Darl McBride. CEO, The SCO Group. August 2002. |
| |||
| Douglas Mayne wrote: > AFAIK, three files are necessary to start NT and its derivatives: > ntldr > ntdetect.com > boot.ini > > They should reside as files on the windows partition. ntldr and the MBR > code are separate and serve different purposes. In my experience, grub's > mbr code is the best choice for dual boot systems- which chainloads to > the BPB code on the Windows partition: rootnoverify (hd0,0). > > I re-read your first post. Were you ever able to start your XP setup > before installing Debian on this disk? Yes, I was. But I'm no longer sure, where the problem really is. As you wrote, all I should need to boot XP are those three files. So I got a boot floppy, containing these files and tried to boot. I finally got the Windows "boot loader" (where I could choose the partition to boot from - according to the settings in boot.ini), but all I got was a message telling me somehting about a disk error. Well, since I've got too much spare time, I'll try to reinstall WinXP now :-/ Stefan |
| ||||
| Jules Dubois wrote: >>But can you tell me how this chainloader thing works? > > > The combination of "rootnoverify (hd0,0)" and "chainloader +1" tells GRUB > to read the first sector of (hd0,0) [a.k.a. /dev/hda1 and c:] into memory > and then 'execute' it, just like the BIOS would. In theory, there's no > reason why this shouldn't work, but as I mentioned in another article I > just posted, I've read sometimes it just doesn't work. What should it find in this first sector? Is is this ntldr file or some piece of code that will the ntldr? How can I make sure that the first sector contains this special file (ntldr) and not something else? >>Where should be >>the ntldr for windows if there's already grub installed in the MBR? > > > 'ntldr' is just another file in c:\, perhaps with the 'system' and 'hidden' > bits set. It's special to the NT/2000/XP boot process but it's a file. > (If you can boot Linux and mount the NTFS partition, you can find it in the > XP root directory.) > > GRUB didn't mess with this file; it doesn't know how to deal with it > either. That's part of what chainloading is all about. |