How can I increase the space on an Ubuntu Boot Partition?
When trying to install programs on my Ubuntu server but the server is not allowing me to do that because the boot partition ‘/dev/sda1’ is full.
/dev/sda1 236M 236M 0M 100% /boot
By default Ubuntu has a small /boot partition. When you have auto updates enabled this can cause some issues as newer kernels are not automatically purged. So, you will need to increase the size of the Ubuntu Boot Partition.
You can add the following to your crontab to run every Sunday night at 11:30PM to clean out old kernels. You can do so by running crontab -e as root and adding the following line at the bottom of that file.
30 23 * * 6 apt-get autoremove
You will also want to reboot every so often so newer kernels are being used and newer kernels are not causing the issues. I would suggest rebooting at your earliest convenience and running
# apt-get autoremove
to load the newest kernel and delete the older kernels already installed on your server.
However, once rebooted and the autoremove command is done more disk space will be free.
$ df -h Filesystem Size Used Avail Use% Mounted on udev 990M 4.0K 990M 1% /dev tmpfs 201M 716K 200M 1% /run /dev/dm-0 15G 1.9G 12G 14% / none 4.0K 0 4.0K 0% /sys/fs/cgroup none 5.0M 0 5.0M 0% /run/lock none 1001M 0 1001M 0% /run/shm none 100M 0 100M 0% /run/user /dev/sda1 236M 72M 152M 32% /boot
$ du -shcx /boot/*
du: cannot read directory ‘/boot/lost+found’: Permission denied