Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
    
You can't reduce the size of the kernel. You will have to enlarge your boot partition. See askubuntu.com/questions/126153/how-to-resize-partitions and askubuntu.com/questions/24027/… –  Takkat May 24 '13 at 8:33
    
Thanks for the comment. My situation for enlarging the boot partition is particularly complicated - /dev/md0 is raid1 /boot partition at 96MB - /dev/md1 is raid1 hosting LVM2 partitions containing the rest of the system. I have no idea how to reduce the size of /dev/md1 to make more room for /dev/md0 in this scenario –  nwaltham May 24 '13 at 8:56
    
I am using grub2 - I guess the only potential option to explore is /boot inside the lvm. –  nwaltham May 24 '13 at 9:04

1 Answer 1

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.

share|improve this answer
1  
For relative comparison some test results with 13.10 amd64 in a kvm virtual environment, booting to text mode. (1) Modules=most,gzip: /boot/initrd.img-3.11.0-12-generic size is 16 985 839 bytes, boots in 6.69s. (2) Modules=dep,gzip: /boot/initrd.img-3.11.0-12-generic size is 2 229 559 bytes, boots in 6.12s. (3) Modules=dep,xz: /boot/initrd.img-3.11.0-12-generic size is 1 685 916 bytes, boots in 6.26s. (4) Modules=dep,lzma: /boot/initrd.img-3.11.0-12-generic size is 1 685 872 bytes, boots in 6.35s. –  Pro Backup Feb 10 at 23:41

Your Answer

 
discard

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.