Suppose that:

  • any kernel configuration regarding initramfs (loading external initramfs support and compression)
  • No RAID or lvm used
  • rootfs uses ext4

Is it really necessary to generate a new initramfs after I recompile the same kernel?

  • 1
    Fully modular kernel and all dependencies resolved by Initramfs generator is the common approach. Alternative approach like Custom Initramfs, it's possible with non-modular kernel, or by providing dependencies in a separate file; it's just very uncommon. Feb 4, 2021 at 14:11

1 Answer 1


The initramfs contains kernel modules; so if anything has changed in the modules included in your initramfs, you need to generate a new one.

Other than that, for the same kernel version, no, you shouldn’t need to generate a new initramfs if you already have one.

  • I extracted the initramfs-5.*.image and found it only contains 4 modules while my /lib/modules contains 172 modules. Does this mean that as long as that 4 modules aren't changed, I don't need to update initramfs?
    – JiaHao Xu
    Feb 4, 2021 at 14:23
  • 1
    Yup, that’s right. Feb 4, 2021 at 14:28
  • Thx for the clearification.
    – JiaHao Xu
    Feb 4, 2021 at 14:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.