These instructions guide you through the initial setup of your hard drive partitions using the cgdisk utility . If you do not wish to continue creating your own partitions, return to the bare metal manual installation.

Prerequisites

This guide assumes that you have followed the Install Clear Linux* OS on bare metal (automatic) guide and intend to install Clear Linux manually by choosing the < Manual(Advanced) > menu item on the Choose Installation Type Clear Linux OS Installer setup menu as shown in figure 1:

Choose installation Type

Figure 1: Choose installation Type

Partition using CGDISK

We use the cgdisk application to create a GPT since Clear Linux OS only supports the UEFI specification. For a complete description of the cgdisk utility and how to use it, visit Rod Smith’s website for a GPT fdisk tutorial.

In this guide, we intend to use an unpartitioned hard drive for the Clear Linux OS installation.

  1. To manually partition your hard drive, select < Manually configure mounts and partitions > in the menu Choose partitioning method, shown in figure 2.

    Choose partitioning method

    Figure 2: Choose partitioning method

    Next, the current device available to partition is shown. In this example, shown in figure 3, /dev/sda is available but does not have any partitions defined.

  2. Select the < Partition /dev/sda > menu item and press Enter to begin the process of modifying this disk.

    Choose a drive to partition using cgdisk tool

    Figure 3: Choose a drive to partition using cgdisk tool

    The cgdisk application starts and displays the settings for /dev/sda as shown in figure 4.

    cgdisk

    Figure 4: cgdisk

Linux partition setup

In order to properly set up the Clear Linux OS partitioning scheme, we create three partitions using the cgdisk utility in the following order:

  1. EFI boot partition
  2. Linux swap partition
  3. Linux root partition

For a complete understanding of these partitions, you can review the Linux partitioning scheme information.

Create the EFI boot partition

  1. With the free space highlighted in the cgdisk utility, you can either select the [ New ] button and press Enter or press the N key to define a new partition.

    The utility prompts you to enter the first sector. Press the Enter key to accept the default value shown.

    Note

    In this example, the first sector starts at 2048. For more information about alignment using the cgdisk tool, see Rod Smith’s Partitioning Advice about alignment.

  2. The program then prompts you for the size of the partition. To create a 512MB partition, enter 512M and press Enter as shown in figure 5:

    cgdisk - New

    Figure 5: cgdisk - New partition

  3. To define the type of partition, the cgdisk utility has pre-defined partition types. Press the L key to show the hex codes you can use. Use these codes to set the correct GUID for GPT partition types as shown in figure 6:

    cgdisk - hex codes for partition types

    Figure 6: cgdisk - hex codes for partition types

    We need to use the following three codes for our partitions:

    • ef00 - EFI System
    • 8200 - Linux swap
    • 8300 - Linux filesystem
  4. To create the EFI boot partition, enter ef00 as the hexcode for this partition and press Enter.

  5. To name the partition, enter boot and press Enter to finish setting up the EFI boot partition. The utility shows the first partition as an EFI System 512MiB partition named boot as shown in figure 7:

    cgdisk - boot partition defined

    Figure 7: cgdisk - boot partition defined

Create the Linux swap partition

Next, we must create the Linux swap partition. In figure 7, notice the two areas defined as free space. We created the first 1007.0 KiB free space area when we started the EFI boot partition at sector 2048. For more information about it, review Rod Smith’s Partitioning advice about alignment.

  1. Move your cursor to highlight the larger free space of 334.8 GiB at the bottom of the partition list before you begin to create the Linux swap partition as shown in figure 8:

    cgdisk - free space selection

    Figure 8: cgdisk - free space selection

  2. To create the Linux swap partition, with the largest free space highlighted, select the [ New ] button or press the N key and enter the following values for the Linux swap partition:

    First sector:  press :kbd:`Enter` to select the default value
    Size in sectors:  4G
    Hex code or GUID:  8200
    Enter new partition name:  swap
    

    Your cgdisk partition list should now look like figure 9.

    cgdisk - swap partition defined

    Figure 9: cgdisk - swap partition defined

Create the Linux filesystem partition

Lastly, we must create the the Linux filesystem partition to use it as the root mount point for you Clear Linux OS installation.

  1. Highlight the largest free space entry at the bottom of the list and select the [ New ] button or press the N key and enter the following values to create the Linux filesystem partition:

    First sector:  press :kbd:`Enter` to select the default value
    Size in sectors:  press :kbd:`Enter` to select the default value, which
                      is the remainder of available space on the disk
    Hex code or GUID:  8300
    Enter new partition name:  root
    

    With all the partitions now defined, you should see a list similar to what is shown in figure 10:

    cgdisk - defined partitions

    Figure 10: cgdisk - defined partitions

  2. If you are satisfied that the partition scheme is correct, you need to write this GPT to the hard drive. Select the [ Write ] button or press the W key and the cgdisk program prompts with:

    Are you sure you want to write the partition table to disk? (yes or no)
    
  3. Enter yes and press Enter to write this data to the hard drive and then select the [ Quit ] button or press Q to exit the cgdisk utility.

  4. You see the partitions that were created as shown in figure 11. Move your cursor to the < Next > button and press Enter.

    defined partitions

    Figure 11: defined partitions

Set the mount points

The Set mount points menu sets the mount points that the Clear Linux OS installer uses for your Clear Linux OS installation, shown in figure 12.

Set mount points

Figure 12: Set mount points

In this menu you need to set the mount points for the boot and root partitions and select to format them.

  1. Highlight the EFI System partition type menu entry and press the Enter key to edit this item. The Set mount point of sda1 menu is shown.

    1. For Enter mount point: type /boot and press Enter.
    2. Press Tab to enter the [ ] Format field.
    3. Press Enter/Spacebar to select [ ] Format, which allows formatting of the partition.

    Figure 13 shows the information entered. Select < Next > and press Enter.

    Set mount point of sda1

    Figure 13: Set mount point of sda1

  2. Do the same for the Linux filesystem partition by highlighting the Linux filesystem menu entry and entering the information shown in figure 14 to set the Enter mount point: to / and enable formatting:

    Set mount point of sda3

    Figure 14: Set mount point of sda3

  3. Optional: Select Encrypt Root Partition, if desired, as shown in figure 15.

    Note

    Set mount points now show as completed.

    Encrypt root partition

    Figure 15: Encrypt root partition

  4. Type a confirmation passphrase as directed.

    Type confirmation passphrase

    Figure 16: :guilabel: Type confirmation passphrase

  5. Select the < Next > button and press Enter.

    You have completed the process of manually partitioning your target system.

  6. Now, return to the bare metal manual installation to complete installation of Clear Linux OS.

    Continue at the section Additional manual installer settings.