If you have used 'fdisk' in the past then you recognize this output! I do an echo and use a shell 'Here-Document' to feed input to 'fdisk'.
There are two fdisk sections -- the first one is a trick used to destroy the current partitioning -- it writes an empty DOS partition to the disk. (I need to revisit the
clearpart --all --initlabel