Issue
No free space in /boot partition. Getting message "Boot partition is full".
Environment
CloudLinux OS 6
CloudLinux OS 7
Solution
The error appears for different reasons. For example, you have a separate boot partition, and something went wrong during the kernel uninstall process, so vmlinuz and initramfs files were not removed.
First of all, you need to check the kernels which are already installed on your system by running the # rpm -q kernel
, for example:
# rpm -q kernel kernel-2.6.32-954.3.5.lve1.4.61.el6.x86_64 kernel-2.6.32-954.3.5.lve1.4.59.el6.x86_64 kernel-2.6.32-954.3.5.lve1.4.63.el6.x86_64
command, and then compare the output with the actual content of /boot partition:
# ls -la /boot
total 108956
dr-xr-xr-x. 4 root root 4096 Oct 29 19:31 . dr-xr-xr-x. 25 root root 4096 Oct 29 19:29 .. -rw-r--r--. 1 root root 109010 Sep 6 06:33 config-2.6.32-954.3.5.lve1.4.71.el6.x86_64 -rw-r--r--. 1 root root 109010 Sep 19 05:45 config-2.6.32-954.3.5.lve1.4.72.el6.x86_64 -rw-r--r-- 1 root root 149026 Oct 2 09:15 config-3.10.0-962.3.2.lve1.5.26.7.el6h.x86_64 drwxr-xr-x. 3 root root 4096 Oct 17 2018 efi drwxr-xr-x. 2 root root 4096 Oct 29 19:29 grub -rw-------. 1 root root 20054199 Sep 23 14:21 initramfs-2.6.32-954.3.5.lve1.4.71.el6.x86_64.img -rw-------. 1 root root 20054014 Oct 3 11:11 initramfs-2.6.32-954.3.5.lve1.4.72.el6.x86_64.img -rw------- 1 root root 35678685 Oct 29 19:20 initramfs-3.10.0-962.3.2.lve1.5.26.7.el6h.x86_64.img -rw------- 1 root root 5003790 Oct 4 09:04 initrd-2.6.32-954.3.5.lve1.4.71.el6.x86_64kdump.img -rw------- 1 root root 5509691 Oct 29 19:31 initrd-3.10.0-962.3.2.lve1.5.26.7.el6h.x86_64kdump.img
If you see that files initrafs-* or vmlinuz-* does not match the $KVERSION (where $KVERSION
is the version of the installed CloudLinux kernel), then you can safely delete those files manually.
Alternatively, you execute the next commands:
First, ensure you have yum-utils installed:
# yum install yum-utils
Then:
package-cleanup --oldkernels --count=3
or
package-cleanup --oldkernels --count=2
After performing one of the commands above, all old kernels will be removed, except for 2/3 last ones.
You can automate this process by adding "installonly_limit=3 (or 2) " to yum.conf; during the next kernel update, old kernels will be removed (except for 2\3 last ones).
For CloudLinux 8, you can use this command instead:
dnf --oldinstallonly remove kernel
The command will remove the old kernels and their components, keeping only the latest and the running kernel.
IMPORTANT NOTE
We don't recommend leaving only one kernel on the server; 2-3 kernels should be always installed on the server.
Comments
0 comments
Please sign in to leave a comment.