FATAL ERROR: Bad primary partition 0: Partition ends in the final partial cylinder: This error occurs when cfdisk is trying to read a partition tables of your storage device. If it finds some problems it will throw a fatal error and exit. One way around this problem is to kill / remove any existing partitions and start again. Be careful with the following command and make sure that you are not killing a pratitions on your production hard drive ( you have been warned ! ). When running this command a cfdisk will not try to read partition tables and their geometry. This step wil be completelly ignored and cfdisk will present you with free unpartitioned space.

cfdisk -z /dev/XYZ

now create a new partitions and write changes.