dracut一, 01/03/2021 - 17:43 的修訂版本

修訂版本可以讓你追蹤文章的多個版本的不同之處。

最後更新: 2021-03-01

介紹

dracut - low-level tool for generating an initramfs/initrd image

 


"dracut" Usage

 

dracut [OPTION...] [image [kernel-version]]

 * kernel-version 係對應 /lib/modules 內的 folder

 * If kernel version is omitted, then the version of the actual running kernel is used.

 * If <image> isomitted or empty, then the default location /boot/initramfs-<kernel version>.img is used.

 


# To see the contents of the image created by dracut

lsinitrd | less

#  To display the contents of a file in the initramfs

lsinitrd -f /etc/ld.so.conf

# To see a list of available dracut modules, use the --list-modules option:

dracut --list-modules

# Omitting dracut Modules

dracut -o "multipath lvm" no-multipath-lvm.img

# Adding Kernel Modules

# 亦可以在 /etc/dracut.conf 或 /etc/dracut.conf.d/myconf.conf 設定

dracut --add-drivers mymod initramfs-with-mymod.img

# To get a quick start for the suitable kernel command line on your system

dracut --print-cmdline