Linux command
update-initramfs 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
Create
sudo update-initramfs -c -k [kernel_version]
Create
sudo update-initramfs -c -k all
Update
sudo update-initramfs -u
Remove
sudo update-initramfs -d -k [kernel_version]
说明
update-initramfs manages the initial RAM filesystem (initramfs) images used during Linux boot. The initramfs contains essential drivers and scripts needed to mount the root filesystem. This tool is typically used after installing new kernel modules, changing boot configuration, or when the initramfs becomes corrupted. It uses initramfs-tools on Debian-based systems.
参数
- -c
- Create a new initramfs
- -u
- Update an existing initramfs
- -d
- Delete an existing initramfs
- -k _version_
- Specify kernel version (default: latest). Use "all" for all versions.
- -t
- Take over a custom initramfs with a newer one.
- -v
- Verbose mode
- -b _directory_
- Set alternate boot directory
- -h, --help
- Print help and exit.
- --version
- Print version of the underlying initrd generation tool.
FAQ
What is the update-initramfs command used for?
update-initramfs manages the initial RAM filesystem (initramfs) images used during Linux boot. The initramfs contains essential drivers and scripts needed to mount the root filesystem. This tool is typically used after installing new kernel modules, changing boot configuration, or when the initramfs becomes corrupted. It uses initramfs-tools on Debian-based systems.
How do I run a basic update-initramfs example?
Run `sudo update-initramfs -c -k [kernel_version]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -c do in update-initramfs?
Create a new initramfs