LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   grub; hda1 == root(hd0,0) ; hda5 = ???? (https://www.linuxquestions.org/questions/linux-general-1/grub%3B-hda1-%3D%3D-root-hd0-0-%3B-hda5-%3D-262593/)

stupidloser 12-04-2004 03:20 PM

grub; hda1 == root(hd0,0) ; hda5 = ????
 
simple question, I'm editing my grub to include a distro installed on hda5, so what should the first line [i.e.- root(hdx,x)] be?

my hda1 uses (hd0, 0)

so hd5 should use hd?,?

320mb 12-04-2004 03:27 PM

Re: grub; hda1 == root(hd0,0) ; hda5 = ????
 
Quote:

Originally posted by stupidloser
simple question, I'm editing my grub to include a distro installed on hda5, so what should the first line [i.e.- root(hdx,x)] be?


root (hd0,4)

stupidloser 12-04-2004 03:29 PM

nice. thanks for the reply 320mb! :)

michaelk 12-04-2004 05:38 PM

It depends on how your drive is partitioned. It is my understanding that grub works on recognized partitions starting from 0.
So if your drive is partitioned.
/dev/hda1 - hd0,0
/dev/hda4 - hd0,1
....

kevinalm 12-04-2004 07:27 PM

First, the partition number (the 5 in hda5) is always 1 less than the linux number. So it is 4 in this case.

Second, grub scans through hda-hdf in sequence, assigning a drive number if and only if a drive is detected. So if for example you have a hd on hda and hdf and not on any other positions hda=(hd0) and hdf=(hd1).

Finally, an entry in menu.lst/grub.conf like this:

root(hd0,0)

refers to the partition on which menu.lst, grub.conf, the stage files etc. which you are using reside. This is grubs root, _not_ the filesystem root (/). It is distinct from the root=hd?? on the kernel line. root(hd?,?) is optitional by the way. That info is encoded in the mbr when you install grub. It is usefull to have as a reminder of which menu.lst/grub.conf to edit when booting multiple linux installations. Many distro's will install with it commented out:

#root(hd0,0)

michaelk 12-04-2004 08:47 PM

I stand corrected.

kevinalm 12-05-2004 01:26 AM

Quote:

Originally posted by michaelk
I stand corrected.
Confused the heck out of me at first, too.:D

Forgot to mention, only hd's count, other ide devices (ie cdrom's) are done seperately in a similar fashion, as are floppies (fd0), scsi drives (sd0) and so on.

It's important to remember which root(hd?,?) you're using and this can change when installing multiple linux system's. I prefer to use the grub prompt to set this manually to the /boot/grub I want to use, as grub-install seems to be a little unpredictable, at least for me.


All times are GMT -5. The time now is 02:47 AM.