LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 2138|回复: 5

如何正确理解"The first sector of boot partition"

[复制链接]
发表于 2005-9-11 14:32:42 | 显示全部楼层 |阅读模式
如何对安装 LILO 或 GRUB 时 "The first sector of boot partition" 的位置进行正确理解。

问题的由来:
本人在一块40G的硬盘上安装的是多OS,分区如下:
一个 FAT16 的 DOS 主分区,一个 UNIX 主分区,一个 FAT32 的 Windows98 主分区,一个扩展分区。扩展分区中两个 ext3 的 Linux 分区,打算分别装 Turbo 10 和 Red Hat 9(现还未装),和一个共用的 swap 分区,还有两个 FAT32 的逻辑分区。采用 System Commander 来作启动时的引导管理。在安装 Turbo 10 时我明明选择的是把 GRUB 安装在 "The first sector of boot partition" 上,可完成后它却装在了 MBR 上了?!也就是启动时变成了它的管理界面了。一开始本人还以为选错了,于是在恢复 System Commander 的情况下又把 Turbo 10 再装了一遍,可结果还是如此?!于是本人就感到奇怪了,因为本人在别的机器上也类似这样安装过,唯一有所区别的是,我在另外一台机器上是把这两个 Linux 都是安装在第二块硬盘上的,而且都是作为主分区的,没出现这样的情况。
于是本人就不得不对 "The first sector of boot partition" 这句话进行反复理解了。这其中的 "boot partition" 所指的究竟是泛泛而指的 Linux 所在的分区(不管该分区是否是主分区或逻辑分区),还是该分区必须是可 boot 的?如果是后者的话,会不会是 GRUB或LILO 太“聪明”了,尽管 Linux 是可以从逻辑分区上启动的,但 LILO或GRUB 认为如果你把 Linux 安装在逻辑分区中,“普通”的 MBR 将不能正确引导到它,所以即便你选择的是 "The first sector of boot partition" ,由于这个 partition 在它认为是不可 boot 的,所以就“自作聪明”的在 MBR 上也作了相应的修改?或者是不是应该这样理解:假如要把 LILO或GRUB 安装到 "the first sector" 上只对 Linux 是安装在主分区上才有效???

同样道理,又如何对安装在 MBR 上进行正确理解,假如 Linux 是安装在第二块硬盘上的,而我又选择的是把 LILO或GRUB 安装到 MBR 上时它会不会又“自作聪明”地安装到第一块硬盘上的 MBR 上?

由于还未装 Red Hat 9 ,所以不知它的 LILO或GRUB 会是怎样。

其实,如果已经有了System Commander可以不再需要grub或lilo了,但我想装上去试试。也就是说让System Commander引导 grub或lilo,然后再让 grub或lilo 引导 linux 。理论上这应该是没有问题的。但我就奇怪的是,为什么 grub或lilo 这么“不听话”?
发表于 2005-9-12 10:14:25 | 显示全部楼层
Post by DOSforever
如何对安装 LILO 或 GRUB 时 "The first sector of boot partition" 的位置进行正确理解。

