Why Does the /boot Partition Get Updated When Installing Software

bootpartition

Based on some recommendations I read online, on install of a new (Ubuntu) system, I made my /boot partition separate from / and small in size (only around 50 MB). It makes sense to me that you would only need limited files in that partition, and the boot sequence only needs so much data initial data on boot so no need (or so goes my thinking) to make it much larger.

I was surprised as I started using my system and installing software was failing due to the following (or similar) issue:

gzip: stdout: No space left on device
cpio: write error: Broken pipe
E: mkinitramfs failure cpio 1 gzip 1
update-initramfs: failed for /boot/initrd.img-3.2.0-18-generic with 1.

I have already seen this question and am planning on doing a reinstall with a larger /boot partition. My questions are:

Why does the /boot partition data get updated when I am only installing software?

obviously 50 MB is too small for my needs, so what would be a reasonable /boot partition size?

Does it even make sense to have separate boot partition? after all it could simply use all the disk space it wants in the / partition.

Best Answer

On /boot partition there are installed kernels. When you make system update if there is new kernel it is downloaded and placed in /boot. After that system creates new initrd image for this kernel and also place it in /boot.

Old kernels are not removed, so after few updates there could be few kernels and initrd images in /boot.

To clean it up check what kernel you are using (uname -a), and remove old kernels using package manager. This should remove unused kernels and initrd images, but you can check it manually.

I don't think that separate /boot partition is necessary unless you are using some weird filesystem on / other than:

The currently supported filesystem types are Amiga Fast FileSystem (AFFS), AtheOS fs, BeFS, cpio, Linux ext2/ext3/ext4, DOS FAT12/FAT16/FAT32, HFS, HFS+, ISO9660, JFS, Minix fs, nilfs2, NTFS, ReiserFS, Amiga Smart FileSystem (SFS), tar, UDF, BSD UFS/UFS2, and XFS.

Source: GNU GRUB Manual 1.99

Related Question