免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 1668 | 回复: 10
打印 上一主题 下一主题

grub不是按照ide线上的口的顺序识别硬盘和分区序号的吧~ [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-04-10 14:21 |只看该作者 |倒序浏览
看了网上一些文章,说grub是按照ide先上的口的顺序识别硬盘和分区序号,一条ide线上接2块硬盘,主盘认作是hd0,从盘则是hd1.
我的rh9装在从盘,我不插主盘的时候只能用下面的配置启动阿,就是把从盘当做hd0
default=0
timeout=30
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
title Red Hat Linux (2.4.20-
        root (hd0,0)
        kernel /boot/vmlinuz-2.4.20-8 ro root=LABEL=/
        initrd /boot/initrd-2.4.20-8.img

论坛徽章:
0
2 [报告]
发表于 2004-04-10 15:18 |只看该作者

grub不是按照ide线上的口的顺序识别硬盘和分区序号的吧~

好象只有一个硬盘的话,BIOS就认为是主盘。与GRUB无关。

论坛徽章:
0
3 [报告]
发表于 2004-04-10 15:26 |只看该作者

grub不是按照ide线上的口的顺序识别硬盘和分区序号的吧~

主从是按硬盘跳线来识别

论坛徽章:
0
4 [报告]
发表于 2004-04-10 15:37 |只看该作者

grub不是按照ide线上的口的顺序识别硬盘和分区序号的吧~

硬件上讲是这样的,
逻辑讲不是,

比如,
你只有一个硬盘,并跳线为从盘,
Bios也认为它是从盘,

但是,在BioS里,你设置从HD0启动的话,没问题
设置为HD1的话,就无法启动了,

不知道你有没有试过??

论坛徽章:
0
5 [报告]
发表于 2004-04-10 15:38 |只看该作者

grub不是按照ide线上的口的顺序识别硬盘和分区序号的吧~

所以,硬盘的编号与主从线有关,但没有对应关系,
不是说主盘就是HD0,从盘就是HD1,

HD0应该解释为第一个硬盘。而不是主盘。

论坛徽章:
0
6 [报告]
发表于 2004-04-10 20:02 |只看该作者

grub不是按照ide线上的口的顺序识别硬盘和分区序号的吧~

Linux系统中硬盘编号从0开始,但是Grub中硬盘编号从1开始的!

论坛徽章:
1
午马
日期:2014-06-14 09:08:34
7 [报告]
发表于 2005-12-31 11:48 |只看该作者
楼上是不是说反了。
应该是linux从1开始
而grub从0开始吧。

论坛徽章:
0
8 [报告]
发表于 2005-12-31 12:08 |只看该作者
2 Naming convention
The device syntax used in GRUB is a wee bit different from what you may have seen before in your operating system(s), and you need to know it so that you can specify a drive/partition.

Look at the following examples and explanations:

     (fd0)

First of all, GRUB requires that the device name be enclosed with `(' and `)'. The `fd' part means that it is a floppy disk. The number `0' is the drive number, which is counted from zero. This expression means that GRUB will use the whole floppy disk.

     (hd0,1)

Here, `hd' means it is a hard disk drive. The first integer `0' indicates the drive number, that is, the first hard disk, while the second integer, `1', indicates the partition number (or the pc slice number in the BSD terminology). Once again, please note that the partition numbers are counted from zero, not from one. This expression means the second partition of the first hard disk drive. In this case, GRUB uses one partition of the disk, instead of the whole disk.

     (hd0,4)

This specifies the first extended partition of the first hard disk drive. Note that the partition numbers for extended partitions are counted from `4', regardless of the actual number of primary partitions on your hard disk.

     (hd1,a)

This means the BSD `a' partition of the second hard disk. If you need to specify which pc slice number should be used, use something like this: `(hd1,0,a)'. If the pc slice number is omitted, GRUB searches for the first pc slice which has a BSD `a' partition.

Of course, to actually access the disks or partitions with GRUB, you need to use the device specification in a command, like `root (fd0)' or `unhide (hd0,2)'. To help you find out which number specifies a partition you want, the GRUB command-line (see Command-line interface) options have argument completion. This means that, for example, you only need to type

     root (

followed by a <TAB>, and GRUB will display the list of drives, partitions, or file names. So it should be quite easy to determine the name of your target partition, even with minimal knowledge of the syntax.

Note that GRUB does not distinguish IDE from SCSI - it simply counts the drive numbers from zero, regardless of their type. Normally, any IDE drive number is less than any SCSI drive number, although that is not true if you change the boot sequence by swapping IDE and SCSI drives in your BIOS.

Now the question is, how to specify a file? Again, consider an example:

     (hd0,0)/vmlinuz

This specifies the file named `vmlinuz', found on the first partition of the first hard disk drive. Note that the argument completion works with file names, too.

That was easy, admit it. Now read the next chapter, to find out how to actually install GRUB on your drive.

论坛徽章:
0
9 [报告]
发表于 2005-12-31 12:47 |只看该作者
原帖由 古剑和酒 于 2004-4-10 14:21 发表
看了网上一些文章,说grub是按照ide先上的口的顺序识别硬盘和分区序号,一条ide线上接2块硬盘,主盘认作是hd0,从盘则是hd1.
我的rh9装在从盘,我不插主盘的时候只能用下面的配置启动阿,就是把从盘当做hd0
default=0 ...


当你只有一块硬盘的时候,当然就是hd(0)了。

现在多半是用硬盘的跳线帽来决定主从盘了,很少用IDE线的接口来判断。
而且在只有一个硬盘的时候,这个盘就default是主盘了。

论坛徽章:
0
10 [报告]
发表于 2006-01-14 23:59 |只看该作者
原帖由 tanyear 于 2005-12-31 12:47 发表


当你只有一块硬盘的时候,当然就是hd(0)了。

现在多半是用硬盘的跳线帽来决定主从盘了,很少用IDE线的接口来判断。
而且在只有一个硬盘的时候,这个盘就default是主盘了。

西捷硬盘的跳线就是以IDE借口的位置决定主从
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP