1: it doesn't have to do anything with primary/extended/logical partitions.
2: I think you wanted to say "logical" partition instead of "extended".
3: mkfs thinks your partition size if 0 bytes. It was very surely, because the kernel wasn't able to update the partition table after a repartitioning. After you edited the partition table, didn't you get some warnings about that a reboot is needed?
On Linux, there is two different partition table: there is one on the zeroth block of the hard disk. And there is one in the kernel memory. You can read the first with an
fdisk -l /dev/sda command. And the second can you read with a
cat /proc/partitions command. These two need to be in sync, but it is not always possible. For example, you can't change the limits of a currently used partition. In this case, the kernel partition table won't changed.
You can let the kernel re-read the disk partition table with the command
blockdev --rereadpt /dev/sda. Most partitioning tools execute this command after they wrote out your newly changed partition table to the disk.
The problem is that only newer linux kernels are capable to re-read a partition table of a used hard disk. From this viewpoint, a hard disk is considered as "used" if there is a simple partition which is used on it, either by a tool, or a mount point or it is an active swap partition.
And even these newer kernels aren't able to change the limits of a partition currently being used.
I think, your root system is on
/dev/sda, thus you need to do a reboot after you did a repartitioning.