I added the following to my menu.lst: title Install SUSE 10.1 Alpha 1 root (hd3,2) kernel /opensuse/DVD_10.1_A1/boot/loader/linux initrd /opensuse/DVD_10.1_A1/boot/loader/initrd What I want to know what program I must use to know what the correct root is. With me linux (for 10.1A1) is : /media/data/opensuse/DVD_10.1_A1/boot/loader/linux Also: /dev/hdf3 is /media/data Because hdf is the third HD, it is 3 and because hdf3 is the second partition, that is 2, so it makes hd3,2. What command must I use to know this? If that can be done by a simpel command, deciding what to put in your grub is a lot easier for http://www.opensuse.org/Installation_without_CD It works great when you know what to add in grub, but I understand that people might be baffled with what to put where and that not all IDE things count. houghi -- Quote correct (NL) http://www.briachons.org/art/quote/ Zitiere richtig (DE) http://www.afaik.de/usenet/faq/zitieren Quote correctly (EN) http://www.netmeister.org/news/learn2quote.html
* houghi <houghi@houghi.org> [09-29-05 12:15]:
I added the following to my menu.lst:
title Install SUSE 10.1 Alpha 1 root (hd3,2) kernel /opensuse/DVD_10.1_A1/boot/loader/linux initrd /opensuse/DVD_10.1_A1/boot/loader/initrd
What I want to know what program I must use to know what the correct root is. With me linux (for 10.1A1) is : /media/data/opensuse/DVD_10.1_A1/boot/loader/linux Also: /dev/hdf3 is /media/data
Because hdf is the third HD, it is 3 and because hdf3 is the second partition, that is 2, so it makes hd3,2.
counting starts with zero as the first digit. 0 = a (and 0 = 1) root (hd3,2) = hdd3 /dev/hdf3 = (hd6,2) also, hd# does not increment for each hard drive, it changes according to where the device is located on the bus. note: air, you may use the other notation, root (hdd3), in grub -- Patrick Shanahan Registered Linux User #207535 http://wahoo.no-ip.org @ http://counter.li.org HOG # US1244711 Photo Album: http://wahoo.no-ip.org/gallery2
* Patrick Shanahan <ptilopteri@gmail.com> [09-29-05 12:22]:
* houghi <houghi@houghi.org> [09-29-05 12:15]:
I added the following to my menu.lst:
title Install SUSE 10.1 Alpha 1 root (hd3,2) kernel /opensuse/DVD_10.1_A1/boot/loader/linux initrd /opensuse/DVD_10.1_A1/boot/loader/initrd
What I want to know what program I must use to know what the correct root is. With me linux (for 10.1A1) is : /media/data/opensuse/DVD_10.1_A1/boot/loader/linux Also: /dev/hdf3 is /media/data
Because hdf is the third HD, it is 3 and because hdf3 is the second partition, that is 2, so it makes hd3,2.
counting starts with zero as the first digit.
0 = a (and 0 = 1)
root (hd3,2) = hdd3 /dev/hdf3 = (hd6,2)
also, hd# does not increment for each hard drive, it changes according to where the device is located on the bus.
note: air, you may use the other notation, root (hdd3), in grub
for research, look at: info grub Naming convention:: -- Patrick Shanahan Registered Linux User #207535 http://wahoo.no-ip.org @ http://counter.li.org HOG # US1244711 Photo Album: http://wahoo.no-ip.org/gallery2
On Thu, Sep 29, 2005 at 12:22:23PM -0500, Patrick Shanahan wrote:
What I want to know what program I must use to know what the correct root is. <snip>> counting starts with zero as the first digit.
0 = a (and 0 = 1)
root (hd3,2) = hdd3 /dev/hdf3 = (hd6,2)
Well, with me it is hd3,2. What I am looking for is not so much a way to calculate it yourself, but a way to determine it automaticaly, something like: # foo /dir/bar hd3,2 or # foo /dev/hdf3 hd3,2 Or something similar. houghi -- Quote correct (NL) http://www.briachons.org/art/quote/ Zitiere richtig (DE) http://www.afaik.de/usenet/faq/zitieren Quote correctly (EN) http://www.netmeister.org/news/learn2quote.html
* houghi <houghi@houghi.org> [09-29-05 12:40]:
Well, with me it is hd3,2. What I am looking for is not so much a way to calculate it yourself, but a way to determine it automaticaly, something like:
# foo /dir/bar hd3,2
or # foo /dev/hdf3 hd3,2
Or something similar.
cat /etc/fstab -- Patrick Shanahan Registered Linux User #207535 http://wahoo.no-ip.org @ http://counter.li.org HOG # US1244711 Photo Album: http://wahoo.no-ip.org/gallery2
On Thu, Sep 29, 2005 at 12:59:54PM -0500, Patrick Shanahan wrote:
* houghi <houghi@houghi.org> [09-29-05 12:40]:
Well, with me it is hd3,2. What I am looking for is not so much a way to calculate it yourself, but a way to determine it automaticaly, something like:
# foo /dir/bar hd3,2
or # foo /dev/hdf3 hd3,2
Or something similar.
cat /etc/fstab
No, that is not correct. That does not hold any information about what grub has. Where whould a program or script get the (hd3,2) info from that? I think I am not being clear. I am looking for a command or program or script that translates either /media/data or /dev/hdf3 to the correct root information. I am able to calculate it myself. I just want the computer to do it for me. A command that has /dev/hdf3 as input and hd3,2 as output (or whatever is correct) houghi -- Quote correct (NL) http://www.briachons.org/art/quote/ Zitiere richtig (DE) http://www.afaik.de/usenet/faq/zitieren Quote correctly (EN) http://www.netmeister.org/news/learn2quote.html
On Thu, Sep 29, 2005 at 08:25:10PM +0200, houghi wrote:
I am able to calculate it myself. I just want the computer to do it for me. A command that has /dev/hdf3 as input and hd3,2 as output (or whatever is correct)
I have a bit more information. Say I have the Alpha 1 all in /media/data/opensuse/DVD_10.1_A1 That means that linux and initard are: /media/data/opensuse/DVD_10.1_A1/boot/loader/linux /media/data/opensuse/DVD_10.1_A1/boot/loader/initrd Now /media/data is /dev/hdf3, so I must enter the following in grub: title DVD_10.1_A1 root # Later kernel /opensuse/DVD_10.1_A1/boot/loader/linux initrd /opensuse/DVD_10.1_A1/boot/loader/initrd Now I still need to know what root is. I can do this by counting. I can also do this by lauching `grub` as root and enter: grub> find /opensuse/DVD_10.1_A1/boot/loader/linux This gives me : (hd3,2) Any way I could do this without entering grub? houghi -- Quote correct (NL) http://www.briachons.org/art/quote/ Zitiere richtig (DE) http://www.afaik.de/usenet/faq/zitieren Quote correctly (EN) http://www.netmeister.org/news/learn2quote.html
* houghi <houghi@houghi.org> [10-01-05 10:47]:
I have a bit more information. Say I have the Alpha 1 all in /media/data/opensuse/DVD_10.1_A1 That means that linux and initard are: /media/data/opensuse/DVD_10.1_A1/boot/loader/linux /media/data/opensuse/DVD_10.1_A1/boot/loader/initrd
Now /media/data is /dev/hdf3, so I must enter the following in grub:
title DVD_10.1_A1 root # Later kernel /opensuse/DVD_10.1_A1/boot/loader/linux initrd /opensuse/DVD_10.1_A1/boot/loader/initrd
Now I still need to know what root is. I can do this by counting. I can also do this by lauching `grub` as root and enter: grub> find /opensuse/DVD_10.1_A1/boot/loader/linux
This gives me : (hd3,2)
Any way I could do this without entering grub?
Not to my knowledge. BUT, you said that /media/data is /dev/hdf3 and grub gives you (hd3,2). This is incorrect as I understand. 'f' is the sixth letter which would translate to the digit 5, the sixth digit counting zero. I believe it should read (hd5,2). Also remember, the number of hard drives is not relevant for the device location. It *is* the device location on the bus that determines the device name, /dev/hdf3, sixth device, third primary partition on the device. -- Patrick Shanahan Registered Linux User #207535 http://wahoo.no-ip.org @ http://counter.li.org HOG # US1244711 Photo Album: http://wahoo.no-ip.org/gallery2
On Saturday 01 October 2005 12:02, Patrick Shanahan wrote:
Not to my knowledge.
BUT, you said that /media/data is /dev/hdf3 and grub gives you (hd3,2). This is incorrect...
Uh-oh... I was under the impression grub counted like this: /dev grub-speak === ======= hda hd0 hdb (presumed optical) hdc hd1 hdd hd2 hde hd3 hdf hd4 and so on... Partitions (examples): ============= hda1 hd0,0 hdd4 hd2,3 hdf2 hd4,1 and so on... - Carl
On Saturday 01 October 2005 18:02, Patrick Shanahan wrote:
* houghi <houghi@houghi.org> [10-01-05 10:47]:
I have a bit more information. Say I have the Alpha 1 all in /media/data/opensuse/DVD_10.1_A1 That means that linux and initard are: /media/data/opensuse/DVD_10.1_A1/boot/loader/linux /media/data/opensuse/DVD_10.1_A1/boot/loader/initrd
Now /media/data is /dev/hdf3, so I must enter the following in grub:
title DVD_10.1_A1 root # Later kernel /opensuse/DVD_10.1_A1/boot/loader/linux initrd /opensuse/DVD_10.1_A1/boot/loader/initrd
Now I still need to know what root is. I can do this by counting. I can also do this by lauching `grub` as root and enter: grub> find /opensuse/DVD_10.1_A1/boot/loader/linux
This gives me : (hd3,2)
Any way I could do this without entering grub?
Not to my knowledge.
BUT, you said that /media/data is /dev/hdf3 and grub gives you (hd3,2). This is incorrect as I understand. 'f' is the sixth letter which would translate to the digit 5, the sixth digit counting zero. I believe it should read (hd5,2).
Also remember, the number of hard drives is not relevant for the device location. It *is* the device location on the bus that determines the device name, /dev/hdf3, sixth device, third primary partition on the device.
No it isn't. For grub, what's interesting is the ordering the BIOS uses (changeable in the device map) I don't think it would be too much difficulty ripping out the device identification bits of grub to a stand-alone utility. But isn't "cat /boot/grub/device.map" sufficient?
On Sat, Oct 01, 2005 at 06:17:52PM +0200, Anders Johansson wrote:
I don't think it would be too much difficulty ripping out the device identification bits of grub to a stand-alone utility. But isn't "cat /boot/grub/device.map" sufficient?
That's already a part of it. Now I also need to know what the partition is. houghi -- Quote correct (NL) http://www.briachons.org/art/quote/ Zitiere richtig (DE) http://www.afaik.de/usenet/faq/zitieren Quote correctly (EN) http://www.netmeister.org/news/learn2quote.html
On Saturday 01 October 2005 18:37, houghi wrote:
On Sat, Oct 01, 2005 at 06:17:52PM +0200, Anders Johansson wrote:
I don't think it would be too much difficulty ripping out the device identification bits of grub to a stand-alone utility. But isn't "cat /boot/grub/device.map" sufficient?
That's already a part of it. Now I also need to know what the partition is.
The way grub-install does it is df `dirname filename| sed -n 's%.*\(/dev/[^ ]*\).*%\1%p' I'm looking at the BIOS stuff in grub now to see if I can make a stand-alone utility out of it
On Sat, Oct 01, 2005 at 07:17:48PM +0200, Anders Johansson wrote:
The way grub-install does it is
df `dirname filename| sed -n 's%.*\(/dev/[^ ]*\).*%\1%p'
I'm looking at the BIOS stuff in grub now to see if I can make a stand-alone utility out of it
I think I am going in circles here. The above (if you put a backtick in front of |, making it filename`| ) tells me /dev/hdf3. That still does not show me hd3,2 Would be handy if all could be done with one command. :-) Strange that something that should be simple takes so much effort. houghi -- Quote correct (NL) http://www.briachons.org/art/quote/ Zitiere richtig (DE) http://www.afaik.de/usenet/faq/zitieren Quote correctly (EN) http://www.netmeister.org/news/learn2quote.html
On Saturday 01 October 2005 19:45, houghi wrote:
On Sat, Oct 01, 2005 at 07:17:48PM +0200, Anders Johansson wrote:
The way grub-install does it is
df `dirname filename| sed -n 's%.*\(/dev/[^ ]*\).*%\1%p'
I'm looking at the BIOS stuff in grub now to see if I can make a stand-alone utility out of it
I think I am going in circles here. The above (if you put a backtick in front of |, making it filename`| )
Well, I expressed myself badly. dirname is a command, but filename was meant to be replaced with whatever file you wanted to know the location of
tells me /dev/hdf3. That still does not show me hd3,2
No, but combine that with the device map and you're set
Would be handy if all could be done with one command
I'm working on it
On Sat, Oct 01, 2005 at 07:51:19PM +0200, Anders Johansson wrote:
On Saturday 01 October 2005 19:45, houghi wrote:
On Sat, Oct 01, 2005 at 07:17:48PM +0200, Anders Johansson wrote:
The way grub-install does it is
df `dirname filename| sed -n 's%.*\(/dev/[^ ]*\).*%\1%p'
I'm looking at the BIOS stuff in grub now to see if I can make a stand-alone utility out of it
I think I am going in circles here. The above (if you put a backtick in front of |, making it filename`| )
Well, I expressed myself badly. dirname is a command, but filename was meant to be replaced with whatever file you wanted to know the location of
OK.
tells me /dev/hdf3. That still does not show me hd3,2
No, but combine that with the device map and you're set
Indeed.
Would be handy if all could be done with one command
I'm working on it
I am working on some butt ugly bash script myself. Still a pity that there is not a build in command to do it with. houghi -- Quote correct (NL) http://www.briachons.org/art/quote/ Zitiere richtig (DE) http://www.afaik.de/usenet/faq/zitieren Quote correctly (EN) http://www.netmeister.org/news/learn2quote.html
On Sat, Oct 01, 2005 at 09:26:32PM +0200, houghi wrote:
I am working on some butt ugly bash script myself. Still a pity that there is not a build in command to do it with.
OK. Here is the code I have made. Nit very good looking and too much grep and awk instead of sed. Also too many parameters. You run it as `bios /path/to/linux_kernel` At this moment it only outputs the grub information. I will edit it so that lilo will also work. I then will include it in makeSUSEdvd in such a way that if you run makeSUSEdvd it will tell you what to fill out in both grub and lilo config files. If anybody has an easier way, please let me know. Two examples: houghi@penne : bios /media/data/opensuse/DVD_10.1_A1/boot/loader/linux ### Put the following in /boot/grub/menu.lst ### title SOMETHING root (hd3,2) linux /opensuse/DVD_10.1_A1/boot/loader/linux initrd /opensuse/DVD_10.1_A1/boot/loader/initrd houghi@penne : mount /dev/hdf6 /mnt/ houghi@penne : bios /mnt/10.1/boot/loader/linux ### Put the following in /boot/grub/menu.lst ### title SOMETHING root (hd3,5) linux /10.1/boot/loader/linux initrd /10.1/boot/load Here is the code I used: #!/bin/bash # bios # Get the directory DEV0=`dirname $1` DEV=`df $DEV0 |grep dev|awk '{print $1}'` # Get the prefix PRE=`df $1 |grep dev|awk '{print $6}'` AFT=`echo $DEV0|sed s#$PRE##g` # Get the number NUM=`echo $DEV|awk -F/dev/... '{f=$NF}END{print f+0}'` # Get the boot sequence DEV2=`echo $DEV|awk -F${NUM} '{print $1}'` # Get it all together let NUM=NUM-1 DEV3=`grep $DEV2 /boot/grub/device.map|awk -F")" '{print $1}'`",$NUM)" #output echo "### Put the following in /boot/grub/menu.lst ###" echo "title SOMETHING" echo " root $DEV3" echo " linux $AFT/linux" echo " initrd $AFT/initrd" houghi -- Quote correct (NL) http://www.briachons.org/art/quote/ Zitiere richtig (DE) http://www.afaik.de/usenet/faq/zitieren Quote correctly (EN) http://www.netmeister.org/news/learn2quote.html
On Sat, Oct 01, 2005 at 11:02:16AM -0500, Patrick Shanahan wrote:
BUT, you said that /media/data is /dev/hdf3 and grub gives you (hd3,2). This is incorrect as I understand. 'f' is the sixth letter which would translate to the digit 5, the sixth digit counting zero. I believe it should read (hd5,2).
It is hd3,2. It boots with hd3,2 and even grub gives me 3,2 (See my other post.) This is how my IDE devices are: hda 10GB HD hd0 hdb 40GB HD hd1 hdc DVD --- Not a HD hdd DVD R/W --- Not a HD hde 160GB HD hd2 hdf 160GB HD hd3 hdg CD R/W --- Not a HD hdh empty The problem does no lie in how I can determine my root, because I know my hardware. The problem is explaining it on a page or putting it in a script, so others will know what theirs is and that in an easy way so they do not make the same mistakes as you did. ;-) houghi -- Quote correct (NL) http://www.briachons.org/art/quote/ Zitiere richtig (DE) http://www.afaik.de/usenet/faq/zitieren Quote correctly (EN) http://www.netmeister.org/news/learn2quote.html
* houghi <houghi@houghi.org> [10-01-05 11:35]:
On Sat, Oct 01, 2005 at 11:02:16AM -0500, Patrick Shanahan wrote:
BUT, you said that /media/data is /dev/hdf3 and grub gives you (hd3,2). This is incorrect as I understand. 'f' is the sixth letter which would translate to the digit 5, the sixth digit counting zero. I believe it should read (hd5,2).
It is hd3,2. It boots with hd3,2 and even grub gives me 3,2 (See my other post.)
I stand corrected. I should have looked closer. My own system shows /dev/hde as (hd2). sorry for the mis-information. My bad.... -- Patrick Shanahan Registered Linux User #207535 http://wahoo.no-ip.org @ http://counter.li.org HOG # US1244711 Photo Album: http://wahoo.no-ip.org/gallery2
participants (4)
-
Anders Johansson
-
Carl Hartung
-
houghi
-
Patrick Shanahan