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.
When I installed Ubuntu it, Ubuntu, was on disk zero and Win XP on disk 1, according to the Windows drive manager. I think that Ubuntu is supposed to be on the first HD in a multiple HD system. Ubuntu set up the grub to load windows with this item in grub:
When this didn't work I tried changing the drive designations around to no avail. My question is what does this syntax tell the system to do and how can I fix it to see and load my WinXP if I choose that option from Grub? My first impression on seeing this "wording" is that it is counterintuitive to map one drive to another and then reverse that.....in the very next line. So, I don't understand,,,,
Also, I set the boot order so that the drive with the Ubuntu install is the first device.
Ugh, these disk ordering issues are always a pain. I deal with this on servers a lot because various distro installers can never seem to get this right. You will probably need to go into your computer's BIOS and rearrange the BIOS drive order so that it matches up with what you expect it to be based on the IDE/SATA channel ordering. Then, get into Linux into Linux and install the GRUB MBR section onto your first hard drive (grub-install /dev/sda or grub-install /dev/hda). regardless of whether or not that is your Linux drive. Before running grub-install, make sure the GRUB root is set correctly (to (hd0,0) if your windows partitiom is the first partition of your first drive, (hd1,0) if it's the first partition of the 2nd drive, etc.). Note that the root willbe different for your Linux install. Then you should be able to get rid of the drive remapping altogether.
Basically, the root command tells GRUB what partition it needs to look for files on. The map commands try to switch hd0 and hd2. The chainloader command just tells GRUB to execute the code on that partition's boot sector (i.e. the Windows bootloader). A Linux entry looks a little different since for Linux GRUB actually loads the kernel and initrd directly without going through an intermediate.
Since you have hd0 and hd2, is it possible you have drives on two different IDE channels or and IDE and a SATA drive? I haven't played with IDE in awhile and I'm a bit rusty as to how GRUB handles that. Most of the time I've seen these problem, there's a disconnect between the BIOS drive mapping and how GRUB thinksd the drives are arranged.
Edit to add: make sure you have rescue CDs for both Windows and Linux before you go messing around with this. They will save your bacon if you mess up and overwrite a bootloader.
Since you say you only have two disks, leave everything including the bios settings the way they were originally. Grub counts from zero, meaning the first drive is (hd0), the second should be (hd1).
Try editing /boot/grub/menu.lst to look like this:
Code:
title Windows
root (hd1,0)
Safedefault
Makeactive
Map (hd0) (hd1)
Map (hd1) (hd0)
Chainloader +1
What you posted in the first post suggests grub should look at the third drive to boot Windows, of course, this won't work if Windows is on the second drive.
Quote:
I think that Ubuntu is supposed to be on the first HD in a multiple HD system.
Nope, you can install any os on any drive, normally Windows expects to be in a primary partition on the first drive, which is why you have to use the mapping to fool Windows into thinking it's on the first drive.
You can also switch the order in the bios so the Windows drive is the first boot drive, then you would have to boot into a live Ubuntu session with the Ubuntu CD to reinstall grub, the map commands would be eliminated in this case.
Thanks btmiller.
All drives are SATA and I did note the drive ordering according to SATA differs considerably from the bios ordering. SATA drive 5 was BIOS drive 0, or some such. So when you say arrange order in the BIOS you mean the boot order I suppose. I already, before posting my question, redid some SATA wiring so that my Linux drive is 0 and my windows drive is 1. I thought that would be part of the fix. It just seems to me that all I need to do is edit the GRUB script that I included in my question. Here is what my boot.ini says, by the way:
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(2)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(2)partition(1)\WINDOWS="Microsoft " /fastdetect
multi(0)disk(0)rdisk(1)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect /noexecute=optin /usepmtimer
I select the item that says "windows", not Windows XP Pro. Windows XP pro, if I select it, gives me the same error my original GRUB config displays if I select windows from there...and this is another clue I suppose, the Grub seems to maybe simply be pointing to the wrong option of the two in boot.ini.
And thank you too Junior Hacker.
When I saw this I thought, oh boy! the answer at last...but it doesn't work. I got a screen that said startingup, with a blinking cursor.
Hard to see why (hd1,0) won't work. As I said windows disk manager indicates Windows XP install is on drive 1 and Ubuntu shows to be on 0.
So, Junior Hacker, another point. You say to reset the Windows drive to boot first then boot into a Ubuntu live CD and reinstall GRUB.
How do I do this from a live CD? Seems to me that I recall trying to find a recovery function on the Ubuntu CD, but it wasn't there. If it was there how would it be accessed? Couldn't GRUB be reinstalled from within my current Ubuntu install, and if so, how?
Larry Webb,
I am new at this so I didn't realise the fdisk command had to be preceded by sudo. New results:
john@nunya:~$ sudo fdisk -l
[sudo] password for john:
Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x011b011c
Device Boot Start End Blocks Id System
/dev/sda1 * 1 29172 234324058+ 83 Linux
/dev/sda2 29173 30401 9871942+ 5 Extended
/dev/sda5 29173 30401 9871911 82 Linux swap / Solaris
Disk /dev/sdb: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x011b011b
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 30400 244187968+ 7 HPFS/NTFS
Disk /dev/sdc: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00e800e8
Device Boot Start End Blocks Id System
/dev/sdc1 * 1 30400 244187968+ 7 HPFS/NTFS
Disk /dev/sdd: 1058 MB, 1058275328 bytes
2 heads, 63 sectors/track, 16404 cylinders
Units = cylinders of 126 * 512 = 64512 bytes
Disk identifier: 0x00117675
Device Boot Start End Blocks Id System
/dev/sdd1 * 1 16405 1033456 6 FAT16
john@nunya:~$
Quote:============
”When I installed Ubuntu it, Ubuntu, was on disk zero and Win XP on disk 1, according to the Windows drive manager. I think that Ubuntu is supposed to be on the first HD in a multiple HD system. Ubuntu set up the grub to load windows with this item in grub:
How many hard disks does your given system have? Three?
If your Ubuntu "was" on (hd0,x) and your Win XP on disk 1 then the two systems are installed in separate hard disks. Whereof, you don't need to configure a chainloader since you can make your choice at the bios sponsored boot menu pressing F11 or F12 or F9. The NTLOADER hardisk(1) should simply equate to grub's (hd1,x), and changing the root line should also need change the Map lines. {Again, why need take the trouble of mapping two hard disks if choice can be made at boot menu after the bios POSTest? Still you have to do a click at choosing through the chainload, just the same amount of calories you spend in making the choice, right? }
Quote: ===========
"My question is what does this syntax tell the system to do and how can I fix it to see and load my WinXP if I choose that option from Grub?"
==================
Here in Linux we need to learn the good lesson and unlearn the poor lessons we had from Windows. I was a poor windows user for ten years: there we learn simple baby tricks and think ourselves as gurus without even knowing what is happening inside the concealed exe, com, dll files. Here in Linux you can change even the kernel source and compile it if you really have the blood. There is a good tutorial on Grub, webpage or downloadable, use google.
Quote:==============
" My first impression on seeing this "wording" is that it is counterintuitive to map one drive to another and then reverse that.....in the very next line. So, I don't understand,,,,"
====================
No it is not counter-intuitive. It is just a practical syntax. Reversing it is necessary to complete the trick at the system; in Algebra: b=a or a=b and that is a spell of complete similitude. Under microsoft windows I bet you are not given the control or power to map drives and play with it pointing from one to another; that lame duck cannot even boot from logical partitions (pardon my language but there is just no other way of bringing you the message that talking about boot loaders grub offers you the best.)
Quote:=
"Both OS's will boot, but Grub is FUBAR!!!!!!!!!!"
=======
No Grub is not FUBAR. I'll show you what fubar is in booting OS. This is a real fubar:
That's a real FUBAR!!! and a fubar it shall be forever until the day you can teach me how to chainload a linux or unix from that fubar line.
Again pardon me. But let me remind you that this forum is meant to help one another and NOT to proclaim a verdict that grub is fubar just because one is lazy to learn from tutorials. Read the forum rules first then in your terminal, be a root, unmount all pretensions.
Syntax is ---
# umount -a -t pride -o learn /good/manners
Hope this helps.
malekii mustaqiim
"I am a well educated arab: extremely proud and I have less respect to hypocrites. I fear no one and I have destroyed many."
You are right, and I HAVE been using bios boot menu (f11 on startup gives quick access). I am pursuing the grub issue because it is a more "elegant" way of performing the task and because I want to learn how this stuff works.
I DO want to learn this....that's why I am here.
Just because you can walk and I can crawl doesn't mean you should be so condescending. Thanks anyhow.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.