2

This is my GParted view

This is my GParted view. There is a 100GB of unallocated space at the very top. I want to add that space to /dev/nvme0n1p1 or the / which is shown locked. I already searched online but most of the solutions had linux-swap partition involved somehow. I seem to have a swap file instead. Also it seems the order of these partitions as shown in GParted matters. Now, I want to safely add that extra space, i.e. without any data loss.

Archisman Panigrahi
  • 28,338
  • 18
  • 105
  • 212
GX_V
  • 23

1 Answers1

2

The solution to this is quite straightforward. You will need:

  1. A backup of any data you cannot afford to loose.
  2. The means to boot into a live environment. The Ubuntu install media is perfect.

The steps are as follows

  1. Boot into Windows and use the disk management tool to move the approximately 76GB VOLUME to the start of the disk. This will move the unallocated space next to your approximately 49GB Ubuntu root partition
  2. Boot into the live environment (Try Ubuntu not install Ubuntu if you are using the Ubuntu install media)
  3. Using GParted resize the approximately 49GB partition making use of the 100GB of unallocated space.

That’s it reboot into your enlarged Ubuntu install.

Good luck!

PonJar
  • 1,868
  • 1
    You should move the Ubuntu partition left (into the newly freed space), then expand it right, to avoid losing the filesystem at some random offset into the partition. – ubfan1 Mar 07 '21 at 03:29
  • Thank you I was successful – GX_V Mar 13 '21 at 12:32
  • @GX_V if my answer was successful for you please accept it. It will help others find answers that worked. – PonJar Mar 13 '21 at 12:56
  • So basically, I booted from a live USB and opened GParted. At first, I moved /dev/nvme0n1p3 to the left of the 100GB unallocated space. Then I moved /dev/nvme0n1p1 to the left of 100GB as well. So /dev/nvme0n1p1 was sandwiched between the two. Then I extended it to the right covering the entire 100GB space. Hence, /dev/nvme0n1p1 totalled approx 150GB. – GX_V Mar 13 '21 at 13:33