Creating primary partitions

To perform this procedure, you need:
  • The password of the root user account on a Linux host or a user account that belongs to the wheel group.
  • A Linux host with at least one local or remote disk.

This procedure demonstrates how to create primary partitions on a disk. Each primary partition can be formatted as a file system or swap space, used in a device mapper thin pool, or reserved for future use. Each disk must have one primary partition, and can have up to four. If you are uncertain whether a disk is partitioned, see the preceding topic.

  1. Log in to the target host as root, or as a user with superuser privileges.
  2. Start the partition table editor for the target disk.
    In this example, the target disk is /dev/sdb, and it has no entries in its partition table.
    cfdisk /dev/sdb
    Figure 2. Initial screen

    The cfdisk command provides a text user interface (TUI) for editing the partition table. The following list describes how to navigate through the interface:

    • To select an entry in the table, use the up and down arrow keys. The current entry is highlighted.
    • To select a command from the menu at the bottom of the interface, use the left and right arrows or Tab and Shift-Tab. The current command is highlighted.
    • To choose a command, press Enter.
    • To return to the previous level of the menu, press Esc.
    • To exit the interface, select Quit and then press Enter.

    For more information about cfdisk, enter man cfdisk.

  3. Create a new partition.
    Repeat the following substeps to create up to four primary partitions.
    1. Select the table entry with the value Free Space in the FS Type column.
    2. Select [New] and press Enter.
    3. Select [Primary] and press Enter.
    4. At the Size (in MB) prompt, enter the size of the partition to create in megabytes, and then press Enter.
      To accept the default value (all free space on the disk), press Enter.
    5. Optional: Select [Beginning] and press Enter.
      Figure 3. One primary partition
  4. Write the partition table to disk, and then exit the partition table editor.
    1. Select [Write] and press Enter.
    2. At the confirmation prompt, enter yes and then press Enter.
      You can ignore the warning about a bootable partition.
    3. Select [Quit] and press Enter.