Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hmm, XP does not normally run from a logical partition - it needs a primary one. There is a bootloader that apparently erases the distinction between primary and logical so that windows could boot from anywhere but I forget its name. I thought it was Ranish.
Anyways, just try this:
title Windows XP
map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd1,6)
chainloader +1
This assumes that you also have a hda and that GRUB is sitting on the MBR of that hda.
If that doesn't cut it, you know that you do need something more versatile than GRUB.
OK I'm quite fed up....I will be installing a fresh copy of XP on a PRIMARY partition in hdb I hope that will solve the problem right? One more question: When is mapping done? What is it used for and in which cases??
When I re-install XP on a primary partition on hdb, do I have to do mapping? Btw someone on another forum told me dat bcoz I've XP on hdb5, I should have hd1,4 and NOT hd1,6 in my grub file...is that right?? But I tried that too and it didn't work..
When I re-install XP on a primary partition on hdb, do I have to do mapping? Btw someone on another forum told me dat bcoz I've XP on hdb5, I should have hd1,4 and NOT hd1,6 in my grub file...is that right?? But I tried that too and it didn't work..
Now let's see. GRUB starts counting from 0 so:
hdb1=0
hdb2=1
hdb3=2
hdb4=3
hdb5=4
and so on
In short, yes, hdb5 should be (hd1,4). Bad mistake, what was I thinking, mixing up -1 with +1...
Anyway, if even hd1,4 didn't cut it, then obviously you are facing the limitations of XP, which requires a primary partition. Did it ever run from there or did your put it there only recently?
Anyway, a second limitation of XP is that it wants to sit on the first disk (which disk is first depends on how the hard drives are ordered in your BIOS). By using mapping, you fool XP into thinking that it is really on the first disk while it is actually somewhere else. So:
map (hd0) (hd1)
map (hd1) (hd0)
is simply a way or temporarily rearranging disk order without touching anything. Your first drive (hd0) becomes second (hd1) and the second (hd1) is promoted to first (hd0). Now XP is happy because it gets the impression that it is really on the first disk.
Of course, no mapping is required as long as XP is actually on the first disk. Assuming that your are booting off hda (the drive to which you installed GRUB), you don't need any mapping if you install XP to that hda. Then it would be enough to use a simple:
root (hd0,X)
makeactive
chainloader +1
An alternative approach would be to go into BIOS and invert disk order, making hdb the boot disk instead of hda. But this would only create other problems: if your GRUB is on hda, you wouldn't be able to access it anymore and you would have XP booting all the time instead (GRUB also needs to be on the first disk - but inverting the disk order moves it to second); and if you have another windows on hda, then that one will now be on the second disk - so here again you would have to apply mapping.
Wow....that was quite helpful! So well-written and so beautifully explained! I understood everything
One last question: I've seen that in examples of mapping, theres something like "chainloader +1(hd0,1)" or something. What does this mean and why is it added?
And what does "rootnoverify" and "makeactive" stand for and why are they needed??
Hmm, let's see whether I can still talk sense when explaining those.
First of all, the chainloader. GRUB is an open source invention and as such knows how to boot open source operating systems directly (Linux, FreeBSD, OpenBSD, ...): GRUB passes control straight to the operating system. But windows is not exactly an open source system so GRUB can't boot it in a direct way; as a workaround, it first loads an intermediate file, which in its turn will boot windows. So we get some sort of a chain here: first GRUB, then the file, then windows = chainloading.
Rootnoverify is similar. GRUB tries to mount the root partition in order to retrieve some information that may be vital to booting; but because windows is a radically different system, GRUB can't make any sense of its root partition; by specifying "rootnoverify", you tell GRUB to just leave it alone and not mount it.
Makeactive: make the windows partition the active one. If you do this from a terminal:
su -
root password
fdisk -l
it will show all the partitions on your hard drives; the ones with a * are active partitions = partitions from which a system can boot; most Linux partitions do not care about active partitions but something like Debian does need one in order to boot. I have also noticed that the makeactive line is not needed when windows is mapped - I guess the mapping process does something which makes it superfluous but I'm still figuring that one out, really.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.