Using GRUB to load XP on *third* drive (SATA)
Greetings all. I hope this goes quick as it's late here and I have a client early in the morning.
My situation is thus: I have a working box, running Sarge (Debian) quite nicely for several months now. Well, this box has a P4 2.8GHz process with 512MB RAM and approx. 200GB of hard drive. All this computer and Linux doesn't come close to maxing it out (I'm really not a power user, yet). So, with all of this computer I decided it really could run Windows, too. So, I unplugged my IDE hard drives and added a third SATA drive and installed Windows on it. Everything is great to this point. Then I plug the IDE drives back in and boot back into Debian, just as I'd wanted. My problem comes in as what does Linux see the SATA drives as? How is it listed in the /dev directory? /dev/hdc? No, that's what the DVDROM shows up as (as well as CDROM and a host of other names). Is the SATA drive listed as /dev/sda? I really don't know. Now for the real issue - GRUB. In order to boot into this Windows set up, I need to know what to do in GRUB. In the past, my dual-boot boxes have included sections like the following: Code:
title Win ExPee If there's anything else I can provide that would be of assistance, please let me know. |
You're close. I don't think you need either the savedefault or makeactive lines.
The trick is to map the correct drive. I'm not sure what your sata drive shows up as, so I can't give a clear-cut answer. Here's my understanding. The grub numbers start at the first bootable device in bios. I believe the numbers climb from there. If I had to take a guess, I'd try mapping (hd0) with (hd4). Start Debian and go to the console. "cat /proc/partitions" will give you a list of all drives and their partitions on the machine. Try to use the following conversion: hda -> (hd0) hdb -> (hd1) hdc -> (hd2) hdd -> (hd3) hde -> (hd4) hdf -> (hd5) And so forth. If it shows up as a scsi device (sd0) then I don't know what to try, except one number at a time until it goes. |
For clarity:
(altering your above example) Code:
title Win ExPee |
Oh, I wish I had caught you last night. I hope you're still around (or back).
My specific situation is this: IDE0 -> hda -> 80GB (this has all of my "essential" Linux/Debian filesystems) IDE1 -> hdb -> 120GB (this has my "opt" filesystem) SATA0 -> sd0 -> 80GB (this is my Windows XP installation) I installed Windows XP on the SATA drive, with the other drives removed from the system. I then connected the IDE drives and did my Debian install. GRUB was loaded automagically and found the XP install (which it labeled as hd2,0). First I had to modify /boot/grub/menu.lst to read "rootnoverify (hd2,0)" since it was having problems with NTFS. Once I got past that hurdle, it runs the script and just sits there. I'll try removing (commenting out) the savedefault and makeactive lines to see if that helps. In the mean time, I'd like some further assistance/feedback on how to go about getting this fixed. Thx. |
One thing I just noticed (btw, it didn't work) was that the error I get after the "map" line (it only shows one before the error) I get the following error:
Unrecognized device string. (or command or something like that) Also, I checked /boot/grub/device.map and sda is hd2, so that much I'm pretty confident on. Anyway, if you or anyone you know, or even someone you don't know, has a suggestion, I'm willing to listen and probably try it. (As long as it doesn't start with "rm") |
Definitely "Unrecognized device string." after the following:
Code:
rootnoverify (hd1,0) Code:
map (1,0)(0,0) Oh, FYI, I found in BIOS where I could make the SATA drive be the second drive, thus the change in the number used in GRUB. Didn't work as hd2, anyway, so why not change it. |
Generally grub finds IDE drives first, then SCSI (SATA included)
So, in your case (prior to moving the SATA in the BIOS); hda <=> hd0 for grub hdb <=> hd1 sda <=> hd2 Your map commands are wrong - use the format posted by gd2shoe |
Did that. Edited my menu.lst file to include the following block (correcting previous erroneous entries):
Code:
title Microsoft Windows XP Professional Went back into BIOS and put the drives back the way they were before I started mucking with things - same results. So, now the drives are listed, in BIOS and device.map, as they were to begin with. The menu.lst has the drive designations as they were when detected by the GRUB installation. It doesn't work without the "map" line and it doesn't work with the "map" lines. Help? |
I'm back.
I think you need a space between (hd2) and (hd0). The "info" file for grub has a space in their example. |
Oh, and I still don't think you need the "makeactive" line either.
I know you don't need the "boot" line. This one doesn't matter whether you remember it or forget it. If it isn't at the end of the section GRUB will issue it anyway. |
Less changes is good.
One at a time is best. If the map file reflects your hardware, don't change it - or at least change it back. Reverse the order of the map commands. Don't know if it's relevant, but makes sense (to me) to remap hd0 first. If all else fails, edit the menu when it comes up. Then you can entered each command line by hand - and "tab completion" works. So try map ({tab} to see what grub thinks the lie of the land is. Note that in this case you *WILL* need to enter the boot command. |
gd2shoe, you, my friend, are now my super-hero for the day.
I had already gone back to zero (including with the map file), so that was good. But thanks for the sage advice, syg00. It's always nice to have the voice of reason (cover the basics, first) when I've been struggling for two days. But changing Code:
map (hd2)(hd0) Code:
map (hd2) (hd0) Ahhhh, this is what I love about open source - geeks helping geeks. In any event, now I can boot into Debian, as always, AND boot into Windows without having to go into BIOS and set the SATA drive as the boot drive. Sweet. Well, I could sit here and gush wonderful pleasantries about Linux, Open Source and gd2shoes for hours, but I have a client who needs assistance "first thing Monday morning", which is probably about two hours before I'll get there but they'll have to deal with it. May God smile largely upon you today, gd2shoe and syg00. |
All times are GMT -5. The time now is 11:43 PM. |