15

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.

  • You have to use gparted from live installer so everything is unmounted, but live installer may mount swap so you have to click on it and swap off to unmount it. Then just move the extended partition left. But you do not have lots of room. NTFS works best with 30% free, you are under 20% and it will start to get slow. I do not like to move / (root) partitions left, but you can, it will be slow, do not interrupt as any issue will corrupt it. And then you can expand it to the right. Best to have very good backups. – oldfred Dec 7 '14 at 17:53
15

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.

  • 5
    If you have a power outage during a move and are running on your UPS, canceling will take as much time as you have already spent on the move so you probably don't have enough battery power for that. Best thing to do would be to suspend the system so the battery will last a long time. – psusi Dec 7 '14 at 19:57
  • Thanks, @psusi... I didn't know, which is why I said might be able to cancel. Fortunately, I've never had a power outage while doing that, and I don't think I've ever needed to cancel, at least not very far into it. – Marty Fried Dec 7 '14 at 20:05
  • Ok. It worked for from 3rrd time. umount was not working. I unmounted in GUI and it failed. So I did it from terminal and then I was able to move. – Artem Feb 12 '15 at 23:00
  • @Artem: Well, I'm not sure what you were doing that failed, but all's well that ends well. Glad you finally solved the problem. – Marty Fried Feb 14 '15 at 19:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.