Create partitions

The partitions can be created by script commands or you can use interactive console programs like fdisk or cfdisk. The programs is navigated by keys (arrows, letters, enter and esc) or you can script it using gdisk.

From our previous example system listing above - our main disk device is labeled sda and for this guide we use cfdisk.

Note: This command uses the --zero argument to empty the partition table of the selected disk.

# cfdisk --zero /dev/sda

Select gpt label type when prompted and press Enter

The cfdisk is a three part window

  • Top: various device information
  • Center: shows partition info
  • Bottom: displays commands and a short description

There is two (2) block cursors

  • object cursor
  • action cursor

To do something you need to select an object and a command.

Create the partitions according the layout described above.

Be very careful to set the partition type exactly as described as we will let systemd mount the partitions according to partition type. You may expect us to later create a fstab file - surprise - we won't - and you will learn something about Discoverable Partitions Specification

  1. EFI or $esp
    • Select Free space using or .
    • Select New using or Enter.
    • 300M press Enter.
    • Select TypeEnter.
    • Select EFI SystemEnter.
  2. swap partition.
    • Select Free spaceNewEnter.
    • Enter size 2GEnter.
    • Select TypeEnter.
    • Select Linux swapEnter.
  3. root partition.
    • Select Free spaceNew &rarr Enter.
    • Enter size 32GEnter
    • Select TypeEnter.
    • Select Linux root (x86_64)Enter.
  4. home partition.
    • Select Free spaceNewEnter.
    • Enter to assign the remaining space to home.
    • Select TypeEnter.
    • Select Linux homeEnter.
  5. Save the changes
    • Select WriteEnter
    • Input yes when prompted → Enter
    • Select QuitEnter