This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Partitioning of Disk on an Appliance

Firmware is low-level software that is responsible for initializing the hardware components of a system during the boot process. It is required to initialize the boot process. It provides runtime services for the operating system and the programs on the system. There are two types of boot modes in the system setup, Basic Input/Output System (BIOS) and Unified Extensible Firmware Interface (UEFI).

BIOS is amongst the oldest systems used as a boot loader to perform the initialization of the hardware. UEFI is a comparatively newer system that defines a software interface between the operating system and the platform firmware. The UEFI is more advanced than the BIOS and most of the systems are built with support for UEFI and BIOS.

Disk Partitioning is a method of dividing the hard drive into logical partitions. When a new hard drive is installed on a system, the disk is segregated into partitions. These partitions are utilized to store data, which the operating system reads in a logical format. The information about these partitions is stored in the partition table.

There are two types of partition tables, the Master Boot Record (MBR) and the GUID Partition Table (GPT). These form a special boot section in the drive that provides information about the various disk partitions. They help in reading the partition in a logical manner.

Depending on the requirements, you can extend the size of the partitions in a physical volume to accommodate all the logs and other ESA related data. You can utilize the Logical Volume Manager (LVM) to increase the partitions in the physical volume. Using LVM, you can manage hard disk storage to allocate, mirror, or resize volumes.

In an ESA, the physical volume is divided into the following three logical volume groups:

PartitionDescription
BootContains the boot information.
PTYVGContains the files and information about OS and logs.
Data Volume GroupContains the data that is in the /opt directory.

1 - Partitioning the OS in the UEFI Boot Option

The PTYVG volume partition is divided into three logical volumes. These are the PTYVG-OS, the PTYVG-OS_bak, and the PTYVG-LOGS volume. The PTYVG volume partition contains the OS information.

The following table illustrates the partitioning of the volumes in the PTYVG directory.

Logical VolumeDescriptionDefault Size
PTYVG-OSThe root partition16 GB
PTYVG-OS_bakThe backup for the root partition16 GB
PTYVG-LOGSThe logs that are in the /var/log directory12 GB

In the UEFI mode, the sda1 is the EFI partition which stores the UEFI executables required to perform the booting process for the system. This .efi file points to the sda3 partition where the GRUB configurations are stored. The grub.cfg file initiates the boot process.

The following table illustrates the partitioning of all the logical volume groups in a single hard disk system.

Table: Partition of Logical Volume Groups

PartitionPartition NamePhysical VolumeVolume GroupDirectoryDirectory PathSize
/dev/sdasda1 EFI Partition  400M
sda2    100M
sda3 BOOT  900M
sda4Physical Volume 1PTYVGOS/16G
OS_bak 16G
logs/var/log12G
sda5Physical Volume 2PTYVG_DATAopt 50% of rest
opt_bak 50% of rest

As shown in the table, the sda1 is the EFI Partition and contains information up to 400 MB. The sda2 is the Unallocated Partition which is required for supporting the GPT and occupies 100 MB. The sda3 is the Boot Partition volume group. It can contain information up to 900 MB. The sda4 is the PTYVG partition and uses 44 GB of hard disk space to store information about the OS and the logs. The remaining partition size is allotted for the data volume group.

  • For Cloud-based platforms, the opt_bak and the OS_bak directories are not available in the data volume group. The data in the PTYVG_DATA partition is available in the opt directory only.

  • If you want to use the EFI Boot Option for the ESA, then select the required option while creating the machine.

2 - Partitioning the OS with the BIOS Boot Option

Depending on the requirements, you can extend the size of the partitions in a physical volume to accommodate all the logs and other ESA related data. You can utilize the Logical Volume Manager (LVM) to increase the partitions in the physical volume. Using LVM, you can manage hard disk storage to allocate, mirror, or resize volumes.

In an ESA, the physical volume is divided into the following three logical volume groups:

PartitionDescription
BootContains the boot information
PTYVGContains the files and information about OS and logs
Data Volume GroupContains the data that in the /opt directory

The PTYVG volume partition contains the OS information. You must increase the PTYVG volume group to extend the root partition. The following table describes the different logical volumes in the PTYVG volume group.

Logical VolumeDescriptionDefault Size
OSThe root partition
  • 8 GB for upgrading the ESA from 9.0.0.0 and 9.1.0.x to v9.2.0.0 and higher versions.
  • 16 GB for ISO and cloud installation.
OS-bakThe backup for the root partition
  • 8 GB for upgrading the ESA from 9.0.0.0 and 9.1.0.x to v9.2.0.0 and higher versions.
  • 16 GB for ISO installation.
