Linux initrd is usually used for startup. So I studied how to start Linux initrd. Here I will share it with you and hope it will be useful to you. Initrd = init ramdisk is a file system that exists in the memory at startup.
The initial purpose of Linux initrd startup is to divide kernel startup into two phases: retain the least basic startup code in the kernel, then, the support for various hardware devices is placed in the Linux initrd startup module.
In this way, you can start Linux initrd to mount the required modules in the mounted root file system. One advantage of this is that you can flexibly support different hardware by modifying the content in Linux initrd startup without changing the kernel. At the end of the startup, the root file system can be mounted to another device.
Do I have to use initrd to start Linux?
No. If you compile all the required functions into the kernel (non-module mode), you only need one kernel file. Linux initrd startup can reduce the volume of kernel startup and increase flexibility. If your kernel supports a certain file system (such as ext3 and UFS) as a module ).
When the driver modules (such as jbd) in the startup phase are placed on these file systems, the kernel cannot read the file system and therefore can only load these modules through the Virtual File System started by Linux initrd. Some people may ask: Since the kernel cannot read the file system at this time, how is the kernel file loaded into the memory? The answer is simple. Grub is file-system sensitive and can identify common file systems.
How is the Linux initrd Startup file generated? The mkinitrd command is actually a Bash script # file 'which mkinitrd '/sbin/mkinitrd: Bourne-Again shell script text executable. This script first creates an 8 m empty file, create a file system and copy the corresponding files.
A default RedHat Fedora Core 2, what is its Linux initrd startup (related to the system hardware )?
# File initrd-2.6.5-1.358.img
Initrd-2.6.5-1.358.img: gzip compressed data, from Unix, max compression
# Mv initrd-2.6.5-1.358.img initrd-2.6.5-1.358.gz
# Gzip-d initrd-2.6.5-1.358.gz
# Ll
-Rw-r -- 1 root 8192000 Jan 14 11: 32 initrd-2.6.5-1.358
# Mkdir/mnt/loop
# Mount-o loop initrd-2.6.5-1.356/mnt/loop
............ Modify the file system in the middle ............
# Umount loop
# Cd/boot
# Gzip-9 initrd-2.6.5-1.356
# Mv initrd-2.6.5-1.356.gz initrd-2.6.5-1.356.img
- Linux livna graphics card driver automatically selects the fastest Source
- Install and compile the Linux kernel upgrade Tool
- Linux uses the actual physical hard disk as the Virtual File System
- Detailed introduction to Linux hardware information commands
- Creating/home on Linux security independent partitions is a safer method.