هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.
ماذا يفعل The initramfs holds the drivers, LVM/RAID/crypt tools and systemd units needed to reach the root file system. dracut builds it for a kernel; by default only what this machine needs (host-only). Kernel package updates call it automatically. Rebuild it after you change storage drivers, LVM names, /etc/crypttab or module blacklists that matter at boot.
طريقة الكتابة dracut [OPTION]... [IMAGE [KERNEL-VERSION]] الأكثر استخدامًا
Basic -f, --forceOverwrite an existing image. --kver VERSIONThe kernel version (default: the running one). --regenerate-allRebuild the images of all installed kernels. -v, --verboseMore output. --list-modulesList the available dracut modules. --print-cmdlinePrint the kernel arguments for the current setup. Content -a, --add LISTAdd dracut modules (like lvm, crypt, nfs, network). --force-add LISTAdd even if not needed for this host. -o, --omit LISTLeave out dracut modules. -m, --modules LISTUse only these dracut modules. -d, --drivers LISTUse only these kernel modules. --add-drivers LISTAdd kernel modules. --force-drivers LISTAdd and load these kernel modules early. --omit-drivers LISTLeave out kernel modules. --filesystems LISTAdd file system modules. -I, --install LISTAdd these files. --install-optional LISTAdd files if they exist. -i, --include SOURCE TARGETCopy a file or folder into the image. --kernel-cmdline ARGSBuilt-in kernel arguments. --add-fstab FILE, --fstab, --mount "DEV MNT TYPE OPTS", --add-device DEVExtra mounts and devices. --mdadmconf, --nomdadmconf, --lvmconf, --nolvmconfInclude RAID / LVM config. --fscks LIST, --nofscksfsck tools to include. --early-microcode, --no-early-microcodeCPU microcode in the image. --kernel-only, --no-kernelOnly kernel modules / no kernel modules. --sshkey FILESSH key for network boot unlock. Host-only -H, --hostonlyOnly what this host needs (default on RHEL). -N, --no-hostonlyGeneric image for any hardware (rescue image). --hostonly-mode sloppy|strict, --hostonly-cmdline, --no-hostonly-cmdline, --no-hostonly-default-device, --hostonly-i18n, --no-hostonly-i18n, --hostonly-nics LIST, --persistent-policy POLICYHost-only details. Build --gzip, --bzip2, --lzma, --xz, --lzo, --lz4, --zstd, --compress PROGRAM, --no-compressCompression. --strip, --nostrip, --aggressive-strip, --hardlink, --nohardlinkSize tricks. -k, --kmoddir DIR, --fwdir DIRS, --libdirs DIRSWhere to find modules, firmware, libraries. -c, --conf FILE, --confdir DIROther config files. --tmpdir DIR, -r, --sysroot DIR, --prefix DIR, --noprefix, -l, --localBuild settings. --logfile FILE, --debugLogging. --uefi, --uefi-stub FILE, --uefi-splash-image FILEBuild a unified kernel image (UKI). --versionShow the version. لا يوجد شيء يطابق هذا الفلتر.
$ مستخدم عادي# بصلاحية root (أو مع sudo)
1 Rebuild for the running kernel Writes /boot/initramfs-$(uname -r).img.
2 For a chosen kernel نسخ # dracut -f /boot/initramfs-6.12.0-55.el10.x86_64.img 6.12.0-55.el10.x86_64From a rescue disk, take the version from ls /lib/modules.
3 All kernels نسخ # dracut -f --regenerate-all After a change that matters for every kernel.
4 Add a storage driver نسخ # dracut -f --add-drivers "nvme"When the root disk moved to another controller.
5 Generic rescue image نسخ # dracut -f -N /boot/initramfs-generic.imgBoots on other hardware (after a P2V/V2V move).
6 Make module options permanent in the image نسخ # echo "options loop max_part=8" > /etc/modprobe.d/loop.conf; dracut -f Early modules read the config from the initramfs.
7 Look inside the result Files and dracut modules in the image.
8 Available dracut modules نسخ # dracut --list-modules | head lvm, crypt, nfs, network, multipath …
9 Kernel arguments it would need نسخ # dracut --print-cmdline rd.lvm.lv=… and root=… for the current setup.
10 Back up before rebuilding نسخ # cp /boot/initramfs-$( uname -r ).img /root/initramfs.bakA safe way back.
لا يوجد شيء يطابق هذا الفلتر.
الملفات
/etc/dracut.conf, /etc/dracut.conf.d/Settings.
/boot/initramfs-VERSION.imgThe images.
/usr/lib/dracut/modules.d/dracut modules.