I am trying to install a new kernel on Ubuntu Server and I am unable to complete it due to a "gzip: stdout: no space left on device" error. The full error was produced after running sudo make modules_install install:

  INSTALL /lib/firmware/cpia2/stv0672_vp4.bin
  INSTALL /lib/firmware/yam/1200.bin
  INSTALL /lib/firmware/yam/9600.bin
  DEPMOD  3.16.0
sh ./arch/x86/boot/install.sh 3.16.0 arch/x86/boot/bzImage \
    System.map "/boot"
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.16.0 /boot/vmlinuz-3.16.0
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.16.0 /boot/vmlinuz-3.16.0
update-initramfs: Generating /boot/initrd.img-3.16.0

gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-3.16.0 with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
make[1]: *** [install] Error 1
make: *** [install] Error 2

I checked the disk space using df -h and here is the output:

Filesystem                   Size  Used Avail Use% Mounted on
/dev/mapper/server--vg-root  103G   33G   66G  34% /
none                         4.0K     0  4.0K   0% /sys/fs/cgroup
udev                          63G  4.0K   63G   1% /dev
tmpfs                         13G  1.8M   13G   1% /run
none                         5.0M     0  5.0M   0% /run/lock
none                          63G  148K   63G   1% /run/shm
none                         100M   24K  100M   1% /run/user
/dev/sda1                    236M   62M  162M  28% /boot
/home/stan/.Private          103G   33G   66G  34% /home/stan

I don't understand why this error is being produced given the amount of space. I have successfully used the exact same procedure on both Debian and OpenSUSE.


"make modules_install install" tries to build initrd image on /boot partition, which has 162 megabytes free, which is simply not enough.

If you want to compile kernel yourself on Ubuntu, you need to prepare at least 1GB free space on /boot partition.

  • Thank you for the answer. How can I resize the partition when logged into terminal? I tried to increase the space using resize2fs however it did not allow me to. Sorry, I have been using Linux only a few weeks. – Greg Jul 30 '15 at 8:35
  • You probably can't, since right after /boot partition you have / partition. But you can create another /boot partition, eg. on another disk on pen drive. Or you can simply create a temporary file on / partition, format it as temporary /boot partition, and mount it to /boot just for the moment of compiling kernel, copying initrd image to "real" /boot partition right after compiling and installing everything. – Tomasz Klim Jul 30 '15 at 8:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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