By default, Proxmox allocates less than 300MB to the `/boot` partition during installation. Since Proxmox updates frequently, `/boot` can quickly fill up, leading to upgrade failures. The only solution in such cases is to manually delete old kernels.
The Problem
Proxmox, being based on Debian, installs both `debian linux-image` and `pve-kernel` whenever you run `apt update && apt dist-upgrade`. These packages occupy `/boot` space, so freeing up space involves removing old versions of these kernels.
Steps to Free Up /boot Space
1. Record the Current Kernel
Note the kernel currently in use:
uname -mrs
2. List Old Kernels
Find all installed kernels:
dpkg –list | grep “linux-image”
dpkg –list | grep “pve-kernel”
3. Remove Old Kernels
Remove outdated kernels with the following command:
apt purge linux-image-$old_version
Important Notes
If Proxmox fails to update due to insufficient `/boot` space, `update-grub` will also fail. However, there’s no need to worry. Every time you run `apt purge` on an old kernel, `update-grub` will automatically execute and set the latest kernel as the default boot entry.
If you want to manually set the default kernel for the next boot, use:
grub-set-default $menuentry_id
grub-reboot $menuentry_id
Simplified Methods
To avoid constantly managing `/boot`, consider the following:
1.https://github.com/jordanhillis/pvekclean
2.During Proxmox installation, manually allocate 2GB for the `/boot` partition. This will reduce the frequency of cleanup tasks and provide a buffer for future updates.
Leave a Reply