Boot into Ubuntu using a live CD. Open a terminal window and run fdisk by executing:
sudo fdisk /dev/sda
Press x to navigate to the advanced menu, then press f to fix the partition order.
It may be necessary to update grub’s configuration after renumbering partitions. Update any partition references in the notation “hd(0,1)” – the second number may have to be changed to reflect the new partition numbers.
It’s a good idea to check for any changes to partition UUIDs as a result of renumbering. In a terminal window, run:
ls -l /dev/disk/by-uuid
Compare the output from this to grub’s menu file. Make certain the “root=UUID=0000000000” parameter is correct on any line beginning with “kernel”.
Credit: https://lists.ubuntu.com/archives/ubuntu-uk/2008-January/010753.html