initramfs

  1. kernel-core 套件安裝產生的 initramfs 檔會載入目前主機的硬體需要的驅動程式,當完全複製或換開機硬碟到其他電腦,有可能缺驅動程式而無法開機。
  2. 系統要製成image檔,不以安裝方式建立系統,而是直接移機,面對未知多變的硬體設定,建議重新產生initramfs。
  3. dracut 命令選項 –hostonly 表示只載入目前主機所需的驅動,反之,選項 —no-hostonly 則關閉 Host-Only 模式,也就示會載入所有驅動。
    [root@msi ~]# dracut --help | grep hostonly
      -H, --hostonly        Host-Only mode: Install only what is needed for
      -N, --no-hostonly     Disables Host-Only mode
      --hostonly-mode <mode>
                            Specify the hostonly mode to use. <mode> could be
                            In "sloppy" hostonly mode, extra drivers and modules
      --hostonly-cmdline    Store kernel command line arguments needed
      --no-hostonly-cmdline Do not store kernel command line arguments needed
      --no-hostonly-default-device
      --hostonly-i18n       Install only needed keyboard and font files according
      --no-hostonly-i18n    Install all keyboard and font files available.
      --hostonly-nics [LIST]
    
  4. dracut 以 –no-hostonly 模式重新產生目前開機核心版本的 initramfs。
    [root@deyu ~]# dracut -N initramfs-`uname -r`.img `uname -r`
    
  5. dracut 以 –add-drivers 選項加入 usb 碟驅動程式,重新產生目前開機核心版本的 initramfs,這對USB開機很重要。
    [root@deyu ~]# dracut --add-drivers usb-storage initramfs-`uname -r`.img `uname -r`