With this line:
(echo o; echo n; echo p; echo 1; echo ; echo +24G; echo a; echo t; echo 7; echo w) | fdisk /dev/sda
I can create a new active primary partition for NTFS, 24 Giga large. The syntax is ugly but effective.
How can I do the same with parted or sfdisk?