0

I used to run Ubuntu and Kali, but now I want to delete Kali and just extend the partition where Ubuntu is stored. I booted from a LiveUSB and deleted the partition where Kali was installed, and now that partition is unallocated. However, when I try to resize the Ubuntu partition, the slider will not move left. How do I solve that?

https://imgur.com/a/xyAu7FD

K7AAY
  • 17,705

2 Answers2

2

Your system is formatted with GPT instead of MBR, so there are no Extended partitions to deal with (simplifies matters).

If you are using Ubuntu 18.04 or newer, and do not use Hibernation, you do not need a separate swap partition, and can use a swap file instead. There was a problem in the kernel, fixed in late 2017, that made swap files slower.

If you don't use hibernation, you can unlock /dev/sda7 by right-clicking on it. Delete it; we will make a swap file later after rebooting into Ubuntu from your system drive. Then, you can extend /dev/sda5 across the space formerly used by the swap partition into the unallocated space.

Remember, with gparted, to make one change, then click the green check mark in the power bar before making another change.

/dev/sda1 is also useless, for you do not use Windows any more. However, you can't easily get at that space, without deleting and recreating the EFI boot partitions; it would be easier to

  • backup and verify the backup matches the source data
  • make another backup to different media (disk or cloud) and verify that, then
  • wipe the disk completely and
  • reinstall then
  • restore.

Commands to make, then enable, a swap file (second command makes a two GB swap file with the bs= option, resize as it suits you):

sudo swapoff -a
sudo dd if=/dev/zero of=/swapfile bs=2G count=8
sudo mkswap /swapfile && sudo swapon /swapfile
Zanna
  • 72,312
K7AAY
  • 17,705
0

You have a swap partition to the left of your /dev/sda5. Move this first, then resize your Ubuntu partition.