parted

Install

apt-get install -y parted
parted /dev/sdX print
parted /dev/sdX unit MB print free
 
parted /dev/sdX unit GB mkpart primary ntfs 468 520
 
parted /dev/sdX mkpart primary ext2 468GB 520GB
 
parted /dev/sdX mkpart primary ext2 468012 520008
 
sudo parted -s /dev/sdX mkpart primary 0% 100%
sudo parted -s /dev/sdX mklabel msdos
 
parted /dev/sdX -s rm 1
parted /dev/sdX -s mklabel msdos
parted /dev/sdX -s mkpart primary ext4 0% 99%
parted /dev/sdX -s mkpart primary linux-swap 99% 100%
 
parted /dev/sdX -s rm 1
parted /dev/sdX -s mklabel msdos
parted /dev/sdX -s mkpart primary 1 256G
parted /dev/sdX -s mkpart primary 256G 128G
parted /dev/sdX -s mkpart primary 2048s 100%
parted /dev/sdX -s set 1 raid on