LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   The trouble with dual booting of Windows XP and Linux (https://www.linuxquestions.org/questions/linux-software-2/the-trouble-with-dual-booting-of-windows-xp-and-linux-132988/)

Programmer 01-09-2004 02:46 AM

The trouble with dual booting of Windows XP and Linux
 
:Pengy:


I DO have Windows XP Professional and Linux on the same hard drive. 1st partition is NTFS with bootable Windows, 2nd partition is NTFS. 3rd partition is Linux's swap. 4th partition is ReiserFS with Linux.

1st condition)
If I run fdisk /mbr in pure MS-DOS and SETUP "Large" for hard drive I can run Windows and ONLY Windows.

2nd condition)
If I boot from Linux CD and replacing MBR with GRUB or LILO AND change "Large" to LBA or CHS then I am able to boot Linux from GRUB or LILO menu. HOWEVER, I can NOT boot Windows with ANY conditions. Both boot managers GRUB and LILO tell on the screen about file system id error. And changing hdd(0,0) to hdd(0,1), or chainloader +1 to chainloader +0 in GRUB or LILO configurations are not helping me to be able to use GRUB or LILO for dual booting.


That is the problem. What I can do to solve it?


I'm in trouble with dual booting of XP and Linux now.
XP was installed on NTFS in HDD "Large" mode.
However, Linux's both GRUB and LILO can access partitions only in LBA and CHS modes.
When I am choosing Winodws from GRUB or LILO menu I am getting file system's ID error that 0x7 is wrong ID. However, it IS real ID for NTFS!
I need help.
I will be happy to hear any ideas from you about it.
Should I reinstall XP with LBA HDD mode? Will it help me actually?
Do you know a way how to boot Linux from XP's boot.ini file?



Thanks in advance.







Down below hard drive partitioning information:





Large mode works only for Windows
LBA or CHS works only for Linux.

Access Modes:
CHS, LBA, Large, Auto
Capacity:
40018mb
cylinder:
4865
Head:
255
Precomp:
0
Landing Zone:
19157
Sector:
63


Expert Partitioner:

Device Size Type Mount Start End

/dev/hda 37,2gb ST340016A 0 5168
/dev/hda1 16,0gb HPFS/NTFS /windows/C 0 2227
/dev/hda2 21,1gb Extended 2228 5167
/dev/hda5 16,0gb HPFS/NTFS /windows/D 2228 4455
/dev/hda6 1004,0mb Linux swap swap 4456 4591
/dev/hda7 4,1gb Linux native / 4592 5167




That is how
/dev/hda1 16,0gb HPFS/NTFS /windows/C 0 2227
represented in Windows XP:
multi(0)disk(0)rdisk(0)partition(1)
\WINDOWS="Microsoft Windows XP Professional" /fastdetect




My idea was to reinstall XP under NTFS with LBA turned ON, and then later rewrite GRUB or LILO into MBR and see what's gonna happen. So far, I couldn't find better solution for it. And I don't know if this XP trick gonna work or not.


:study:

Allen614 01-09-2004 03:12 AM

Have you looked into booting Linux through your ntldr? There are several threads on it. I've used it with both Slackware and Mandrake with no problems booting with XP Pro.

peter_robb 01-09-2004 07:13 AM

This my boot.ini

[boot loader]
timeout=3
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect
multi(0)disk(0)rdisk(0)partition(3)="Linux"

LILO is set to use dev/hda3 as the boot partition

alrolim 01-09-2004 09:17 AM

I have both WinXP home and RH9....
I just instaled WinXP first and RH9 after
What is your linux?
Red Hat? Debbian?
Older Grubs can saw WinXp cause of chain load...but newer versions can handle it very well...
See if your linux have the latest grub...if not get at gnu page...and make install
When i had an old linux ( Connectiva 5 ---now part of United Linux) i have to use boot disk to acess my linux...may be a choice..but temporaly until you get new Grub

Carson 01-09-2004 02:53 PM

fdisk /mbr is NOT supposed to be used with XP. It's a DOS command, and it kills your XP boot info, replacing it with a totally different boot that was ONLY meant for Windows 9x and earlier. There is a really big problem on the Internet with well-meaning folk who are not XP-savvy, advising others to "simply" use fdisk /mbr.

At worst, it can be a real disaster, and you can lose all your XP data for good. At best, it can be used for a MAXIMUM OF 4 PARTITIONS. Others will be lost forever.

Having said that, it's a pretty straightforward repair to make XP happy again. You need your NTLDR, your BOOT.INI, and your NTDETECT.COM in your equivalent to C:\ [main drive]. It's good if you can simply find them and copy them to that location, where they always belong for XP.

Whether you can do that or not, the usual repair is by booting from your XP CD. No, it will NOT re-install XP! Don't worry about that! Press the Yes for "Boot from CD?" and let it take a couple of minutes--it's a fair while--to load up a lot of files, after which it will give you 3 options, the middle one of which is for Recovery. Go for that.

I'm not sure which comes next, but at one point you need to know these answers:
-- your administrator password: you either know it, or you get 3 tries. If you don't recall ever setting one, press <enter>
-- which installation: It might suggest just one: (1) C:\WINDOWS, and the correct response is to type "1" (without ""). Or you may have a choice.

-- Enter load identifier: scary, huh? That's probably wanting you to type "Microsoft Windows XP Professional" or whatever it says in your boot.ini. (That can be seen, and probably you should look at it first, in Start > Settings > Control Panel > System > Advanced > Startup & Recovery > Settings > Edit. DON'T edit anything; just look at it and write it down, EXACTLY as you see it. And notice what "long" name it calls your XP by.

