Is "update-initramfs -u" needed after adding or removing a module with "modprobe"?

37,620

I guess this is about some Linux distribution that is part of the Debian/Ubuntu family, as update-initramfs is part of Debian initramfs-tools.

If the module (and the command to load it) is included in initramfs, then update-initramfs -u is needed: if you don't do it, initramfs will still contain the old state (= old version of the module and the command to load it).

If you are uncertain whether or not the module is included in initramfs, use the lsinitramfs command to view the contents of your initramfs. For example:

$ lsinitramfs /boot/initrd.img-4.9.0-5-amd64 |less

However, running update-initramfs -u should generally never hurt, so if you are uncertain, you can just run it to err on the safe side.

Share:
37,620

Related videos on Youtube

Kayofeld
Author by

Kayofeld

Updated on September 18, 2022

Comments

  • Kayofeld
    Kayofeld almost 2 years

    Most instructions that I find online about adding or replacing kernel modules in Ubuntu only mention modprobe and rmmod. However, according my experience with e1000e, the modification is reverted after reboot unless I do update-initramfs -u afterwards. The man page of update-initramfs does not mention modules.

    So, is it always necessary to run update-initramfs -u after replacing kernel modules if I want to have the modified kernel after reboot?