|
发表于 2007-3-2 17:36:43
|
显示全部楼层
`stage1'
This is an essential image used for booting up GRUB. Usually, this
is embedded in an MBR or the boot sector of a partition. Because a
PC boot sector is 512 bytes, the size of this image is exactly 512
bytes.
All `stage1' must do is to load Stage 2 or Stage 1.5 from a local
disk. Because of the size restriction, `stage1' encodes the
location of Stage 2 (or Stage 1.5) in a block list format, so it
never understand any filesystem structure.
`stage2'
This is the core image of GRUB. It does everything but booting up
itself. Usually, this is put in a filesystem, but that is not
required.
'
`e2fs_stage1_5'
`fat_stage1_5'
`ffs_stage1_5'
`jfs_stage1_5'
`minix_stage1_5'
`reiserfs_stage1_5'
`vstafs_stage1_5'
`xfs_stage1_5'
These are called "Stage 1.5", because they serve as a bridge
between `stage1' and `stage2', that is to say, Stage 1.5 is loaded
by Stage 1 and Stage 1.5 loads Stage 2. The difference between
`stage1' and `*_stage1_5' is that the former doesn't understand
any filesystem while the latter understands one filesystem (e.g.
`e2fs_stage1_5' understands ext2fs). So you can move the Stage 2
image to another location safely, even after GRUB has been
installed.
While Stage 2 cannot generally be embedded in a fixed area as the
size is so large, Stage 1.5 can be installed into the area right
after an MBR, or the boot loader area of a ReiserFS or a FFS.
以上的文件都是通过block list的方式load内存中的!有了*_stage1_5 , 内存中的grub 就可以通过root命令mount相应的文件系统到内存中,然后grub可以通过kernel和initrd命令load 可爱的内核!
在Grub 的文档中有
11.2 How to specify files
There are two ways to specify files, by absolute file name and by block list.
An absolute file name resembles a Unix absolute file name, using `/' for the directory separator (not `\' as in DOS). One example is `(hd0,0)/boot/grub/menu.lst'. This means the file /boot/grub/menu.lst in the first partition of the first hard disk. If you omit the device name in an absolute file name, GRUB uses GRUB's root device implicitly. So if you set the root device to, say, `(hd1,0)' by the command root (see root), then /boot/kernel is the same as (hd1,0)/boot/kernel.
ext3是向下兼容的,有e2fs_stage1_5就可以mount ext3文件系统了,当然mount到内存的时候是以ext2文件系统的方式,所以我们一般是ro 只读的方式去访问!
如果你的kernel是在一个软raid上,grub目前只支持raid1 ! |
|