Cannot move unallocated space

I want to resize the /dev/sda6 to ~50GB. But I can't do this, because the unallocated space is on the wrong position.

How can I move the unallocated space to the right and resize the sda6 partition?

enter image description here


Solution 1:

Especially if you are moving and/or resizing existing partitions, make sure you backup all important data in case it is lost or damaged.

Firstly, if you are running Gparted from a installed Ubuntu, you can't resize the partitions on which it is installed (it can unmount other partitions though), so you need to use a live disk (explained here).

Then you can resize the partitions - one way to do it is to:

  1. Move sda5 to the left (right click and use 'Resize/Move'), so there is unallocated space between sda5 and sda6: visualization1
  2. Then you can move sda6 to the left, so the unallocated space is too the right of it: visualization2
  3. Finally, you can expand sda6 so it fills the space: visualization3

The yellow parts in the GParted visualization represent the data in the partitions - all the data in the partition has to be copied bit by bit when the partition is moved, so it could take a few hours (or even days...), particularly with slower hardware. Corruption of data is possible - if it is paused or interrupted whilst formatting/copying it is almost certain, so ensure the computer is connected to a reliable power supply and not used much (to maximise the resources available - make sure it doesn't suspend etc though). Also, if the partition is a boot partition, the computer may not boot afterwards if the bit with the boot stuff has been damaged, which I think is vaguely possible even with a successful copy.

Relevant documentation:

  • http://gparted.org/display-doc.php?name=help-manual#gparted-move-partition
  • http://gparted.org/display-doc.php?name=moving-space-between-partitions

An alternative method would be use the allocated space by creating a new partition inside it - this is quickest (should take less than five minutes) and also the less risky way, though it may be annoying have data separated between partitions. You can do this by selecting the unallocated space and creating a New Partiton - if you are just using just Linux, then the ext4 format may be best.

You can then select the partition in you file manager (e.g. Nemo, Nautilus, Dolphin, Thunar, etc) to use it: enter image description here

You may need to use this command so you can use it as your normal user:

sudo chown -R $USER:$USER /<path>/<to>/<mounted>/<folder>