On This Page
Increasing the Partition Size on a Virtual Machine
You can increase the size of partitions on virtual machines to take advantage of unallocated storage space. The procedures below are examples of how you can increase the size of /tmp, /opt and /var partitions. However, you can use these examples to help you increase the size of any partition on a virtual machine.
- Example #1: Increase the size of /tmp and /opt partitions
- Example #2: Increase the size of /var partitions
Example #1: Increase The Size of /tmp and /opt Partitions
This procedure will explain how to add 20 GB to the /tmp partition and 87 GB to the /opt partition.
-
Log into the TOS CLI as user with root privileges.
-
Perform a TOS Backup.
-
Run the following command to show the amount of space used by each partition.
# df -h
In the image above /tmp is 5 GB and /opt is 13 GB.
The partitions need to be increased as follows:
- /tmp = 25 GB
- /opt = 100 GB
Therefore, you will have to insert a new disk with an extra 107 GB to the virtual machine.
- /tmp needs 20 GB
- /opt needs 87 GB
-
Insert the new virtual disk with the desired size to the virtual machine.
-
Stop all TOS services.
-
Run the command:
This process may take time.
- Check that all processes have been stopped successfully. Run the command:
-
Wait until all the pods, with the exception of the service controller, ps-proxy, and reportpack pods, have disappeared from the list or reached a status of Completed. The service controller, ps-proxy, and reportpack pods which can continue running.
All TOS processes are now stopped on all the data nodes in the cluster.
A list of all pods is displayed.
Example
-
-
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*
-
Add the new disk to the LVM volume group.
# pvcreate /dev/sdb
# vgextend VolGroup01 /dev/sdb -
Locate the /tmp partition logical volume (see image above).
# df -h
In this example the logical volume of /tmp is /dev/mapper/VolGroup01-LogVol06
-
Extend the LVM logical volume of the /tmp partition to 20 GB.
# lvextend -r -L +20GB /dev/mapper/VolGroup01-LogVol06
-
Verify that the storage space was added to the /tmp partition.
# df -h | grep "[\t ]\+/tmp"
-
Locate the /opt partition logical volume (see image above).
# df -h
In this example the logical volume of /opt is /dev/mapper/VolGroup01-LogVol08
-
Extend the LVM logical volume of the /opt partition to use all remaining free space (87 GB).
# lvextend -r -l +100%Free /dev/mapper/VolGroup01-LogVol08
-
Verify that the storage space was added to the /opt partition.
# df -h | grep "[\t ]\+/opt"
-
Press
CTRL+C
to cancel the previous commands. -
Restart the TOS services.
[primary data node]# sudo tos start
These instructions are for sdb.
Example #2: Increase The Size of the /var Partition
-
Add a new virtual disk with the desired size to the virtual machine.
-
Log into the TOS CLI as user with root privileges.
-
Perform a TOS Backup.
-
Stop all TOS services.
-
Run the command:
This process may take time.
- Check that all processes have been stopped successfully. Run the command:
-
Wait until all the pods, with the exception of the service controller, ps-proxy, and reportpack pods, have disappeared from the list or reached a status of Completed. The service controller, ps-proxy, and reportpack pods which can continue running.
All TOS processes are now stopped on all the data nodes in the cluster.
A list of all pods is displayed.
Example
-
-
Verify the new disk is recognized by the operating system.
# ls -l /dev/sd*
-
Add the new disk to the LVM volume group.
# pvcreate /dev/sdb
# vgextend VolGroup01 /dev/sdb -
Locate the /var partition logical volume.
# df -h
In this example the logical volume of /var is /dev/mapper/VolGroup01-LogVol02
-
Extend the LVM logical volume of the /var partition to include all free storage space.
# lvextend -r -l +100%FREE /dev/mapper/VolGroup01-LogVol02
-
Verify that the storage space was added to the /var partition.
# df -h | grep "/var[\t ]*$"
-
Restart the TOS services.
[primary data node]# sudo tos start
These instructions are for sdb.