LinuxSir.cn,穿越时空的Linuxsir!

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

啥是initrd解释[redhat官方的解释]

[复制链接]
发表于 2005-4-23 17:07:09 | 显示全部楼层 |阅读模式
摘录自redhat.com上,有本人亲自翻译
有疑问的朋友请跟贴

What is an initrd?  啥是initrd?

Resolution:An initrd image is an initial RAM disk image that contains configuration and
kernel modules required at boot time.

解释:initrd.img 是一个初始化的ram disk 它包含了在启动时要用到的配置文件和内核驱动模块

The initial RAM disk image file is created when a kernel is installed and is located in
the /boot directory. The files are named 'initrd-<kernel version>.img'. When multiple
kernels are installed, each kernel will have it's own initial RAM disk image.

ram disk image在内核创建时建立,它并且位于/boot目录下,文件名为"initrd-"内核版本".img
如果存在多个内核,那他们有自己的ram disk image


At boot time the kernel and the initrd image are loaded into memory by the system
motherboards Basic Input Output System (BIOS). The BIOS locates the kernel and the
initrd image files on a disk drive by reading the Master Boot Record, located in the
first 512 bytes of the boot disk. The Master Boot Record (MBR) generally will contain
information required to locate the kernel and initial RAM disk files. In Red Hat
Linux the boot loader (Either GRUB or LILO) sets up the MBR.
启动时,内核和initrd.img由系统BIOS调入内存,BIOS通过读入MBA来判定内核和initrd.img的所在,
MBA中包含了,确定内核和ramdisk位置的信息,REDHAT一般使用lilo或grub做MBA

The kernel mounts the initial RAM disk image as a temporary root filesystem (/), and
loads the needed kernel modules to continue with the rest of the boot process.

内核加载初始化的ram disk image作为临时的根文件系统(/) 并且加载以后启动过程中所需要的
模块
It is important to note that the BIOS controls all of the system's hardware and
attached devices until the kernel is ready to take over. All access to the installed
disk drives is done by the BIOS until the BIOS hands control of the hardware to the
kernel.

很重要的一点是,在内核接管控制权前,是有系统BISO控制系统的硬件和其它外设.所有对磁盘
驱动器的访问也由BIOS控制

Until the BIOS hands over control of the hardware, the kernel at this stage has never
accessed or read from any disk drives, only from the initial RAM disk image in memory.

在BIOS控制阶段,内核并没有从磁盘上读入内存,仅仅只有ram disk image读入到内存

The initial RAM disk image must contain kernel modules that will allow the kernel to
access the root file system, so that the rest of the boot process can continue. The
standard Red Hat kernel is capable of using most IDE controllers and accessing most
IDE disks without additional kernel modules, so the initial RAM disk image on such a
system will most likely only have the kernel modules needed to read the type of
filesystem that is on.

初始化的ram disk必须包含能访问文件系统的内核模块,以保证以后启动的顺利进行.标准的
REDHAT内核不需要加载另外的模块下就能认出大多数的IDE磁盘,所以在这种情况下,ram disk
image的重要作用是对文件系统访问的支持

Systems that have the root filesystem on SCSI or RAID devices, or some other device
will need to have additional kernel modules present in the initial RAM disk image to
be able to access these devices.

对于根系统在SCSI或RAID磁盘上的,就需要ram disk image包含另外的模块来使内核能访问
这些设备

Once the kernel has loaded all the modules needed from the initial RAM disk image,
and has mounted the real root filesystem from the disk drive, the kernel performs what
is known as a 'pivot root'. This replaces the temporary root filesystem of the initial
RAM disk with the real root filesystem. The rest of the boot process can now continue
by reading the root filesystem from the disk drive.

一旦,内核从ram disk中加载了所需要的所有模块后,并且这时挂载了正宗的根系统时候,此时的
根叫做"核心,轴心根",用这个真正的根替换了由ram disk生成的临时根.在读出了根文件系统后,
剩下的过程就由磁盘上的INIT控制了
发表于 2005-4-23 23:08:31 | 显示全部楼层
启动时,内核和initrd.img由系统BIOS调入内存,BIOS通过读入MBA来判定内核和initrd.img的所在,
MBA中包含了,确定内核和ramdisk位置的信息,REDHAT一般使用lilo或grub做MBA

