LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-04-2005, 10:59 PM   #1
gvaught
Member
 
Registered: Sep 2003
Location: MidWest
Distribution: Debian GNU/Linux 8 (jessie)
Posts: 199

Rep: Reputation: 30
Talking 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
rootnoverify (1,0)
map (0,0) (1,0)
map (1,0) (0,0)
savedefault (not so sure about this line)
makeactive
chainloader +1
I know I need to do SOMETHING like that, but I'm not sure what. BTW, the SATA drive is connected directly into the mobo on SATA0 connector.

If there's anything else I can provide that would be of assistance, please let me know.
 
Old 02-05-2005, 09:10 PM   #2
gd2shoe
Member
 
Registered: Jun 2004
Location: Northern CA
Distribution: Debian
Posts: 835

Rep: Reputation: 49
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.
 
Old 02-05-2005, 09:32 PM   #3
gd2shoe
Member
 
Registered: Jun 2004
Location: Northern CA
Distribution: Debian
Posts: 835

Rep: Reputation: 49
For clarity:
(altering your above example)

Code:
title Win ExPee
rootnoverify (hd4,0)
map (hd0) (hd4)
map (hd4) (hd0)
chainloader +1
I could be missing something, but I don't think so. Just substitute the correct drive number in place of the '4'.
 
Old 02-06-2005, 01:39 PM   #4
gvaught
Member
 
Registered: Sep 2003
Location: MidWest
Distribution: Debian GNU/Linux 8 (jessie)
Posts: 199

Original Poster
Rep: Reputation: 30
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.
 
Old 02-06-2005, 01:58 PM   #5
gvaught
Member
 
Registered: Sep 2003
Location: MidWest
Distribution: Debian GNU/Linux 8 (jessie)
Posts: 199

Original Poster
Rep: Reputation: 30
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")
 
Old 02-06-2005, 04:18 PM   #6
gvaught
Member
 
Registered: Sep 2003
Location: MidWest
Distribution: Debian GNU/Linux 8 (jessie)
Posts: 199

Original Poster
Rep: Reputation: 30
Definitely "Unrecognized device string." after the following:
Code:
rootnoverify (hd1,0)
map  (0,0)(1,0)
And it looks like it never reaches the next line:
Code:
map  (1,0)(0,0)
Any suggestions?

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.
 
Old 02-06-2005, 06:42 PM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
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
 
Old 02-06-2005, 07:38 PM   #8
gvaught
Member
 
Registered: Sep 2003
Location: MidWest
Distribution: Debian GNU/Linux 8 (jessie)
Posts: 199

Original Poster
Rep: Reputation: 30
Did that. Edited my menu.lst file to include the following block (correcting previous erroneous entries):

Code:
title  Microsoft Windows XP Professional
rootnoverify (hd2,0)
map  (hd2)(hd0)
map  (hd0)(hd2)
# savedefault
makeactive
chainloader +1
boot
Still get the "Unrecognized device string" error after the first "map" line. Edited the device.map file to reflect changes and STILL getting the error.

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?
 
Old 02-06-2005, 08:18 PM   #9
gd2shoe
Member
 
Registered: Jun 2004
Location: Northern CA
Distribution: Debian
Posts: 835

Rep: Reputation: 49
I'm back.

I think you need a space between (hd2) and (hd0). The "info" file for grub has a space in their example.
 
Old 02-06-2005, 08:22 PM   #10
gd2shoe
Member
 
Registered: Jun 2004
Location: Northern CA
Distribution: Debian
Posts: 835

Rep: Reputation: 49
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.
 
Old 02-06-2005, 08:47 PM   #11
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
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.
 
Old 02-07-2005, 07:26 AM   #12
gvaught
Member
 
Registered: Sep 2003
Location: MidWest
Distribution: Debian GNU/Linux 8 (jessie)
Posts: 199

Original Poster
Rep: Reputation: 30
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)
into
Code:
map (hd2) (hd0)
(note the added space between the sets of parens) was something I don't think I could ever have thought of on my own.

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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
fc3 install doesnt install grub properly onto sata drive sabo Linux - Newbie 4 02-03-2007 04:04 PM
Installing grub onto sata drive to redirect to ide in Suse 9.3 d3viant Linux - Hardware 2 06-21-2005 09:14 AM
grub doesn't auto-load kernel, time/date auto-change, k3b cannot load kenji1903 Red Hat 16 03-27-2005 08:48 PM
grub won't work with SATA drive gjh Linux - General 3 01-17-2005 10:49 PM
grub tutorials and grub with sata dARkHunTEr Linux - Software 0 07-16-2004 12:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration