Contents
What kind of file system does initramfs use?
An initramfs is an initial ram file system based on tmpfs (a size-flexible, in-memory lightweight file system), which also did not use a separate block device (so no caching was done and all overhead mentioned earlier disappears).
How to install the Dracut utility in initramfs?
To install the Dracut utility, run: The next step is to configure dracut by editing /etc/dracut.conf. In the configuration file, which is well commented, in order to add support for needed modules.
How to use genkernel for generating an initramfs?
To use genkernel for generating an initramfs, it is recommended all necessary drivers and code that is needed to mount the / and /usr file systems be included in the kernel (not as modules). Then, call genkernel as follows:
How to add support for fake hardware RAID in initramfs?
Then, call genkernel as follows: Depending on the system, one or more of the following options may be needed: Add support for fake hardware RAID. Add in firmware code found on the system. Add in GnuPG support. Add support for iSCSI. Add support for LUKS encryption containers. Add support for LVM. Add support for software RAID.
Which is better ramfs or initramfs in Linux?
This has the memory efficiency advantages of initramfs (no ramdisk block device) but the separate packaging of initrd (which is nice if you have non-GPL code you’d like to run from initramfs, without conflating it with the GPL licensed Linux kernel binary). It can also be used to supplement the kernel’s built-in initramfs image.
Why does Linux treat the RAMDISK as a block device?
Linux is designed to cache all files and directory entries read from or written to block devices, so Linux copies data to and from the ramdisk into the “page cache” (for file data), and the “dentry cache” (for directory entries). The downside of the ramdisk pretending to be a block device is it gets treated like a block device.
Do you need root access to initramfs file?
Run “usr/gen_init_cpio” (after the kernel build) to get a usage message documenting the above file format. One advantage of the configuration file is that root access is not required to set permissions or create device nodes in the new archive.