LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 06-03-2008, 02:47 PM   #1
talkinggoat
Member
 
Registered: Sep 2003
Location: lafayette, la
Distribution: RHL 6.2, FC 3, Ubuntu 14.04, Ubuntu 16.04
Posts: 112

Rep: Reputation: 15
Determine Hard Drive Address


I have 2 hard drives on my system /dev/sda and /dev/sdb sdb is being used to boot into linux and in grub.conf is set as (hd0,0). As far as I was always told, sda was hd0 and sdb was hd1. I'm confused, now. sda is setup to boot into windows. Currently, I have to specify, using the bios, which one I want to boot. How do I determine which drive and partition to use and tell grub to boot into windows, using sda, Also, how do I determine the actual address?
 
Old 06-03-2008, 04:34 PM   #2
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
GRUB sees the system disks relative to what the motherboard booted from. You can use GRUB interactively and use built in commands to view your system as GRUB sees it. The geometry command will list disk drives. The find command will search disk partitions to find a file named whatever you told it to search for.
Code:
geometry(
Code:
find menu.lst
Here is more information.

http://www.gnu.org/software/grub/manual/grub.html
 
Old 06-03-2008, 05:36 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Easiest is to just fix the Windoze boot.
Change the BIOS to boot Linux, then post the /boot/grub/menu.lst
 
Old 06-03-2008, 05:50 PM   #4
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
Quote:
Originally Posted by syg00 View Post
Easiest is to just fix the Windoze boot.
Change the BIOS to boot Linux, then post the /boot/grub/menu.lst
I got the impression that he wanted to understand how GRUB names devices.
 
Old 06-03-2008, 06:56 PM   #5
talkinggoat
Member
 
Registered: Sep 2003
Location: lafayette, la
Distribution: RHL 6.2, FC 3, Ubuntu 14.04, Ubuntu 16.04
Posts: 112

Original Poster
Rep: Reputation: 15
Actually, I was kinda getting to that. I don't believe in just asking something, unless I've tried to find the answer myself, but now, I have to ask, because I've followed the directions, and it doesn't work.

I booted into the grub command prompt, issued the command geometry (hd0) and got back :

Code:
drive 0x80: C/H/S = 24321/255/63, The number of sectors = 390721968, LBA
   Partition num: 0,  Filesystem type is ext2fs, partition type 0x83
   Partition num: 1,  Filesystem type unknown, partition type 0x8e
Above is the Linux boot drive.

Code:
geometry (hd1) :

drive 0x81: C/H/S = 14593/255/63, The number of sectors = 234441648, LBA
Partition num: 0,  Filesystem type unknown, partition type 0x7
Windows boot drive, above.


Here is a copy of my grub.conf/menu.lst. The windows stuff is at the bottom. When I try to boot, it'll echo the commands back, but just sit there w/o any errors. I don't know what else to do.

Code:
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
#          initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.22.14-72.fc6)
	root (hd0,0)
	kernel /vmlinuz-2.6.22.14-72.fc6 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
	initrd /initrd-2.6.22.14-72.fc6.img
title Fedora Core (2.6.18-1.2798.fc6)
	root (hd0,0)
	kernel /vmlinuz-2.6.18-1.2798.fc6 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
	initrd /initrd-2.6.18-1.2798.fc6.img

title Windows
	root (hd1,0)
	makeactive
	chainloader +1

Last edited by talkinggoat; 06-03-2008 at 06:58 PM.
 
Old 06-03-2008, 07:33 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Quote:
Originally Posted by stress_junkie View Post
I got the impression that he wanted to understand how GRUB names devices.
As did I - the nomenclature changes as the BIOS boot device is changed. I (we all) need to determine how Linux was installed - and what presumptions it had used.
With (too) little info in the initial post, I was guessing Anacronda was screwing things again.

hd0 is the (BIOS) boot device - in this case the Linux device, but it isn't if you change the boot order. This is important, because the M$oft boot-loaders require you to have the Windoze boot code (ntldr, boot.ini ...) on the BIOS boot device.
Grub uses a "fiddle" to get around this. Change the Windoze stanza to this
Code:
title Windows
rootnoverify (hd1,0)
map (hd0,hd1)
map (hd1,hd0)
makeactive
chainloader +1
 
Old 06-03-2008, 07:48 PM   #7
talkinggoat
Member
 
Registered: Sep 2003
Location: lafayette, la
Distribution: RHL 6.2, FC 3, Ubuntu 14.04, Ubuntu 16.04
Posts: 112

Original Poster
Rep: Reputation: 15
PooPoo! You beat me to the post. I finally figured it out and it's just what you said.

I did want to know how grub handled the drives, but it was because I wasn't understanding how grub assigned the drives. I always understood that hd0 was the first hd1 was the second and so on... In my case, hd0 is actually the third drive on an sata chain and hd1 is the first. That's why I was confused. I continued to read the grub help files and found that rootnoverify keeps grub from mounting the drive, then, using map to reverse the drives, makes windows believe it's drive 0. Brilliant!

View the instructions here.

Thanks for all your help.

Last edited by talkinggoat; 06-03-2008 at 08:31 PM.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to determine whether old pc's hard drive is IDE or SATA? aleska Linux - Hardware 5 05-03-2007 01:57 AM
Determine age of hard drive? General Linux - Hardware 4 04-29-2007 11:53 PM
How do i determine my IP address? How do i determine my host name? jwymore Linux - Networking 5 02-07-2007 09:57 AM
Can't Determine IP Address basketkase999 Linux - Networking 4 11-20-2005 07:42 PM
How to determine the free Hard Drive space ako Linux - Newbie 2 12-28-2003 10:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 08:44 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