wizard10000 wrote:Write down the start and end sectors of the partition you want to delete. Go ahead and do your thing with creating a temporary partition and when you're ready to recreate the original partition use the start and end sectors, partition type and boot flag you wrote down earlier. Use fdisk to re-create the partition, not gparted.
This is exactly what sfdisk does, in a format that can be used to restore the original partition layout without the need for any tedious and error-prone manual operation.
wizard10000 wrote:Note that the UUID of the re-created partition will most likely change and you'll need to account for that in fstab.
No. The filesystem UUID is not stored in the partition table entry but in the partition data area, which is untouched.
On GPT partition scheme a partition UUID (also called GUID) and a partition label are stored in the partition table entry and can be used with PARTUUID= and PARTLABEL=, but this drive has an MSDOS partition scheme, which does not store any partition UUID or label.
The Linux kernel only creates synthetic partition UUIDs from the disk identifier in the MBR and the partition numbers, but this won't change as the partition number does not change.