问题的由来:
本人在一块40G的硬盘上安装的是多OS,分区如下:
一个 FAT16 的 DOS 主分区,一个 UNIX 主分区,一个 FAT32 的 Windows98 主分区,一个扩展分区。扩展分区中两个 ext3 的 Linux 分区,打算分别装 Turbo 10 和 Red Hat 9(现还未装),和一个共用的 swap 分区,还有两个 FAT32 的逻辑分区。
Very difficult to understand your current partition layout.  Can you post your result of fdisk -l and describe which corresponding partitions?
采用 System Commander 来作启动时的引导管理。在安装 Turbo 10 时我明明选择的是把 GRUB 安装在 "The first sector of boot partition" 上,可完成后它却装在了 MBR 上了?!也就是启动时变成了它的管理界面了。一开始本人还以为选错了,于是在恢复 System Commander 的情况下又把 Turbo 10 再装了一遍,可结果还是如此?!于是本人就感到奇怪了,因为本人在别的机器上也类似这样安装过,唯一有所区别的是,我在另外一台机器上是把这两个 Linux 都是安装在第二块硬盘上的,而且都是作为主分区的,没出现这样的情况。
Sorry, I have no knowledge on System Commander.  It think it is non-free and not open source. i.e. something that I would not trust.
于是本人就不得不对 "The first sector of boot partition" 这句话进行反复理解了。这其中的 "boot partition" 所指的究竟是泛泛而指的 Linux 所在的分区(不管该分区是否是主分区或逻辑分区),还是该分区必须是可 boot 的?
Trivial, if /dev/hda2 is your /boot, then it refers to the first sector of /dev/hda2
如果是后者的话,会不会是 GRUB或LILO 太“聪明”了,尽管 Linux 是可以从逻辑分区上启动的,但 LILO或GRUB 认为如果你把 Linux 安装在逻辑分区中,“普通”的 MBR 将不能正确引导到它,所以即便你选择的是 "The first sector of boot partition" ,由于这个 partition 在它认为是不可 boot 的,所以就“自作聪明”的在 MBR 上也作了相应的修改?或者是不是应该这样理解:假如要把 LILO或GRUB 安装到 "the first sector" 上只对 Linux 是安装在主分区上才有效???

同样道理,又如何对安装在 MBR 上进行正确理解,假如 Linux 是安装在第二块硬盘上的,而我又选择的是把 LILO或GRUB 安装到 MBR 上时它会不会又“自作聪明”地安装到第一块硬盘上的 MBR 上?
It is not a matter of LILO or GRUB, it is a matter of your system installer.
由于还未装 Red Hat 9 ,所以不知它的 LILO或GRUB 会是怎样。
LILO or GRUB and GNU bootloader, they are not distro-specific.  The best way is to read their instructions and learn about how to use these tools.
其实,如果已经有了System Commander可以不再需要grub或lilo了,但我想装上去试试。也就是说让System Commander引导 grub或lilo,然后再让 grub或lilo 引导 linux 。理论上这应该是没有问题的。但我就奇怪的是,为什么 grub或lilo 这么“不听话”?
If I have LILO or GRUB, why do I need System Commander? i.e. 其实,如果已经有了grub或lilo,可以不再需要
System Commander了
回复 支持 反对

使用道具 举报

发表于 2005-9-12 11:52:06 | 显示全部楼层
会不会是你把分区选错了?
比如说虽然你选择了The first sector of boot partition,但是这个partition却不是安装linux的扩展分区,而是系统默认的可以引导的主分区,如果是这样的话,grub其实并没有装到mbr,只是mbr会指向这个住分区,所以一开机就进入grub,
还有会不会是system commander 在mbr留下了什么?
用dos引导系统,然后fdisk /mbr
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-9-12 16:07:12 | 显示全部楼层
首先,感谢d00m3d认真仔细的回复。

现在我恢复了 System Commander 启动管理以后 Linux 进不去了,这是我手工写的分区的大致情况:

  /hda1  06h  FAT16  (DOS)
  /hda2  63h       (UNIX)
  /hda3  0ch  FAT32  (indows)
  /hda4  0fh        (Extended)
  /hda5  83h  Ext3   (RedHat的 / 分区)
  /hda6  83h  Ext3   (Turbo的 / 分区)
  /hda7  0bh  FAT32  (Windows的D盘)
  /hda8  0bh  FAT32  (Windows的E盘)
  /hda9  82h       (Linux共用的swap分区)

Trivial, if /dev/hda2 is your /boot, then it refers to the first sector of /dev/hda2

根据你这句话的理解确实是在 "the first sector" 上,但你有个前提,就是在已经单独划分出一个 /boot 的分区上。问题是你也看到了,我都没有为两个 Linux 单独划出 boot 分区。请问,在这种情况下 LILO或GRUB 还会不会装在 / 的 "the first sector" 上?假如是的话,那为什么会跑到 MBR 上去呢?是由于你后面所说的是 Installer 的原因?

