I have /boot/ on a separate partition from /, and /boot/ is 98% full. How do I make more space on it?


Solution 1:

You can free space by uninstalling unneeded (old) versions the Linux Kernel.

  1. Get a list of installed Kernels like this:

    confus@confusion:~$ dpkg --list | grep -E "linux-header|linux-image"
    ii  linux-headers-3.5.0-18-generic            3.5.0-18.29                                amd64        Linux kernel headers for version 3.5.0 on 64 bit x86 SMP
    ii  linux-headers-3.5.0-23-generic            3.5.0-23.35                                amd64        Linux kernel headers for version 3.5.0 on 64 bit x86 SMP
    ii  linux-image-3.5.0-18-generic              3.5.0-18.29                                amd64        Linux kernel image for version 3.5.0 on 64 bit x86 SMP
    ii  linux-image-3.5.0-23-generic        3.5.0-23.35                                amd64        Linux kernel image for version 3.5.0 on 64 bit x86 SMP                               amd64        Generic Linux kernel image
    
  2. Find out, what kernel you are running. E.g. by running the command:

    confus@confusion:~$ uname -r
    3.5.0-23-generic
    

    In this example my kernel version is "3.5.0-23-generic".

  3. Provided this kernel works perfectly for you and you don't have any bugs, remove everything BUT this kernel. In my example this would be accomplished by:

    sudo apt-get remove linux-image-3.5.0-18-generic linux-headers-3.5.0-18-generic
    

Remove obsolete linux-images using synaptic

If you want a graphical tool use synaptic package manager (you might need to install it in Software Center. You can search for "linux-headers" and "linux-image" and sort them, installed packages first. Then mark them for removal.

Solution 2:

You normally don't need to resize your boot partition, as this can be risky and you may lose your data. Please consider reinstalling Ubuntu with a larger boot partition, or leaving your boot partition untouched.

Disclaimer: Please make a backup of your data on an external drive before following these steps. If you are wondering how to do this, there are plenty of tutorials online.

Here are some example of how to make backups: (Ubuntu Forums) (Community Documentation).


Resize a partition with GParted and Live CD:

  1. Check the partition of your /boot/ partition with lsblk. The mount point is listed on the right-hand side. As an example, you may look at mine (but note I have no separate /boot/ partition). Be sure to write this down.
  2. Boot into a Desktop Live CD, and start a desktop sessions with the "Try Ubuntu" option.
  3. Open gparted (if not installed, run sudo apt-get install gparted)
  4. Select a partition that you are willing to shrink which is adjacent to your boot partition (for example, if it is /dev/sda4, you can shrink either /dev/sda3 or /dev/sda5.
  5. Select Resize/Move, resize the partition. so that you there is extra space immediately adjacent to your /boot partition. Do not move the partition, as you will risk losing your data.
  6. Resize your boot partition (the one you wrote down), to occupy this space. Be careful not to move it, otherwise you will risk losing data.
  7. Click the green check mark with says "Apply". This will make changes to your hard drive. Be patient, as this can take a while.

For more information you can check out this answer.