mango@pineapple:~$ sudo sfdisk -d /dev/sda
# partition table of /dev/sda
unit: sectors
/dev/sda1 : start= 63, size= 30041487, Id=83, bootable
/dev/sda2 : start= 30041550, size= 1413720, Id= 5
/dev/sda3 : start= 0, size= 0, Id= 0
/dev/sda4 : start= 0, size= 0, Id= 0
/dev/sda5 : start= 30041613, size= 1413657, Id=82
Using sfdisk with the -d option we can get a dump of the current partition table in a regular file, and if needed we can restore it from that file:
sfdisk -d /dev/sda > sdaTable
and to restore the partition table:
sfdisk /dev/sda <>sdaTable