Ubuntu – Gparted: move extended partition on the left

gpartedpartitioning

Gparted

I have some free disk space on the left of my ubuntu (sda5)

What is best solution to extend sda5 ?

I can

  1. copy sda3 or sda5 with dd to bigger disk.
  2. delete sda3,5,swap
  3. create sda3,5,swap
  4. dd original partition.

Not sure how to do it properly.

May be there is a simpler solution.

Best Answer

You can't move the partitions that are mounted (the ones with the key icon), and you can't unmount the system you are running. You can unmount the swap drive, but that's not enough. So, you need to boot Linux from a cd or usb drive, then run gparted. The original Ubuntu disk will work, just don't install, but use the feature to try it out without making changes (ie, live CD).

Once you run gparted from another disk, you will want to resize sda3, the container for the logical drives, by selecting resize, and dragging it all the way to the left. Then, do the same for sda5, so it fills the partition. Finally, click the chekbox icon to apply the changes, and be prepared to wait a few hours, as resizing the partition to the left requires moving all the data. If you had left space at the end, then it would have been much quicker to resize to the right.

Make sure you do not turn off the power while this is happening. A power outage could be disastrous, so if you have a desktop, a UPS is a good thing to have. If you were to have a power outage, you might be able to cancel the operation.

If you have a laptop, make sure the battery is charged, and leave it plugged in.

Related Question