5 ms·
True or false: An initrd (cf. initramfs) is still required, where "rd" stands for ramdisk. As a BSD user, I prefer to use a mfs root (ramdisk) for personal rea
by textmode 8y ago
True or false: An initrd (cf. initramfs) is still required, where "rd" stands for ramdisk.
As a BSD user, I prefer to use a mfs root (ramdisk) for personal reasons, but AFAIK BSD has never required a ramdisk in order to boot.
If I recall correctly Linux needed to use a ramdisk in its early days. Is this still true today?
- jschwartzi 8y agoNo, neither are required. initrd is obsolete and has been replaced by initramfs.
- kijiki 8y agoEarly on, Linux supported initrd, which was just a ramdisk with a FS image written to it and mounted. Later, initramfs came along, which is all anyone uses anymore. It is a cpio archive that is extracted onto a special form of tmpfs. One neat trick is that you can append multiple cpio archives, and the kernel will expand them one after another, so you can easily customize your distro-provided initramfs. Only the first one can be compressed, and you have to be careful about it getting overwritten by a kernel update, but it is handy for quick experiments. There is also pivot_root and switch_root, which have man pages if you're interested in the gory details. For all of initrd/initramfs's history, you've only needed one if your monolithic kernel couldn't mount the root filesystem. So if you needed a module, or had some special config that needed to happen that the kernel couldn't do internally.
- ajross 8y agoLinux has never needed a ramdisk. If it's built with drivers for the boot device and it probes in an unambiguous manner, you can pass root=/dev/whatever99. That's as true today as it was in 1992.
- deleted 8y ago[deleted]
- checkyoursudo 8y agoI pass root=PARTUUID=whatever to be safe, but yes this is how I boot an efi stub kernel directly with no rd/initramfs. Just need to, for example, build the block device driver for the root disk into the kernel instead of a module.
- exDM69 8y agoAn initramfs image is not required if you can mount root directly and don't have any drivers or firmware that need to be up before the real init. Some of these can also be bundled in the kernel image, but an initramfs makes things so much more flexible.
- textmode 8y agoIt is not necessary, but it is enabled by default. False?