When you face /boot partition full issue on your Centos server like this:
Then you will need to remove the old kernels from the server.
You can find the current kernel version of your system using the following command:
OR
You can list all kernel versions installed on your system using the following command:
You need to install yum-utils using the following command, It's a collection of utilities, plugins and examples related to the yum package manager.
After that you can use one of these utilities is package-cleanup which is use to delete old kernels as shown below, the count flag is used to specify the number of kernels you want to leave on the system.
Now, you can see that the /boot partition disk usage showing normal.
Thats it.
Code:
/dev/md1 488M 463M 72M 99% /boot
You can find the current kernel version of your system using the following command:
Code:
# uname -sr Linux 3.10.0-327.10.1.el7.x86_64
Code:
[root@host boot]# rpm -qa kernel |sort -V |tail -n 1 kernel-3.10.0-327.10.1.el7.x86_64
You can list all kernel versions installed on your system using the following command:
Code:
[root@host boot]# rpm -q kernel kernel-3.10.0-327.22.2.el7.x86_64 kernel-3.10.0-514.2.2.el7.x86_64 kernel-3.10.0-514.6.2.el7.x86_64 kernel-3.10.0-693.2.2.el7.x86_64 kernel-3.10.0-693.11.1.el7.x86_64
Code:
yum install yum-utils
Code:
[root@host boot]# package-cleanup --oldkernels --count=2 Loaded plugins: fastestmirror --> Running transaction check ---> Package kernel.x86_64 0:3.10.0-327.22.2.el7 will be erased ---> Package kernel.x86_64 0:3.10.0-514.2.2.el7 will be erased ---> Package kernel.x86_64 0:3.10.0-514.6.2.el7 will be erased --> Finished Dependency Resolution Dependencies Resolved ========================================================================================================================================================================= Package Arch Version Repository Size ========================================================================================================================================================================= Removing: kernel x86_64 3.10.0-327.22.2.el7 @updates 136 M kernel x86_64 3.10.0-514.2.2.el7 @updates 148 M kernel x86_64 3.10.0-514.6.2.el7 @updates 148 M Transaction Summary ========================================================================================================================================================================= Remove 3 Packages Installed size: 431 M Is this ok [y/N]: y Downloading packages: Running transaction check Running transaction test Transaction test succeeded Running transaction Warning: RPMDB altered outside of yum. Erasing : kernel.x86_64 1/3 Erasing : kernel.x86_64 2/3 Erasing : kernel.x86_64 3/3 Verifying : kernel-3.10.0-327.22.2.el7.x86_64 1/3 Verifying : kernel-3.10.0-514.2.2.el7.x86_64 2/3 Verifying : kernel-3.10.0-514.6.2.el7.x86_64 3/3 Removed: kernel.x86_64 0:3.10.0-327.22.2.el7 kernel.x86_64 0:3.10.0-514.2.2.el7 kernel.x86_64 0:3.10.0-514.6.2.el7 Complete! [root@host boot]#
Code:
/dev/md1 488M 203M 259M 44% /boot
Thats it.