Use the s
command in gdisk.
The warning doesn't prevent you from using the command. It's just a warning. If you use s
and then p
, you'll probably find that the partitions are, indeed, sorted and ready to be w
ritten.
Note that the "Sort" command only does what it says – sorts the partition table entries in ascending order, to match the actual disk layout. It doesn't let you move the GPT entries manually (use "Expert" → "Transpose" for that), and it does not move the actual partition contents.