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