Announcement

Collapse
No announcement yet.

Upgrade from 20.04 to 22.04 fails - not enough memory in /boot

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Upgrade from 20.04 to 22.04 fails - not enough memory in /boot

    FYI: I am an inexperienced Kubuntu user.

    I wanted to upgrade to 22.04 from 20.04 on my Lenovo laptop but when I do, I get an error that say that I need 1.203 M free memory and thus need to clear 819 M from /boot. The problem is, I think my boot partition is only 704 M in total and currently there are only two kernels in the /boot as I have cleared out all others. This is from the df -h output:

    Code:
    /dev/nvme0n1p2              704M  286M  367M  44% /boot
    /dev/nvme0n1p1              511M   24M  488M   5% /boot/efi
    ​
    I installed Kubuntu with an encrypted partition, so I think I cannot resize the boot partition. Do I have to make a fresh install? If so, how do I do that: Do I have to partition my drive beforehand or can I just use a USB-Stick with the 22.04 Version and partition it during the installation process? I really want a larger /boot partition, I always had issues when updating kernels and needed to remove old ones manually (there were always both generic am oem versions).

    #2
    In Konsole sudo apt autoremove to possibly clear out some older kernels - that would free up some space in /boot.

    If this does remove any kernels, reboot and try release-upgrading to 22.04 again to see if the release-upgrade process will still demand more space than you have.

    If this is what you have already done I would go for repartitioning and a fresh 22.04 installation.
    Last edited by Schwarzer Kater; Apr 04, 2023, 12:06 PM.
    Debian KDE & LXQt • Kubuntu & Lubuntu • openSUSE KDE • Windows • macOS X
    Desktop: Lenovo ThinkCentre M75s • Laptop: Apple MacBook Pro 13" • and others

    get rid of Snap script (20.04 +)reinstall Snap for release-upgrade script (20.04 +)
    install traditional Firefox script (22.04 +)​ • install traditional Thunderbird script (24.04)

    Comment


      #3
      I did clear out older kernels and rebooted. It still requires 1.203 M for the upgrade unfortunately.

      How do I partition, can I do that from my current version?

      Comment


        #4
        No, you can't - if you mean "partition the same drive you booted your current installation from".
        To resize or create partitions in the same space on your drive that you are using you have to unmount them first. When you have started from / you can't unmount it, of course.

        To repartition your drive boot from an USB stick. To partition drives to prepare them for an installation I personally prefer GParted Live (https://gparted.org/livecd.php). Be generous regarding the size of a seperate partition for /boot. (2GB or more).
        If you want to or have to create a seperate partition for /boot/efi choose 320MB - that is sufficient for any use case I have come across so far.
        You will loose all your data - have a good backup for anything important to you!
        Last edited by Schwarzer Kater; Apr 06, 2023, 02:58 AM.
        Debian KDE & LXQt • Kubuntu & Lubuntu • openSUSE KDE • Windows • macOS X
        Desktop: Lenovo ThinkCentre M75s • Laptop: Apple MacBook Pro 13" • and others

        get rid of Snap script (20.04 +)reinstall Snap for release-upgrade script (20.04 +)
        install traditional Firefox script (22.04 +)​ • install traditional Thunderbird script (24.04)

        Comment


          #5

          What's likely happening is your initramfs is too large to fit in the /boot file system. You can TRY editing /etc/initramfs-tools/initramfs.conf and changing the default "MODULES=most" to "MODULES=dep" or "MODULES=list" which should result in up tp a 50% reduction in intramfs size.​

          IMO the problem is you should not have and do not need a separate /boot. We haven't needed that for more than a decade now unless you're using some exotic file system GRUB can't read.
          For a long term fix, in my opinion, don't bother messing with the partitions. You should boot to a live USB, copy all the files in partition 2 to /boot in the main install partition, then edit /etc/fstab and remove the /boot mount. You should be able to boot up again as is, then run update-grub and grub-install to correct grub.cfg.

          Once you've confirmed you're booting to the install partition directly and no longer using partition 2, THEN you can consider what to do with it.


          I just noticed you are using encryption which explains the need for the /boot. At this point you're probably better off reinstalling.

          If you want to attempt the reduction in size of initramfs, after you make the above edits you have to rebuild initramfs.

          sudo update-initramfs -c -k

          followed by the kernel in use, like 5.15.0-69-generic
          Last edited by oshunluvr; Apr 13, 2023, 11:22 AM.

          Please Read Me

          Comment


            #6
            … and when you have checked that after claydoh 's tip everything works and then want to reduce the size of the initramfs for the rest of the installed kernels too:
            sudo update-initramfs -c -k all

            But to have another (last) go at the release-upgrade after the reduction of initramfs was successful and there still is not enough space, it could also help to remove all kernels but the one you booted from - instead of reducing their initramfs too.
            Debian KDE & LXQt • Kubuntu & Lubuntu • openSUSE KDE • Windows • macOS X
            Desktop: Lenovo ThinkCentre M75s • Laptop: Apple MacBook Pro 13" • and others

            get rid of Snap script (20.04 +)reinstall Snap for release-upgrade script (20.04 +)
            install traditional Firefox script (22.04 +)​ • install traditional Thunderbird script (24.04)

            Comment

            Working...
            X