这里应该是 MBR 还有这句中内核就直接写作 kernel 比较好吧(个人建议)
最后一句应该是 在REDHAT中引导装入程序(或者grub或者lilo)用来设定MBR

很重要的一点是,在内核接管控制权前,是有系统BISO控制系统的硬件和其它外设.所有对磁盘
驱动器的访问也由BIOS控制

这里偶觉得应该
这里需要声明很重要的一点,BIOS控制着所有系统硬件和外设直到内核准备好接管控制权,在这之前所有对磁盘驱动器的访问也是由BIOS控制的
Until the BIOS hands over control of the hardware, the kernel at this stage has never
accessed or read from any disk drives, only from the initial RAM disk image in memory.

在BIOS控制阶段,内核并没有从磁盘上读入内存,仅仅只有ram disk image读入到内存

在BIOS控制硬件阶段,内核并不会访问或者说读取任何磁盘,而仅仅访问内存初始化的RAM disk image
The initial RAM disk image must contain kernel modules that will allow the kernel to
access the root file system, so that the rest of the boot process can continue. The
standard Red Hat kernel is capable of using most IDE controllers and accessing most
IDE disks without additional kernel modules, so the initial RAM disk image on such a
system will most likely only have the kernel modules needed to read the type of
filesystem that is on.

初始化的ram disk必须包含能访问文件系统的内核模块,以保证以后启动的顺利进行.标准的
REDHAT内核不需要加载另外的模块下就能认出大多数的IDE磁盘,所以在这种情况下,ram disk
image的重要作用是对文件系统访问的支持

初始化的RAM disk必须包含允许内核访问root文件系统的内核模块,以保证接下来的启动顺利进行。标准的
REDHAT内核不需要加载另外的模块下就能使用大部分IDE控制器并访问大多数的IDE磁盘。所以在这样的系统中的初始化RAM disk image仅仅包含能够读取该系统上的文件系统的内核模块。
Systems that have the root filesystem on SCSI or RAID devices, or some other device
will need to have additional kernel modules present in the initial RAM disk image to
be able to access these devices.

对于根系统在SCSI或RAID磁盘上的,就需要ram disk image包含另外的模块来使内核能访问
这些设备

对于根文件系统在SCSI或者RAID或者其他类型设备上的系统,就需要初始化RAM disk image包含另外的内核模块以使其能够访问这些设备。

Once the kernel has loaded all the modules needed from the initial RAM disk image,
and has mounted the real root filesystem from the disk drive, the kernel performs what
is known as a 'pivot root'. This replaces the temporary root filesystem of the initial
RAM disk with the real root filesystem. The rest of the boot process can now continue
by reading the root filesystem from the disk drive.

一旦,内核从ram disk中加载了所需要的所有模块后,并且这时挂载了正宗的根系统时候,此时的
根叫做"核心,轴心根",用这个真正的根替换了由ram disk生成的临时根.在读出了根文件系统后,
剩下的过程就由磁盘上的INIT控制了

一旦内核从初始化RAM disk image中加载了所需要的所有模块并且从磁盘上挂载了真正的根文件系统后,内核就扮演了所谓的"pivot root(这个称呼没有听说过,不知道怎么翻译)"。这个真正的根文件系统将替换由初始化RAM disk 生成的临时根文件系统。现在下面的引导过程通过读取硬盘上的根文件系统就得以顺利进行了。


上面是我根据我的理解写的,不一定准确,纯粹个人喜好:)
回复 支持 反对

使用道具 举报

发表于 2005-4-24 04:57:47 | 显示全部楼层
楼主的翻译有些误导啊。
bios只会装入MBR这一小段程序,然后执行它。其它的动作已经不是bios做决定了。
回复 支持 反对

使用道具 举报

发表于 2005-4-24 14:26:12 | 显示全部楼层
Post by abby

bios只会装入MBR这一小段程序,然后执行它。其它的动作已经不是bios做决定了。

不错!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-4-24 15:35:31 | 显示全部楼层
感谢各位兄弟对我指正   zhy2111314 兄翻译的更漂亮些,但最重要我觉得要忠于原文的意思,有翻的和原文有出入的还望指正
回复 支持 反对

使用道具 举报

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

本版积分规则

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