Ubuntu – GParted can’t move extended partition to the right

gpartedpartitioning

I have a hard disk, which was partitioned before (probably in Windows) like this:

  • Partition 0 – primary, 20Gb
  • Partition 1 – extended, 200Gb

I have unallocated space after Partition #1, so I wanted to increase the size of the Partition #0. At first I wanted to move the Partition #1 to the right, so I started Ubuntu from CD and called GParted. All the logical partitions inside the extended partition aren't mounted. I've assigned the Partition #0 as swap (temporarily) because it looks like the Ubuntu needs the swap even when started from CD.

The GParted can resize the extended partition (Partition #1) but it can't move it. The left arrow in the slider is not movable.

What might be a problem?

Also, the Partition #1 has a single flag on – it's "lba" flag. What's it for? Maybe it's the reason the GParted can't move it?

Best Answer

Extended partitions are like containers for logical volumes. But unfortunately, you can't just move the whole container.

Maybe it helps if you imagine partitions as cardboard boxes. A primary partition is a standard box and logical volumes are like little boxes that have to stay inside an extended partition. Now the interesting thing is how the extended partition would look like as box: It would be a box without a bottom!

It covers the small logical volumes, so to the outside (e.g. to the MBR partition table which only allows 4 partitions per disk) just looks like one big box, but if you would try to move it and lift it off the floor, all those little boxes inside (logical volumes) would still sit on the same place on the ground. You understand what I want to illustrate to you? By moving an extended partition (which does not work for that reason), you don't move the contained logical volumes.

So the solution to move an extended partition is to first enlarge the extended partition by moving one boundary to cover all the new space it should be moved to, then move all contained volumes to their respective new position, then shrink it again by moving the other boundary so that there's no unassigned space left inside the extended partition.