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'm trying to update the kernel on a CentOS 6 machine with a vanilla 3.1.0-rc10 kernel. It seems to work, except the modules that get created are significantly larger in size than those that come from the distro RPM. Thats an issues, because the mkinitrd command ends up creating a initram file that is 100M (because of the some of all the modules inside) in size. Grub takes forever to load and decompress a 100M initram file at boot.

In short:

  1. I downloaded the kernel code.
  2. Copied the running kernel config from/boot/ to .config in my kernel code dir.
  3. ran make oldconfig and accepted the defaults
  4. ran make && make modules_install
  5. ran mkinitrd /boot/initramfs-3.1.0-rc10.x86_64.img 3.1.0-rc10

The resulting /boot/initramfs-3.1.0-rc10.x86_64.img is 100M in size.

Its clearly because the size of the modules is so much larger; picking the qla4xxxx you can see my compiled version is 3.6M vs the distros 116K. This is the case for all the modules.

[root@localhost ~]# ls -lh /lib/modules/2.6.32-71.el6.x86_64/kernel/drivers/scsi/qla4xxx/qla4xxx.ko
-rwxr--r--. 1 root root 116K May 19 23:37 /lib/modules/2.6.32-71.el6.x86_64/kernel/drivers/scsi/qla4xxx/qla4xxx.ko
[root@localhost ~]# ls -lh /lib/modules/3.1.0-rc10+/kernel/drivers/scsi/qla4xxx/qla4xxx.ko
-rw-r--r--. 1 root root 3.6M Oct 21 12:57 /lib/modules/3.1.0-rc10+/kernel/drivers/scsi/qla4xxx/qla4xxx.ko

I've done this before without issue; what am I overlooking here?

share|improve this question
up vote 3 down vote accepted

Run strip --strip-unneeded on the module to remove extraneous symbols. If that doesn't do it, run size on both modules to see where the difference lies. Note that this makes debugging somewhat more difficult.

share|improve this answer
I did try running strip on all the modules; but that naturally confused the hell out of depmod. I was unaware of --strip-unneeded. thanks! – tMC Oct 21 '11 at 18:28

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.