Ubuntu 18.04 boot too small - can't resize

6,241

One easy strategy is to uninstall the kernel you're not using, thereby freeing up enough space for the release-upgrade. This WON'T resize your partitions, but WILL get you through the release-upgrade.

uname -r will tell you which kernel you are using. Let's assume you are running 4.15.0-38, so you can safely remove 4.15.0-36.

sudo apt remove linux-image-4.15.0-36-generic   // Remove the kernel image
sudo apt autoremove                             // Remove dependencies

Then run df -h again to check if you freed the 25MB you needed in /boot. If so, try the release-upgrade again.

Share:
6,241

Related videos on Youtube

Dave H
Author by

Dave H

Updated on September 18, 2022

Comments

  • Dave H
    Dave H over 1 year

    I am unable to upgrade software since upgrading to 18.04 due to the boot partition size being too small. I've tried Gparted as a LiveCD, but that didn't allow me to expand the boot partition. I can't get KVPM to boot due to needing to be root and I can't find instructions on how to make that happen.

    I also can't install system-config-lvm for some reason. I've used several sources, but this link has most of the instructions I've followed thus far:

    How can I resize an LVM partition? (i.e: physical volume)

    Outside of doing a clean install to fix the boot partition size problem, I'm hoping someone can help me resize the partitions on my machine so I can get past this roadblock.

    Thanks in advance.

    Output of df -h

    Output of df -i

    Software updater error message:

    Software Updater "Not enough free disk space" error

    Output of ls -la /boot:

    total 110844
    drwxr-xr-x  4 root root     4096 Nov 17 11:50 .
    drwxr-xr-x 24 root root     4096 Nov 15 19:26 ..
    -rw-r--r--  1 root root  1537821 Sep 24 07:08 abi-4.15.0-36-generic
    -rw-r--r--  1 root root  1537997 Oct 10 02:20 abi-4.15.0-38-generic
    -rw-r--r--  1 root root   216954 Sep 24 07:08 config-4.15.0-36-generic
    -rw-r--r--  1 root root   216983 Oct 10 02:20 config-4.15.0-38-generic
    drwxr-xr-x  5 root root     1024 Nov 15 19:27 grub
    -rw-r--r--  1 root root 26584853 Nov 15 19:26 initrd.img-4.15.0-36-generic
    -rw-r--r--  1 root root 57729589 Nov 17 11:50 initrd.img-4.15.0-38-generic
    drwx------  2 root root    12288 Nov 15  2014 lost+found
    -rw-r--r--  1 root root   182704 Jan 28  2016 memtest86+.bin
    -rw-r--r--  1 root root   184380 Jan 28  2016 memtest86+.elf
    -rw-r--r--  1 root root   184840 Jan 28  2016 memtest86+_multiboot.bin
    -rw-r--r--  1 root root        0 Sep 24 07:08 retpoline-4.15.0-36-generic
    -rw-r--r--  1 root root        0 Oct 10 02:20 retpoline-4.15.0-38-generic
    -rw-------  1 root root  4046393 Sep 24 07:08 System.map-4.15.0-36-generic
    -rw-------  1 root root  4046910 Oct 10 02:20 System.map-4.15.0-38-generic
    -rw-------  1 root root  8275824 Sep 24 07:08 vmlinuz-4.15.0-36-generic
    -rw-------  1 root root  8277752 Oct 10 03:43 vmlinuz-4.15.0-38-generic
    

    New df-h output after removing old kernel:

    Filesystem                   Size  Used Avail Use% Mounted on
    udev                         5.9G     0  5.9G   0% /dev
    tmpfs                        1.2G  2.1M  1.2G   1% /run
    /dev/mapper/ubuntu--vg-root  905G  347G  513G  41% /
    tmpfs                        5.9G  3.0M  5.9G   1% /dev/shm
    tmpfs                        5.0M  4.0K  5.0M   1% /run/lock
    tmpfs                        5.9G     0  5.9G   0% /sys/fs/cgroup
    /dev/loop0                    88M   88M     0 100% /snap/core/5742
    /dev/loop1                    89M   89M     0 100% /snap/core/5897
    /dev/loop2                   203M  203M     0 100% /snap/firefox/152
    /dev/loop3                   5.0M  5.0M     0 100% /snap/canonical-livepatch/50
    /dev/loop4                    88M   88M     0 100% /snap/core/5662
    /dev/sda1                    236M  117M  107M  53% /boot
    tmpfs                        1.2G   16K  1.2G   1% /run/user/127
    tmpfs                        1.2G   32K  1.2G   1% /run/user/1000
    
    :/boot$ ls -la
    total 110844
    drwxr-xr-x  4 root root     4096 Nov 17 11:50 .
    drwxr-xr-x 24 root root     4096 Nov 15 19:26 ..
    -rw-r--r--  1 root root  1537821 Sep 24 07:08 abi-4.15.0-36-generic
    -rw-r--r--  1 root root  1537997 Oct 10 02:20 abi-4.15.0-38-generic
    -rw-r--r--  1 root root   216954 Sep 24 07:08 config-4.15.0-36-generic
    -rw-r--r--  1 root root   216983 Oct 10 02:20 config-4.15.0-38-generic
    drwxr-xr-x  5 root root     1024 Nov 15 19:27 grub
    -rw-r--r--  1 root root 26584853 Nov 15 19:26 initrd.img-4.15.0-36-generic
    -rw-r--r--  1 root root 57729589 Nov 17 11:50 initrd.img-4.15.0-38-generic
    drwx------  2 root root    12288 Nov 15  2014 lost+found
    -rw-r--r--  1 root root   182704 Jan 28  2016 memtest86+.bin
    -rw-r--r--  1 root root   184380 Jan 28  2016 memtest86+.elf
    -rw-r--r--  1 root root   184840 Jan 28  2016 memtest86+_multiboot.bin
    -rw-r--r--  1 root root        0 Sep 24 07:08 retpoline-4.15.0-36-generic
    -rw-r--r--  1 root root        0 Oct 10 02:20 retpoline-4.15.0-38-generic
    -rw-------  1 root root  4046393 Sep 24 07:08 System.map-4.15.0-36-generic
    -rw-------  1 root root  4046910 Oct 10 02:20 System.map-4.15.0-38-generic
    -rw-------  1 root root  8275824 Sep 24 07:08 vmlinuz-4.15.0-36-generic
    -rw-------  1 root root  8277752 Oct 10 03:43 vmlinuz-4.15.0-38-generic
    
    :/boot$ sudo apt remove linux-image-4.15.0-36-generic
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Package 'linux-image-4.15.0-36-generic' is not installed, so not removed
    0 upgraded, 0 newly installed, 0 to remove and 76 not upgraded.
    
    • user535733
      user535733 over 5 years
      What makes you believe that your /boot partition is too small? Many, many Ubuntu systems with small /boot partitions have been successfully upgraded after a release-install. Perhaps you have an extra old kernel still installed that can be easily identified and removed?
    • Dave H
      Dave H over 5 years
      Thanks for your reply. I get the following error message when trying to update software: "Not enough free disk space". I'll try and post a screen shot of the actual message. I've tried sudo apt autoremove but that didn't solve it. I have not yet figured out how to edit initramfs.conf file, which seems to be a permissions issue.
    • Dave H
      Dave H over 5 years
      Thanks for your help. I just posted screenshots of each.
    • user535733
      user535733 over 5 years
      Your disks don't look out-of-space. You /boot is only 53%. Please edit your question to include the complete output of a terminal session showing the out-of-space error, including the exact command you used. It's usually easier to copy-and-paste text than to muck about with screenshots.
    • Dave H
      Dave H over 5 years
      I saw that in the output also. Please see new screen shot from software updater showing the error message I am receiving. I primarily update software this way, and in the past when I've received it, clearing out old kernels did the trick. This time it's not solving the problem as all old kernels have been cleared and I still don't have enough disk space.
    • user535733
      user535733 over 5 years
      Please edit your question to show us the complete output of ls -la /boot
    • user535733
      user535733 over 5 years
      If you have anything in 'lost+found', you should investigate further. Note how one initrd.img is twice the size of the other - that's unusual; keep an eye on that in the future.
    • Dave H
      Dave H over 5 years
      Thanks. Is there something about that second initrd.img file I can do to fix the size? I see your point, but I have no idea how that doubled in size. I'm thinking of booting to the prior "36" kernel then deleting all versions of "38" as a possible fix. Let me know if you have a better suggestion. Also, as a rookie on linux, I'm not sure what to do to investigate anything in lost and found.
    • Dave H
      Dave H over 5 years
      Just saw your note below. Let me work with that and see what happens. I really appreciate your help.
    • user535733
      user535733 over 5 years
      In 13 years with Ubuntu, I have never seen files persist after a successful uninstall...unless the system is so horribly broken that it must be immediately backed up and reinstalled. And I have never seen apt erroneously claim success uninstalling. I see two possibilities: 1) You have made a mistake -- either there was an error or the files really were deleted, or 2) Your system cannot be trusted and must be promptly reinstalled. In 13 years, it's been #1 well over 99% of the time. Maybe this is the day you should play the lottery.
    • Dave H
      Dave H over 5 years
      I do appreciate your help. I am showing above the exact commands in the directory I am issuing them. If you see something I am doing wrong, I'm ready to correct it. I already backed up my data and am preparing to reinstall given I don't see another option. All my upgrades are through the software updater. I generally don't do anything command line unless necessary. If this is one of the 1%'s, it is because of the software. Perhaps I will buy a lottery ticket.
  • Dave H
    Dave H over 5 years
    Thanks Michael. I will give this a try. I plan to backup my entire system on Tue and hopefully give this a try then. Appreciate the suggestion. I'll post results here.
  • Dave H
    Dave H over 5 years
    Completed these steps, but still don't have any more free space in boot. See new df -h output above.
  • user535733
    user535733 over 5 years
    Check that the -36 files were really removed using ls -la
  • Dave H
    Dave H over 5 years
    Posted the output here. I don't see those files.
  • user535733
    user535733 over 5 years
    Er, ls -la should be in /boot, not your /home
  • Dave H
    Dave H over 5 years
    Yep, I'm a rookie. I see 36 in the boot directory still. I've issued the remove command from the boot directory and the message says "not installed, so not removed" however I see the files for 36 in that directory.
  • user535733
    user535733 over 5 years
    did you run autoremove afterward?
  • Dave H
    Dave H over 5 years
    I did use sudo apt autoremove and the message says "0 to remove and 90 not upgraded"