1

The following is the current partitioning on my friend's Ubuntu machine.Here, /dev/sda5 is root file system. This is located on extended file system. I want to add the 80GB ext4 (/dev/sda3) and 250GB unallocated to root (/dev/sda5 - ext4). I am able to extend only 80GB /dev/sda3. But could not extend /dev/sda5. Even with live cd, I have to delete both /dev/sda5 and /dev/sda2 to extend but that's resulting grub error. How can I achieve it without losing data? enter image description here

Vamshi
  • 143
  • 6
  • Partitions must be unmounted to work on them from live cd/USB. Best way to not lose data is backup data. Data lost should be expected when working on partitions. – crip659 Dec 04 '20 at 19:34
  • yeah, correct. Atleast I want the machine to boot up after changes. – Vamshi Dec 04 '20 at 19:36
  • Don't mention Ubuntu version, so after backup if wanting to upgrade just install newer version with partitions you want. – crip659 Dec 04 '20 at 19:43
  • 2
    Move /dev/sda3 to the end of the unallocated space. Then grow (resize) /dev/sda2. Then /dev/sda5 can be resized after. – Terrance Dec 04 '20 at 19:50
  • 1
    Does this answer your question? [How to resize partitions?](https://askubuntu.com/questions/126153/how-to-resize-partitions) – karel Dec 06 '20 at 11:08

1 Answers1

2

You need to do it from live CD(USB) in this order:

  1. If there are any data on sda3 you want to keep, back them up first.
  2. delete sda3
  3. select the extended partition sda2 and grow it's size to the most right.
  4. select sda5 and grow it's size to the most right.
mook765
  • 14,911
  • 5
  • 35
  • 67