I am writing a script (for learning purpose) which will help me to automate Arch Linux installation. In this script, I am stuck at partitioning. Although, I know that how to partition using fdisk, cfdisk, gparted, but all these tools require manual intervention. However, I want to create partition automatically. In this respect, I have to embed following steps in my script:
- Create GPT partition table on /dev/sda
- Create primary boot partition - efi (FAT32) - 500MB - /dev/sda1
- Create primary root partition - ext4 - 17GB - /dev/sda2
- Create primary swap partition - swap - 2GB - /dev/sda3
I know that filesystem can later be implemented via mkfs command. However, in case of EFI and SWAP partition, it is necessary to tell system (at the time of partitioning) that this is not regular "Linux" partition. Can you guide me that how can I achieve these steps automatically in my script?