Zoyinc
  • Home
  • Contact
  • Categories
    • CD Archiving
    • GIMP
    • Linux
    • MythTV
    • Open Media Vault
    • Technology
    • VMware
    • WordPress
    • YouTube
  • About


Low Disk Space on “boot”

By

Tony

,

August 10, 2019

If you have ever got this popup warning on CentOS/RedHat 7 this post may help. This happened to me and when I looked at “/boot” it looked like:

You can see there is the current kernel and three previous kernels to choose from:

CentOS Linux (3.10.0-957.27.2.el7.x86_64) 7 (Core)
CentOS Linux (3.10.0-957.21.3.el7.x86_64) 7 (Core)
CentOS Linux (3.10.0-957.el7.x86_6) 7 (Core)
CentOS Linux (0-rescue-71c11ed5c0aa41ad909ab96d4c6ad395) 7 (Core)

This aligns with the 4 options you have at boot:

Next check you have the RPM “yum-utils” installed. Then run the following which is included in yum-utils:

package-cleanup –oldkernels –count=1

This will automatically delete and free up space by erasing old kernels and leaving with the current one plus the “rescue” kernel. When this runs you will see something that includes the following:

Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Erasing    : kernel.x86_64                                                                                                                 1/4 
  Erasing    : kernel-devel.x86_64                                                                                                           2/4 
  Erasing    : kernel.x86_64                                                                                                                 3/4 
  Erasing    : kernel-devel.x86_64                                                                                                           4/4 
  Verifying  : kernel-devel-3.10.0-957.el7.x86_64                                                                                            1/4 
  Verifying  : kernel-3.10.0-957.el7.x86_64                                                                                                  2/4 
  Verifying  : kernel-devel-3.10.0-957.21.3.el7.x86_64                                                                                       3/4 
  Verifying  : kernel-3.10.0-957.21.3.el7.x86_64                                                                                             4/4 

Removed:
  kernel.x86_64 0:3.10.0-957.el7                     kernel.x86_64 0:3.10.0-957.21.3.el7          kernel-devel.x86_64 0:3.10.0-957.el7         
  kernel-devel.x86_64 0:3.10.0-957.21.3.el7         

Complete!

Now you should fine the “/boot” is much emptier:

So when you reboot, you likewise only get the two kernel boot options:

Permanent fix

To stop this happening edit the file “/etc/yum.conf” and look for the line:

installonly_limit=5

Change the number to the one you want. Note that if you put either 0 or 1 then it will be interpreted as unlimited. So for practical purposes the minimum is 2. I set mine to 2.

Resources

Linux Config: How to remove old unused kernels on CentOS Linux
https://linuxconfig.org/how-to-remove-old-unused-kernels-on-centos-linux

 

Related

Rename a CentOS 7 host
CentOS 7 base VM for WordPress and MythTV
CentOS 7 + PHP 7.2 + Python 3.6 + Apache 2.4
CentOS 7 VM for WordPress and MythTV – Post install setup
Recent

  • AlmaLinux GUI – no taskbar or application shortcuts

    AlmaLinux GUI – no taskbar or application shortcuts

  • AlmaLinux 9.5 base VM

    AlmaLinux 9.5 base VM

  • Reset Kodi thumbnails

    Reset Kodi thumbnails

  • Set default settings values in Kodi skins

    Set default settings values in Kodi skins

  • Add/Remove/Reset music/video libraries in Kodi

    Add/Remove/Reset music/video libraries in Kodi

  • Zoyinc Kodi skin on Sony TV

    Zoyinc Kodi skin on Sony TV

  • [L] – WordPress UAM Locked Post

    [L] – WordPress UAM Locked Post

  • Import Pictures and Videos – images not previewed

    Import Pictures and Videos – images not previewed

  • Find My Train

    Find My Train

  • WordPress style name not visible

    WordPress style name not visible

About Zoyinc

  • Contact Us
  • Zoyinc Disclaimer
  • Google Search Console
  • Privacy Policy
  • Site Statistics
  • Login

Apache Auckland Backup CD CentOS Centos7 Children Configuration Debian Error ESX ESXi Fedora Firewall Install Josh Kids Kodi Linux MariaDB MySQL MythTV New Zealand OKD OMV Open Media Vault OpenShift PHP Player Python RAID RedHat Red Hat Rip School Setup SMB SonicWALL Spark tags Train Trains VLAN VM VMware Weaver Windows WordPress YouTube

Powered by

This site is licensed under a Creative Commons Attribution 4.0 International License.