-1

Hi i want to upgrade my main system from Ubuntu 20.04.4 to 20.04.1 LTS. But when i open gparted i get an error message. In spanish but i think very self explanatory:

enter image description here

Error from libparted: can't have a partition outside the disk

But i failed the upgrade because lack of free space in /boot, ubuntu told me that i had to free at least 350 mb on /boot....But i dont have such free space, and deleting one kernel could not be enough. So i need to resize partitions, adding for example 500 mb to /boot and ideally take it from / . But i have /swap partition in the middle...So whats the best option to get more space in boot, perhaps deleting swap partition ?

I add the screenshot. enter image description here

For sure i need all the information and i cant format the partitions and loose the information, software, configs in them.

Id like to have some kind of tutorial of what to do. Perhaps this could be a bug in upgrading process, because it should delete old kernels and install the new one.

muru
  • 197,895
  • 55
  • 485
  • 740
  • 1
    "without loosing information" means you have proper backups... – mook765 Aug 30 '22 at 19:59
  • 1
    Make sure you backup your valuable data, documents, pictures, videos, and whatnot. Everyone makes mistakes once in a while. No one can guarantee there will be no errors. Make multiple backups. Make sure the backups are not corrupt. – user68186 Aug 30 '22 at 20:00
  • Upgrade? 20.04.4 is later than 20.04.1, did you mean 22.04.1?? as that's two years newer. A Ubuntu 20.04 system has also reported itself as 20.04.5 (since last weekend) as well, so 20.04.4 shows a system that needs upgrades applied. – guiverc Aug 30 '22 at 22:36

2 Answers2

0

First, make sure that you have a tested backup of your data. Never touch your partitions without a backup of it. Or you may regret it !!!

Then you can turn off your swap

  1. disable swap

    sudo swapoff -a

  2. keeps the swap off during reboot (Just in case you reboot your system before the end of this procedure)

    sudo sed -i.bak '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab

  3. Remove the swap partition using gparted

  4. Extend your /boot partition using gparted

  5. Recreate the swap partition with the size left and set it as swap using gparted

  6. Restore your old fstab

    sudo mv /etc/fstab.bak /etc/fstab

PS: I didn't test the solution, but this is what I would do.

Angel115
  • 250
0

Credits go to @Angel115

1 - Boot computer and disable swap

sudo swapoff -a

2 - Open gparted or Disk Admin to manage partitions.

3 - Unmount /boot partition.

4 - Unmount swap partition if its still enabled.

5 - Delete the swap partition.

6 - Resize the /boot partition by the right ("taking space from swap partition, reducing it). In my case i increased /boot till 1024mb and left swap with 3.5 Gb

7 - Apply changes.

8 - Take note of /swap partition UUID.

9 - Open with gedit or whatever text editor /etc/fstab and in the line where describes the /swap change UUId to the new UUID the partition has. Would be nice to make a copy of your fstab before just in case....

10 - Reboot and pray... ;)