25

I can't find a way to move the partition /dev/sdb2 to the end, where 12GB are free.

enter image description here

I can resize (expand) the partition, but not create (insert) any free space in front of it.

How to do the trick?

(There are 2 small black arrows on the top of the popup window in the screenshot at the side of the blue box that represents the 400 GB sdb2 - I can only move the right arrow to the right, which extends the size, but I cannot move the left arrow. When I enter something in the free space preceding box it is always reset to zero by the programm immediateley)

I hope I explained this well enough, please feel free to ask for details.

This is serious for me as I am expanding a live image.

Maybe there is another solution with linux commandline tools ?

2 Answers 2

33

I found out how to move the 400MB swap partition.

The swap partition is within a 400mB extended partition

1) Extend the size of the 400 MB extended partition so that it takes the whole space until the end of the disk.

2) Move the 400MB swap partition to the end of the now very big extended partition.

3) Resize the extended partition so that it is only 400MB again by sliding the left arrow which is now free to move.

The reason for my problem was that I wanted to move the extended partition and the swap partition that was within it at the same time, but it has to be done in the steps described here.

4
  • 6
    Yep. Don't know why there can't be a single command which does these steps sequentially for you to create a true move.
    – demongolem
    Commented Aug 1, 2012 at 13:28
  • You are right @demongolem, I don't know why... I had to Google because even if GParted is a great tool, but things like that are not very intuitive, at least not for me. Commented Oct 30, 2013 at 16:44
  • Resize/Move is greyed out for me on the extended partition, so this doesn't work for me. Commented Sep 3, 2015 at 13:26
  • Expand, move inner crap, collapse, expand first crap - didn't think to try that. Amazingly simple.
    – WernerCD
    Commented Dec 8, 2015 at 20:03
2

Have you looked at parted? It has a move command.

1
  • Thank you. I am accepting this as it answers part of my question. Good to know that there is a cli tool for this.
    – Anonymous
    Commented Jan 23, 2010 at 19:36

You must log in to answer this question.