ECEn Help Wiki

Log In
Home Sitemap Recent Changes Media Manager

Trace: how_to_clear_a_full_boot_partition

wiki:student:how_to_clear_a_full_boot_partition

This is an old revision of the document!


How to Clear a Full Boot Partition

​​​Ubuntu usually creates a separate /boot partition for storing Linux kernels. This isolates the kernels from the rest of the operating system, which helps make the system more stable. However, as it is usually a small partition (> 200 MB), it can fill up with old kernels. While keeping a couple old kernels around can be advisable, so as to be able to roll back to old kernels if a new one proves unstable (an unusual occurrence), it is not necessary to keep more than one or two.

A user will usually notice they are out of space in /boot only after it is causing problems. If a new kernel tries to install without enough space, the installation will fail. If the system is then rebooted and it tries to use the new kernel, it will have a kernel panic. Sometimes it will be more graceful and simply cause dependency problems, which cripples the functionality of apt-get.

​Here are some tricks to solve this problem:

  1. ​​ If you've run into a kernel panic at boot time, select the Advanced Boot option from the Grub menu and select an older kernel version to boot from (do not use recovery mode). You may have to try a few before you find one that works.
  2. When you have a functioning terminal to use, check the Linux kernel version you are currently running with the uname -r command. DO NOT remove this kernel.
  3. Check which old kernels you have with ls /boot.
  4. Force the removal of one or two old kernels with sudo dpkg –force-all -P linux-image-3.13.0-32-generic (update with the version of the kernel you wish to remove).
    1. ​You will probably need to use the same command to delete the linux-image-extra version of the corresponding kernels to fix dependency problems.
  5. ​Once you are certain you have enough free space, use sudo apt-get install -f to fix any existing dependency problems. Make sure this command does not try to reinstall the kernels you just removed. If it does, you need to remove the linux-image-extra packages for those kernels (there may be other such dependencies, check online).
  6. Once you've got any dependency issues resolved, run sudo apt-get autoremove to remove the other old kernels.
    1. As an alternative to autoremove, you try the following command, though using a low-level utility such as dpkg is not necessarily recommended. It will remove all kernels except the one currently running.
      1. echo "Help"
  7. Odds are, there's a new kernel waiting to be installed. Once you've done all this to clear out your /boot partition, run apt-get update and apt-get upgrade to update your system (including any new kernels).
wiki/student/how_to_clear_a_full_boot_partition.1552686248.txt.gz · Last modified: 2019/03/15 15:44 by cwday