Redian新闻
>
问个一直没弄明白的initrd/initramfs问题
avatar
问个一直没弄明白的initrd/initramfs问题# Linux - Linux 操作系统
V6
1
文档里说,initrd/initramfs的目的是在真正的rootfs没有mount之前,kernel从这个
小型的文件系统里面加载必要的驱动程序,这样方便kernel mount真正的rootfs,继续
引导。那么问题来了:比方说我的台式机,grub的参数里面说明了initramfs的image在
/boot下,而/boot目录本身就被我放在了rootfs里面,没有单独分区,这样说来想要读
取initramfs本身的前提条件就是要mount rootfs,那从我的例子来说,岂不是
initramfs是多次一举?而且,甚至连kernel image vmlinuz本身也都是在rootfs里面
的,这不是说明其实grub自己本身已经知道了该如何mount/read rootfs?
avatar
x*g
2
boot loader access the file system differently.
for kernel to access any FS, the FS need to be mounted.
but boot loader doesn't rely on kernel mounting mechanism.

【在 V6 的大作中提到】
: 文档里说,initrd/initramfs的目的是在真正的rootfs没有mount之前,kernel从这个
: 小型的文件系统里面加载必要的驱动程序,这样方便kernel mount真正的rootfs,继续
: 引导。那么问题来了:比方说我的台式机,grub的参数里面说明了initramfs的image在
: /boot下,而/boot目录本身就被我放在了rootfs里面,没有单独分区,这样说来想要读
: 取initramfs本身的前提条件就是要mount rootfs,那从我的例子来说,岂不是
: initramfs是多次一举?而且,甚至连kernel image vmlinuz本身也都是在rootfs里面
: 的,这不是说明其实grub自己本身已经知道了该如何mount/read rootfs?

avatar
x*u
3
不仅仅是initrd,光加载kernel时也有一样的问题。bootloader必须有本事自己找到他
们,不经过linux系统。

【在 V6 的大作中提到】
: 文档里说,initrd/initramfs的目的是在真正的rootfs没有mount之前,kernel从这个
: 小型的文件系统里面加载必要的驱动程序,这样方便kernel mount真正的rootfs,继续
: 引导。那么问题来了:比方说我的台式机,grub的参数里面说明了initramfs的image在
: /boot下,而/boot目录本身就被我放在了rootfs里面,没有单独分区,这样说来想要读
: 取initramfs本身的前提条件就是要mount rootfs,那从我的例子来说,岂不是
: initramfs是多次一举?而且,甚至连kernel image vmlinuz本身也都是在rootfs里面
: 的,这不是说明其实grub自己本身已经知道了该如何mount/read rootfs?

avatar
j*p
4
The key benefit of initrd is not filesystem mounting. It is device driver.
Under linux, different disks need different drivers, and the kernel has to
load them correctly. Without initrd, this could easily go into a checken/egg
problem, kernel needs the driver to access the disk, but it need to acces
the disk first in order to load the driver.
What grub does is to use the universal block device driver - BIOS. Grub
loads the kernel and initrd through BIOS support, which generally provides
worse pe

【在 V6 的大作中提到】
: 文档里说,initrd/initramfs的目的是在真正的rootfs没有mount之前,kernel从这个
: 小型的文件系统里面加载必要的驱动程序,这样方便kernel mount真正的rootfs,继续
: 引导。那么问题来了:比方说我的台式机,grub的参数里面说明了initramfs的image在
: /boot下,而/boot目录本身就被我放在了rootfs里面,没有单独分区,这样说来想要读
: 取initramfs本身的前提条件就是要mount rootfs,那从我的例子来说,岂不是
: initramfs是多次一举?而且,甚至连kernel image vmlinuz本身也都是在rootfs里面
: 的,这不是说明其实grub自己本身已经知道了该如何mount/read rootfs?

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。