GParted forcing 1 MiB gap between 2 adjacent partitions when resizing both together
A user reported a bug in GParted forum thread: Unallocated disk space equal exactly to one MiB after shrink/grow that when composing a second resize/move operation to move adjacent partitions the second resize/move is prevented from using the last 1 MiB.
Disk setup to reproduce:
truncate -s $(( (976773119+1+33)*512 )) /tmp/disk-500G.img
l=`losetup -f --show /tmp/disk-500G.img`
echo $l
sgdisk --new 1:2048:1026047 -t 1:8200 $l
sgdisk --new 2:1026048:123906047 -t 2:8200 $l
sgdisk --new 3:123906048:944005119 -t 3:8200 $l
sgdisk --new 4:944005120:976773119 -t 4:8200 $l
partprobe $l
mkswap ${l}p1
mkswap ${l}p2
mkswap ${l}p3
mkswap ${l}p4
echo $l
Steps to reproduce in GParted:
- Run gparted on loop device
- Ptn 3, compose shrink by moving start to the right by 20000 MiB
- Ptn 2, compose grow by moving end all the way to the right (20000 MiB)
Resize/Move dialog forces 1 MiB free space after the partition and reduces grow to 19999 MiB.
Recommended workaround:
Compose and apply one resize/move operation at a time, keeping the MiB
alignment.
Edited by Mike Fleetwood