Increasing Partition Size

Overview

This procedure describes how to increase the size of /tmp, /opt and /var partitions on virtual machines after adding a new disk.

To increase the partition size, add a new virtual disk. Do not expand the existing disk.

Partitions /tmp and /opt

  1. Log into the TOS CLI as user with root privileges.

  2. Perform a TOS Backup.

  3. Run the following command to show the amount of space used by each partition.

    # df -h

  4. If not already done, add the new virtual disk to the virtual machine.

  5. Once all the pods have been terminated, verify the new disk is recognized by the operating system. If the new disk does not appear, you may need to reboot your system.

    # ls -l /dev/sd*

  6. If this is the first new disk you are adding, it will appear as sdb. The last letter advances each time a new disk is added. Therefore if disks were previously added, you may see sdc, sdd, or sde. It depends on the number of disks added.
    These instructions are for sdb.
  7. Add the new disk to the LVM volume group.

    # pvcreate /dev/sdb
    # vgextend VolGroup01 /dev/sdb

  8. Locate the /tmp partition logical volume (see image above).

    # df -h

    Example Output:

  9. Extend the LVM logical volume of the /tmp partition.

    # lvextend -r -L +<additon>GB <vol>

    where:

    • <addition> is the number of GB to add to the existing partition size

    • <tmpvol> is the logical volume name for /tmpvol e.g /dev/mapper/VolGroup01-LogVol06

  10. Verify that the storage space was added to the /tmp partition.

    # df -h | grep "[\t ]\+/tmp"

  11. Locate the /opt partition logical volume (see image above).

    # df -h

    In this example the logical volume of /opt is /dev/mapper/VolGroup01-LogVol08

  12. Extend the LVM logical volume of the /opt partition to use all remaining disk space

    # lvextend -r -l +100%Free <optvol>

    where:

    • <optvol> is the logical volume name for /opt e.g is /dev/mapper/VolGroup01-LogVol08

  13. Check the new total storage space in the /opt partition.

    # df -h | grep "[\t ]\+/opt"

  14. Press CTRL+C to cancel the previous commands.

  15. Restart the TOS services.

    [primary data node]# sudo tos start

Partition /var

The /var partition uses all free space on the virtual disk. Do not share the virtual disk space with other partitions.
  1. Add a new virtual disk with the desired size to the virtual machine.

  2. Log into the TOS CLI as user with root privileges.

  3. Perform a TOS Backup.

  4. Verify the new disk is recognized by the operating system.

    # ls -l /dev/sd*

  5. If this is the first new disk you are adding, it will appear as sdb. The last letter advances each time a new disk is added. Therefore if disks were previously added, you may see sdc, sdd, or sde. It depends on the number of disks added.
    These instructions are for sdb.
  6. Add the new disk to the LVM volume group.

    # pvcreate /dev/sdb
    # vgextend VolGroup01 /dev/sdb

  7. Locate the /var partition logical volume.

    # df -h

    Example output:

    In this example the logical volume of /var is /dev/mapper/VolGroup01-LogVol02

  8. Extend the LVM logical volume of the /var partition by all the remaining free space on the disk.

    # lvextend -r -l +100%FREE /dev/mapper/VolGroup01-LogVol02

  9. Check the new total storage space in the /var partition.

    # df -h | grep "/var[\t ]*$"

  10. Restart the TOS services.

    [primary data node]# sudo tos start