Ubuntu03 Oct 2017 12:43 pm

I’ve recently been looking at issues regarding separate /boot partitions and people running out of free space. Being a long time user of Ubuntu and LVM, I have a /boot partition that was appropriately sized for kernel of the release I installed (Ubuntu 13.04!), but now that I’m running Artful Aardvark, which will become Ubuntu 17.10, my /boot partition is a bit small.

I don’t have any extraneous files in my /boot partition, like .old-dkms files (being worked in bug 1515513) or old kernels. So I need some solution to make the files that are there take up less space. Fortunately, it is possible to choose the compression method used by update-initramfs when it makes initrd images. The default “COMPRESS=gzip” can be found in /etc/initramfs-tools/initramfs.conf.

Because configuration options are also read from /etc/initramfs-tools/conf.d/ and after the initial initramfs.conf file I decided to create a file named “compressed” in that directory with the contents:


After which I needed to update the initrd.img files in my /boot partition. I can do this with:

sudo update-initramfs -u -k all

Its easy to confirm the compression method used:

$ file /boot/initrd.img-4.12.0-13-generic
/boot/initrd.img-4.12.0-13-generic: XZ compressed data

Now I’ve managed to create some more free space in my /boot partition, however it may take a bit longer for update-initramfs to run and may increase boot time a little. That sounds better than reinstalling though!

It is also worth noting that a follow on error from update-initramfs failing due to a lack of free space in boot is that it leaves extra files in /var/tmp/. Thanks to the reporter of bug 1713004 for pointing this out.

3 Responses to “Creating more free space in /boot”

  1. on 05 Oct 2017 at 8:28 am Robert Jennings

    If you have a system with limited RAM (i.e. a small cloud instance with 256MB RAM) you might need to limit xz’s memory usage to prevent the kernel OOM (out of memory) killer from killing processes.

    To limit memory usage, place the following in the same file as the “COMPRESS=xz” directive:


  2. […] http://www.murraytwins.com/blog/?p=156 […]

  3. on 22 Oct 2017 at 1:25 am matttbe

    Thank you for the idea! I am also a long time user of Ubuntu and LVM.

    I accelerated ‘update-initramfs’ execution time by replacing:




    (pxz package is needed of course).

Trackback this Post | Feed on comments to this Post

Leave a Reply