-- Oh, I forget what they ask next, it's another tech-term; but the response you type in, without the " but with the slash, is " /fastdetect"

Plus, although I may well have the sequence out, you will get just a simple DOS prompt somewhere along the line, and the response is to just type "fixboot" and press enter. It will give you a warning and you can feel nervous if you like, and then press Y for yes.

There are a few other things you can do in there, but take it one at a time, so you're changing the fewest things. "Fixmbr" is another you may have to use, fairly likely, but see what happens. The Recovery Console is weird but friendly. :-)

You may come out of all that to a black screen with just the ghastly message, "NTLDR is missing." That looks horrible, but don't be scared; you're likely one step away from success. That NTLDR (Windows NT Loader) is housed somewhere in your XP files. You need to run Search, if you can do that, or somehow get it back into your C:\ drive, as I said earlier. From now on, be sure to have a floppy with these half dozen necessities on it!

That's pretty partial; I don't know if I've given you everything you need. But try NEVER to use fdisk /mbr again. It's been called a "potential disaster," and Microsoft has a page on it, in which you're advised that you CAN use it, but it's risky business. It's not the end of the world, but it is a way of over-writing your XP system with unuseable DOS boot-up commands. And it's very commonly given as VERY MISDIRECTED ADVICE by a lot of people who are out of date about Windows.

(You'll also hear the Linux boot loaders are much better than Windows boot loader, but that is likewise 4 years out of date. XP's boot loader handles all sorts of OSs with ease. Plus, XP has an amazingly good partitioning system in Disk Management. You can delete or create partitions, go from NTFS back and forth to FAT32, to your heart's content!)

One last suggestion: Get the free BOOT-US Internet download, and INSTALL IT TO A FLOPPY DISK. (Don't change anything on your hard drive--well, I mean, don't unless you want to.) That will be the best emergency boot floppy you'll ever have, because it GOES AROUND the problem you have now, and gets you back into your OS! Then you have the luxury of taking years, if you want, to fix up your boot problems.

Good luck!

o0k|ey 01-09-2004 10:03 PM

carson,
excellent post

jbeedham 01-10-2004 01:48 AM

where do you get the BOOT-US disk. Maybe it can help my Mandrake - LILO boot problem? (see my other thread)

WhatsHisName 05-06-2004 10:08 AM

While searching for something else, this old post caught my attention because of some incorrect advice given by Carson. DOS “fdisk /mbr” and XP recovery console “fixmbr” do exactly the same thing. Here is a quote directly from the Microsoft Windows XP Professional Resource Kit Documentation: :study:

http://www.microsoft.com/resources/d...d_tro_oxhc.asp

“The Recovery Console, a troubleshooting tool in Windows XP Professional, offers a feature called Fixmbr. However, it functions identically to the Fdisk /mbr command, replacing only the master boot code and not affecting the partition table.”

The warning microsoft gives about restoring the MBR applies to boot sector virus infections, drive overlay programs (e.g., SpeedStor) and dual boot programs. The virus issue speaks for itself and you would probably already know if you were using a drive overlay, which is unlikely in XP. The third warning covers exactly why “fixmbr and “fdisk /mbr” are used in this forum: to restore windows functionality after a lilo or grub failure. I have personally used dos fdisk /mbr dozens of times on dual boot XP/linux systems without a problem.

Are there situations where you should not use fdisk /mbr? Yes, but they apply equally to XP fixmbr. Any potential damage done by dos fdisk /mbr would also be done by fixmbr.

haymaker 06-13-2004 07:49 AM

dual boot windows XP/NT/... and linux
 
The easiest way to do this is just to install lilo into the boot partition of ur linux, e.g. /dev/hda2 (or /dev/hda5), not change the MBR, i.e. /dev/hda!

Then you just create a copy of that bootsector with the command:

dd if=/dev/hda2 of=/mnt/win/c/boot.lin count=1 bs=512

"if=" here refers to "input file", "of=" to output file...
(provided that you have C:\ mounted as /mnt/win/c)
and adding a line to your boot.ini (on C:):

C:\boot.lin="Your Linux distro name or whatever you want to call it"

Took me a while at first to find that out but it is generally pretty straight forward.
cheers

r_jensen11 06-13-2004 10:39 AM

Man, I'm lucky I have my setup:

If you have a LOT of devices, like me, in your computer, here's my setup:

/dev/hda XP
/dev/hdb XP
/dev/hdc DVD
/dev/hdd CDR
/dev/hde Linux

Fortunately, my BIOS lets me boot off of the MBR of either hda or hde, since I have a PCI card giving me more IDE channels. I just leave hda alone, that way if I screw up the boot loader, I can still boot into XP, download a boot disk, install the boot disk, and boot back into Linux. However, there was one time where LILO wanted to do its own automatic install, and installed over my hda's MBR, and that screwed up XP's booting. It took me a while to figure out that I shouldn't have had my Linux partition flagged as bootable (For some reason, when I switched it off, XP could boot again, I forget the errors, but I do have to thank Partition Magic and fdisk for fixing that.) But after doing fdisk /mbr from XP's recovery, I was back to normal. I have Lilo's first option be XP and then when it gets to XP, I have the good old menu of XP or recovery mode....


All times are GMT -5. The time now is 07:30 PM.