Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
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.
Distribution: RHL 6.2, FC 3, Ubuntu 14.04, Ubuntu 16.04
Posts: 112
Rep:
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?
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.
Distribution: RHL 6.2, FC 3, Ubuntu 14.04, Ubuntu 16.04
Posts: 112
Original Poster
Rep:
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.
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
Distribution: RHL 6.2, FC 3, Ubuntu 14.04, Ubuntu 16.04
Posts: 112
Original Poster
Rep:
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!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.