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.
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:
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.
To manually partition your hard drive, select < Manually configure mounts and partitions > in the menu Choose partitioning method, shown in figure 2.
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.
Select the < Partition /dev/sda > menu item and press Enter to begin the process of modifying this disk.
The cgdisk application starts and displays the settings for /dev/sda as shown in figure 4.
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:
- EFI boot partition
- Linux swap partition
- Linux root partition
For a complete understanding of these partitions, you can review the Linux partitioning scheme information.
Create the EFI boot partition
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.
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.
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:
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:
We need to use the following three codes for our partitions:
- ef00 - EFI System
- 8200 - Linux swap
- 8300 - Linux filesystem
To create the EFI boot partition, enter ef00 as the hexcode for this partition and press Enter.
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:
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.
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:
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.
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.
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:
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)
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.
You see the partitions that were created as shown in figure 11. Move your cursor to the < Next > button and press Enter.
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.
In this menu you need to set the mount points for the boot and root partitions and select to format them.
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.
- For Enter mount point: type /boot and press Enter.
- Press Tab to enter the [ ] Format field.
- Press Enter/Spacebar to select [ ] Format, which allows formatting of the partition.
Figure 13 shows the information entered. Select < Next > and press Enter.
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:
Optional: Select Encrypt Root Partition, if desired, as shown in figure 15.
Set mount points now show as completed.
Type a confirmation passphrase as directed.
Select the < Next > button and press Enter.
You have completed the process of manually partitioning your target system.
Now, return to the bare metal manual installation to complete installation of Clear Linux OS.
Continue at the section Additional manual installer settings.