Prepare hard drive for installation (GPT/EFI)
This chapter is intended for UEFI/GPT partition, if your motherboard doesn’t support UEFI or you want to dual boot with Windows, then you need MBR partition table, please refer to the MBR chapter.
Find the block device name with ‘lsblk’ command:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 111.8G 0 disk
In my case, the block device or SSD on which I will be installing Arch Linux is ‘/dev/sda’
We are using the ‘Parted’ tool to create the partition table. Run the ‘parted’ command against the block device, which in my case is ‘/dev/sda’.
# parted /dev/sdX
Replace ‘sdX’ with your block device name, in my case it was:
# parted /dev/sda
You will notice that ‘#’ is replaced by ‘(parted)’ that means you are running the parted command. We have to first create a partition table with gpt.
(parted) mklabel gpt
It will warn you about destroying all data, type ‘yes’. We will now create three partitions: UEFI boot partition, root partition and optional swap using the following pattern:
(parted) mkpart part-type fs-type start end
In case of UEFI boot partition, the part-type is ESP (EFI System Partition); the file system will be FAT 32 and we will allocate at least 512MB for this partition. The start point is 1MiB and the end point is 513MiB.
(parted) mkpart ESP fat32 1MiB 513MiB
Set boot flag on it:
(parted) set 1 boot on
For root, the part-type will be primary; the file system will be ext4. Just keep in mind that the start point for the next partition is the end point of the previous partition. We are creating root partition with 40GB space.
(parted) mkpart primary ext4 513MiB 40GiB
As you can see the start point is 513MB and end point is 40GB, which means it will create a 40GB partition. I am giving 40GB to root because I don’t create a separate home partition, it’s created inside the root partition.
Once the root partition is created we will create the swap partition. For swap the file system will be ‘linux-swap’ and the end point for the previous partition will become the start point for next partition:
(parted) mkpart primary linux-swap 40GiB 42GiB
I am creating 2GB of swap because I have over 32GB of RAM on this system and I really don’t need any swap partition. If you have a good amount of RAM, you don’t really need swap. However, you do need it if you use ‘suspend to memory’ feature which I doubt anyone uses these days.
If you want, you can create more partitions, just use the same pattern. Just bear that end point of the previous partition is the start point for the next partition. If you want to use all of the remaining free space then used 100% as the end point.
An example:
(parted) mkpart primary ext4 42GiB 100%
This will create another partition with remaining free space.
Check if the partitions are created correctly by running the ‘print’ command:
(parted) print
If everything looks good, exit ‘parted’ tool with ‘quit’ command:
(parted) quit