LOGSThe logs that are in the /var/log directory
  • 6 GB for upgrading the ESA from 9.0.0.0 and 9.1.0.x to v9.2.0.0 and higher versions.
  • 12 GB for ISO and cloud installation.
SWAPThe swap partition
    By default, 2 GB for appliances products.
    The swap partition for ESA is 8 GB.

The following table illustrates the partitioning of all the logical volume groups in a single hard disk system.

Table: Partition of Logical Volume Groups

PartitionPartition NamePhysical VolumeVolume GroupDirectoryDirectory PathUpgraded Appliances SizeISO and Cloud Installation Size
/dev/sdasda1   /boot 400M
sda2     100M
sda3Physical Volume 1PTYVGOS/8G16G
OS_bak 8G16G
logs/var/log6G12
swap[SWAP]By default, 2G for appliances products.
The swap partition for ESA is 8G.
sda4Physical Volume 2PTYVG_DATAopt/opt/docker/lib50% of rest
opt_bak 50% of rest
  • For Cloud-based platforms, the OS_bak directory is not available in the data volume group. The data in the PTYVG partition is available in the OS directory only.
  • For Cloud-based platforms, the opt_bak directory is not available in the data volume group. The data in the PTYVG_DATA partition is available in the opt directory only.

If multiple hard disks installed on an ESA, then you can select the required hard disks for configuring the OS volume and the data volume. You can also extend the OS partition or the disk partition across the hard disks that are installed on the appliance.

The following table illustrates an example of partitioning in multiple hard disks.

Table: Partitioning in Multiple Hard Drives

PartitionPartition NamePhysical VolumeVolume GroupDirectoryDirectory PathUpgraded Appliances SizeISO and Cloud Installation Size
/dev/sdasda1   /boot 400M
sda2     100M
sda3Physical Volume 1PTYVGOS/8G16G
OS_bak 8G16G
logs/var/log6G12G
swap[SWAP]By default, 2G for appliances products.
The swap partition for ESA is 8G.
sda4Physical Volume 2PTYVG_DATAopt/opt/docker/lib50% of rest
opt_bak 50% of rest
PartitionPhysical VolumeVolume GroupDirectoryDirectory PathSize
/dev/sdbPhysical Volume 1PTYVG_DATAopt/opt/docker/lib50%
opt_bak 50%
  • For Cloud-based platforms, the OS_bak directory is not available in the data volume group. The data in the PTYVG partition is available in the OS directory only.
  • For Cloud-based platforms, the opt_bak directory is not available in the data volume group. The data in the PTYVG_DATA partition is available in the opt directory only.

The hard disk, sda, contains the partitions for the root and the PTYVG volumes. The hard disk, sdb contains the partition for the data volume group.

Extending the OS partition

The following sections describe the procedures to extend the OS partition.

Before you begin

Before extending the OS partition, it is recommended to back up your ESA. It ensures that you can roll back your changes in case of an error.

When you add a new hard disk to the partition, you should restart the system. This ensures that all the hard disks appear.

  • For the Cloud-based platforms, the names of the hard disks may get updated after restarting the system.
  • Ensure that the you verify the names of the hard disks before proceeding further.

Starting in Single User Mode

You must load in the Single User Mode to change the kernel command line.

For Cloud-based platforms, the Single User Mode is unavailable. It is recommended to perform the following operations from the OS Console. While performing these operations, ensure that the system is accessible by only a single user.

To boot into Single User Mode:

  1. Install a new hard disk on the ESA.

    For more information about installing a new hard disk, refer here.

  2. Boot the ESA in Single User Mode.

  3. If the GRUB Credentials are enabled, the screen to enter the GRUB credentials appears. Enter the credentials and press ENTER.

    The following screen appears.

  4. Select Normal and press E.

    The following screen appears.

  5. Select the linux/generic line and append <SPACE>S to the end of the line as shown in the following figure.

  6. Press F10 to restart the ESA.

    After the ESA is restarted, a prompt to enter the root password appears.

  7. Enter the root password and press ENTER.

Creating a Partition

After editing the kernel command line, you must create the required partitions.

The following procedure describes how to create a partition on a new hard disk, sdb. You can add multiple hard disks to the ESA.

  • If you add multiple hard disks to the ESA, then the devices are created as /dev/sdb, /dev/sdc, /dev/sdd, and so on. You can select the required hard disk based on the storage space available.

  • For Cloud-based platforms, the names of the hard disk might differ. Based on the cloud platform, the hard disk names may appear as nvme1n1, xvdb, or so on.

