Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am currently trying to manually replace the kernel within ubuntu-core on an embedded device with a custom kernel. However when I try to update the initrd my initrd becomes much bigger.

Here is what I did:

  • Extract the initrd that was shipped with ubuntu
  • Make a list of all modules within the old initrd
  • get the same modules from the new module director at /lib/modules/new_kernel_version
  • add these modules to the initrd and remove the old ones

If I do this my initrd becomes quite bigger than the original one, so I checked the individual modules. I picked the btrfs.ko filesystem driver as an example. So by comparing these two modules I noticed the one I just picked into the initrd was much bigger, which caused the difference in size.

-rw-r--r-- 1 root root 999K Nov 14 15:06 btrfs.ko

For the btrfs.ko within the shipped initrd.

-rw-r--r-- 1 root root 7.2M Nov 14 15:08 btrfs.ko

For the new btrfs.ko.

What is different between these two modules? Could this be caused by some faulty setting for the new kernel? When producing the kernel I copied /proc/config.gz and used make oldconfig to update it, so all optimisations should be the same for both kernels.

Or is there something else which is being done to the modules before they are put into the initrd? Maybe is there even some better way to build a new initrd for the new kernel in ubuntu altogether.


I just also tested with an initrd which I created from scratch using the mkinitrfs command within ubuntu, and it has the same size difference that I found for the initrd I manually updated.

share|improve this question

Your modules have lots of symbols and debug information. The command you want is
strip --strip-unneeded.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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