How to enlarge Ubuntu system partition to the left? [duplicate]

sda6 is ext4 file system and where my ubuntu is installed, 30GB. sda3 is "ntfs" file system and where my windows is installed, 400GB. sda7 is a 50 GB empty partition with "ext4" file system.

How to move the space of sda7 to sda6 to let sda6 become 50+28=78 GB.

enter image description here

Here's a real case of mine :( I want to add more space into my ubuntu (28.2 GB one) from other emtpy partition space.


Solution 1:

Make sure that you have a good backup of your important Ubuntu files, as this procedure can corrupt or loose data.

Keep these things in mind:

  • always start the entire procedure with issuing a swapoff on any mounted swap partitions, and end the entire procedure with issuing a swapon on that same swap partition

  • a move is done by pointing the mouse pointer at the center of a partition and dragging it left/right with the hand cursor

  • a resize is done by dragging the left/right side of a partition to the left/right with the directional arrow cursor

  • if any partition can't be moved/resized graphically, you may have to manually enter the specific required numeric data (don't do this unless I instruct you to)

  • you begin any move/resize by right-clicking on the partition in the lower pane of the main window, and selecting the desired action from the popup menu, then finishing that action in the new move/resize window

Do the following...

Note: if the procedure doesn't work exactly as I outline, STOP immediately and DO NOT continue.

  • boot to a Ubuntu Live DVD/USB
  • start gparted
  • right-click on "New Partition #1" in the bottom pane and select delete (added)
  • right-click on /dev/sda7 in the bottom pane and select delete
  • move /dev/sda6 partition all the way left
  • resize the right side of /dev/sda6 all the way right
  • right-click on /dev/sda8 in the bottom pane and delete it if it's not needed (added)
  • click the Apply button
  • reboot

Solution 2:

Follow these steps to get things done:

  • Backup all your data in sda7
  • Boot into Ubuntu via LiveUSB (by clicking on Try Ubuntu)
  • Open GParted
  • Delete partition sda7 and New Partition #1
  • Extend partition sda6
  • Apply changes and reboot

Detailed procedure of partitioning can be found in this question How to resize partitions?

Alternatively you can let sda7 be separate partition and move your /home to that. You might like to read How to create a separate home partition after installing Ubuntu under single / partition.

Original Answer:

I believe B is in between A and C. Although you can merge C and D but it is impossible to merge A and C, since partitions need to be in contiguous form to be extended or merged or you can say, partitions need to be exactly above or below the unallocated space to get resized. Moreover unlike Windows Ubuntu can't work on dynamic disks, so it is impossible to extend the partition using the partition which is very far. So it is better to merge C and D (and have 65 GB) and keep partition A as a separate partition.