LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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
 
LinkBack Search this Thread
Old 11-01-2009, 05:01 PM   #1
pinenut
LQ Newbie
 
Registered: Oct 2009
Posts: 9

Rep: Reputation: 0
A question abut grub map command..


I have three hard drives:

  1. Primary master (PATA) - CentOS
  2. 1st SATA - Fedora 10
  3. 2nd SATA - Windows Xp
Now I can boot any of the above operating systems by changing the BIOS boot drive. But I am trying to learn more about grub, so I want to change CentOS /boot/grub/menu.lst so that I can boot Windows without changing BIOS.
Quote:
title WinXP
rootnoverify (hd1,0)
map (hd0) (hd2)
map (hd2) (hd0)
makeactive
chainloader +1
With the above entry, I am unable to boot WinXP because of "Error 13: Invalid or unsupported executable format"

Is the error due to the misuse of 'map' command? Is the map command only used for virtual swap between hd0 and hd1?
Please don't tell me to switch the order of two SATA drives because I've thought about it. It is too easy way out. I want to know more about map command. Thank you for reading my post.
 
Old 11-01-2009, 05:22 PM   #2
colorpurple21859
Member
 
Registered: Jan 2008
Location: florida
Distribution: slackware64-current, puppy, ubuntu
Posts: 820

Rep: Reputation: 111Reputation: 111
I think you have to reverse the order of the two map lines, not sure.
 
Old 11-01-2009, 06:05 PM   #3
yancek
Senior Member
 
Registered: Apr 2008
Distribution: PCLinux, Ubuntu, Peppermint
Posts: 2,706

Rep: Reputation: 317Reputation: 317Reputation: 317Reputation: 317
It should be a one (1) not a two (2) if xp is on the second drive, example:

Quote:
title Windows XP
rootnoverify (hd1,0)
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1
If you are using Grub Legacy and xp is on the second hard drive, first partition, this should boot it.
 
Old 11-01-2009, 06:07 PM   #4
yancek
Senior Member
 
Registered: Apr 2008
Distribution: PCLinux, Ubuntu, Peppermint
Posts: 2,706

Rep: Reputation: 317Reputation: 317Reputation: 317Reputation: 317
It should be a one (1) not a two (2) if xp is on the second drive, example:

Quote:
title Windows XP
rootnoverify (hd1,0)
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1
If you are using Grub Legacy and xp is on the second hard drive, first partition, this should boot it.

If it's on third drive in boot priority and first partition, change to:

Quote:
title Windows XP
rootnoverify (hd2,0)
map (hd0) (hd2)
map (hd2) (hd0)
chainloader +1
 
Old 11-01-2009, 06:30 PM   #5
pinenut
LQ Newbie
 
Registered: Oct 2009
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by yancek View Post
It should be a one (1) not a two (2) if xp is on the second drive, example:
If you are using Grub Legacy and xp is on the second hard drive, first partition, this should boot it.
If it's on third drive in boot priority and first partition, change to:
I said XP is on the third drive.

Last edited by pinenut; 11-01-2009 at 07:18 PM.
 
Old 11-01-2009, 07:08 PM   #6
johnsfine
Senior Member
 
Registered: Dec 2007
Distribution: Mepis, Centos
Posts: 4,004

Rep: Reputation: 731Reputation: 731Reputation: 731Reputation: 731Reputation: 731Reputation: 731Reputation: 731
Quote:
Originally Posted by pinenut View Post
I said XP is on the third drive.
Do you understand Yancek's point about the rootnoverify command?

In your first post you had
Quote:
rootnoverify (hd1,0)
meaning you wanted to boot to the second drive, but you said XP was the third drive.

The BIOS passes to the boot code a map of which drive is which.

You seem to be saying your BIOS passes the boot code the info that the primary PATA drive is hd0 and the primary SATA drive is hd1.

The main purpose of the map command is to modify the map that grub passes when in chains to another bootstrap.

Assuming you're right about what the BIOS gives grup in the original map, your map commands would make a new map in which hd0 is the secondary SATA and hd2 is the primary PATA. I think that is correct for your purposes.

But that doesn't change the fact that you told it to chain load to the first partition on hd1.

If your rootnoverify command was correct then your map commands were wrong. Since you say the map commands are correct, the rootnoverify command was wrong.

Also, have you verified that the bootable XP partition is the first partition of whatever drive it is on.

Last edited by johnsfine; 11-01-2009 at 07:11 PM.
 
Old 11-01-2009, 07:29 PM   #7
pinenut
LQ Newbie
 
Registered: Oct 2009
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
rootnoverify (hd1,0)
I am sorry I made a mistake (a typo). It should be (hd2,0) and it is exactly the same as in menu.lst

As I said, I can boot XP if I change BIOS to make the 2nd SATA drive bootable. That means that there is only one partition in that drive.

Last edited by pinenut; 11-01-2009 at 07:30 PM.
 
Old 11-01-2009, 09:29 PM   #8
pinenut
LQ Newbie
 
Registered: Oct 2009
Posts: 9

Original Poster
Rep: Reputation: 0
[Solved] A question about grub map command..

Quote:
title Windows XP
rootnoverify (hd2,0)
map (hd0) (hd2)
map (hd2) (hd0)
chainloader +1
This one worked for me.

Although I thought I had the same entry in my menu.lst, obviously I didn't. After several changes, I decided to copy and paste what yancek had posted earlier. That did the trick.

I must have made a typographical error or errors, perhaps putting too many spaces when they are not required or spelling error(s).

Thank you all for your help.

Last edited by pinenut; 11-01-2009 at 09:46 PM.
 
  


Reply

Tags
commands, grub, map


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
need to access /boot/grub/menu.lst and /boot/grub/device.map neouto Linux - Newbie 8 09-04-2005 11:45 AM
Suse Grub map? devojo Linux - Newbie 3 04-10-2005 01:52 AM
Grub and System.map cuco76 Linux - Software 4 06-25-2004 12:58 PM
Abut sed and tr commands pazvant Programming 1 05-09-2004 05:20 AM
general curiosity abut ntfs luap Linux - General 3 03-10-2003 09:32 PM


All times are GMT -5. The time now is 05:20 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration