20

with my latest upgrade to Ubuntu 13.04, the initrd.img-3.8.0-21-generic file is now 32M. This is creating me problem with upgrading to newer kernels as I have /boot partition of just 96MB. What can I do to reduce the size of this file?

nwaltham
  • 561

1 Answers1

34

In /etc/initramfs-tools/initramfs.conf, set MODULES=dep instead of MODULES=most. The initrd build process will work out what modules you need rather than including a wide variety of things. Note, however, that this makes your boot process very dependent on your hardware and if you need to use a different set of hardware (in particular, drives) the initrd may not work.

Additionally you can choose a better compression algorithm, the default should still be gzip, but xz (or lzma2) is also available via COMPRESS=xz. Of course you need to have xz-utils installed. The initial compression takes longer, but decompression during boot shouldn't take much longer. Both options together may also reduce your boot time a little bit.

After setting this, run sudo update-initramfs -u -k all to have it take effect.

Zanchey
  • 443