System Commander 确实是一个商业软件,我用它已经有好几年了,没觉得它有什么不足之处。我现在之所以还不敢改用 LILO或GRUB 就是因为对它们还不熟,万一出了故障不好恢复,这也是我想让 System Commander 和 LILO或GRUB 共存的原因,等先把 LILO或GRUB 弄熟了再说。另外还有一点就是我认为 LILO或GRUB 的功能没有 System Commander 强大(当然,和我现在对它不熟也有关系)当我把 GRUB 安装好后,它的启动菜单中只有它自己和  Windows 两项选择,对 DOS 和 UNIX 居然不认?!或许可以通过手工添加的方式把这两项加进去,但这也足以说明了 GRUB 不如 System Commander。

另外,本人的英语不是很好,请问你的 "distro-specific" 是什么意思?我查了翻译软件也查不到,望能告之,谢谢。
回复 支持 反对

使用道具 举报

发表于 2005-9-13 21:51:35 | 显示全部楼层
Post by DOSforever
首先,感谢d00m3d认真仔细的回复。

现在我恢复了 System Commander 启动管理以后 Linux 进不去了,这是我手工写的分区的大致情况:

  /hda1  06h  FAT16  (DOS)
  /hda2  63h       (UNIX)
  /hda3  0ch  FAT32  (indows)
  /hda4  0fh        (Extended)
  /hda5  83h  Ext3   (RedHat的 / 分区)
  /hda6  83h  Ext3   (Turbo的 / 分区)
  /hda7  0bh  FAT32  (Windows的D盘)
  /hda8  0bh  FAT32  (Windows的E盘)
  /hda9  82h       (Linux共用的swap分区)


根据你这句话的理解确实是在 "the first sector" 上,但你有个前提,就是在已经单独划分出一个 /boot 的分区上。问题是你也看到了,我都没有为两个 Linux 单独划出 boot 分区。请问,在这种情况下 LILO或GRUB 还会不会装在 / 的 "the first sector" 上?假如是的话,那为什么会跑到 MBR 上去呢?是由于你后面所说的是 Installer 的原因?
The partition layout is more clear now.

In your case, the first sector of /boot in your RedHat is hda5 while the first sector of /boot in your Turbo is hda6.  It is because, /boot resides in / for either distro.

Why MBR in your case? Sorry, I have no ideas.

BTW, your partition layout is rather messy.  Try to make a better layout in future, if possible.
System Commander 确实是一个商业软件,我用它已经有好几年了,没觉得它有什么不足之处。我现在之所以还不敢改用 LILO或GRUB 就是因为对它们还不熟,万一出了故障不好恢复,这也是我想让 System Commander 和 LILO或GRUB 共存的原因,等先把 LILO或GRUB 弄熟了再说。另外还有一点就是我认为 LILO或GRUB 的功能没有 System Commander 强大(当然,和我现在对它不熟也有关系)当我把 GRUB 安装好后,它的启动菜单中只有它自己和  Windows 两项选择,对 DOS 和 UNIX 居然不认?!或许可以通过手工添加的方式把这两项加进去,但这也足以说明了 GRUB 不如 System Commander。
GRUB can be used to boot DOS and UNIX. I highly recommend you read and learn more details about the LILO or GRUB bootloaders before making this conclusion.

Although I have never used System Commander before, to my understanding, SC is an old product that released to the market many years ago.  Long before the invention of USB devices.  So, can you install SC to the MBR of a USB HDD? If not, you cannot say "足以说明了 GRUB 不如 System Commander"
另外,本人的英语不是很好,请问你的 "distro-specific" 是什么意思?我查了翻译软件也查不到,望能告之,谢谢。
My apologies!  I am not good in Chinese typing.

First of all, "distro" is the alias for "distribution". i.e. 发行版. So, "distro-specific" means the features that are special for certain distributions.

Therefore, I am saying there are no special features that LILO and GRUB are specific to a certain distribution.  In other words, usage of LILO and GRUB are the same for all distributions. Clear?
回复 支持 反对

使用道具 举报

发表于 2005-9-14 10:20:14 | 显示全部楼层
system command用起来比价费劲
个人感觉这样的,
当时带数据分区从早上6点,到晚上12:00停电,都还没有弄完,我都傻了
后来用过PQmagic,好一点,不过这个不带引导的,只是分区工具,
现在用grub引导的,有段时间用过lilo,
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表