To create a partition:

  1. Run the following command to list the hard disks that are available.

    lsblk
    
  2. Run the following command to format the partition.

    fdisk /dev/sdb
    
  3. Type o to create a partition table and press ENTER.

  4. Type n to create a new partition and press ENTER.

  5. Type p to create a primary partition and press ENTER.

  6. In the following prompt, assign a partition number to the new partition.

    If you want to enter the default number for the partition, then press ENTER.

  7. Type the required starting partition sector for the partition.

    If you want to enter the default sector for the partition, then press ENTER.

  8. Type the last sector for the partition and press ENTER.

    If you want to enter the default sector for the partition, then press ENTER.

  9. Type t to change the type of the new partition and press ENTER.

  10. Type 8e to convert the disk partition to Linux LVM and press ENTER.

  11. Type w to save the changes and press ENTER.

    A message The partition table has been altered! appears.

  12. Run the following command to initialize the disk partition that is used with LVM.

    pvcreate /dev/sdb1
    

    For Cloud-based platforms, you should use the name of the disk partition only. For instance, if the name of the hard disk on the Cloud-based platform is nvme0n1, then run the following command to initialize the disk partition that is used with LVM.

    pvcreate /dev/nvme0n1
    

    If the following confirmation message appears, then press y.

     WARNING: dos signature detected on /dev/sdb1 at offset 510. Wipe it? [y/n]: y
    

    A message Physical volume “/dev/sdb1” is successfully created appears.

  13. Run the following command to extend the PTYVG volume.

    vgextend PTYVG /dev/sdb1
    

    A message Volume group “PTYVG” successfully extended appears.

Extending the OS and the Backup Volume

After extending the PTYVG volume you can resize the OS and the OS_bak volumes using the lvextend and resize commands.

Ensure that you consider the following points before extending the partitions in the PTYVG volume group:

  • Back up the OS partition before extending the partition.
  • Back up the policy, LDAP, and other required data to the /opt directory before extending the volume.

The following procedure describes how to extend the OS and the OS_bak volumes by 4 GB.

Ensure that there is enough free space available while extending the size of the OS, the OS_bak, and the log volumes. For instance, if you extend the hard disk by 1 GB and if the space is less than the required level, then the following error appears.

Insufficient free space: 1024 extents needed, but only 1023 available

To resolve this error, you must increase the partition size by 0.9 GB.

To create a partition:

  1. Run the following commands to extend the OS-bak and OS volume.

    # lvextend -L +4G /dev/PTYVG/OS_bak
    

    A message Logical Volume OS_bak successfully resized appears.

    Ensure that the you extend the size of the OS and the OS_bak volumes to the same value.

  2. Run the following command to resize the file system in the OS_bak volume.

    # resize2fs /dev/mapper/PTYVG-OS_bak
    

    A message resize2fs: On-Line resizing finished successfully appears.

  3. Run the following commands to extend the OS volume.

    # lvextend -L +4G /dev/PTYVG/OS
    

    A message Logical Volume OS successfully resized appears.

  4. Run the following command to resize the file system in the OS volume.

    # resize2fs /dev/mapper/PTYVG-OS
    

    A message resize2fs: On-Line resizing finished successfully appears.

  5. Restart the ESA.

Extending the Logs Volume

You can resize the logs volume using the lvextend and resize commands. This ensures that you provision the required space for the logs that are generated. You must back up the current logs to the /opt directory before extending the logs volume.

Before extending the logs volume, ensure that you start the ESA in Single User Mode and create a partition.

For more information about Single User Mode, refer here.

For more information about creating a partition, refer here.

The following procedure describes how to extend the logs volume by 4 GB.

To extend the logs volume:

  1. Run the following commands to create a temporary folder in the /opt directory.

    # mkdir /opt/tmp/logs
    
  2. Run the following command to copy the files from the logs volume to the /opt directory.

    # /usr/bin/rsync -axzHS --delete-before /var/log/ /opt/tmp/logs/
    

    While copying the logs from the /var/log/ directory to the /opt directory, ensure that the space available in the /opt directory is more than the size of the logs.

  3. Run the following commands to extend the logs volume.

    # lvextend -L +4G /dev/PTYVG/logs
    

    A message Logical Volume logs successfully resized appears.

  4. Run the following command to resize the file system in the logs volume.

    # resize2fs /dev/mapper/PTYVG-logs
    

    A message resize2fs: On-Line resizing finished successfully appears.

  5. Run the following command to copy the files from /opt directory to the logs volume.

    # /usr/bin/rsync -axzHS --delete-before /opt/tmp/logs/ /var/log/
    
  6. Run the following command to remove the temporary folder created in the /opt directory.

    # rm -r /opt/tmp/logs
    
  7. Restart the ESA.