**This document outlines how to resize a partition on a Turbonomic/CentOS VM using a new disk added.**
**Be aware** :
This article explains how to add a new virtual disk and to assign all space on that disk to the Turbo logical volume group using:
vgextend turbo /dev/sdb
This could cause a problem if later someone attempts to create a new numbered physical volume on this disk, ie :
If this is done on a disk where as above pvcreate has already been used to create a volume of the whole disk and where this has already been assigned to the Turbo logical volume group any existing Turbo logical volumes on this disk will be inaccessible and not visible under ‘df’. When restarted the instance will boot into emergency mode. This is because in creating volume /dev/sdb1 we have re-allocated all of the space on the disk to a new physical volume whereas the Turbo logical volumes are still on physical volume /dev/sdb
To avoid this possibility it may be best to not use the whole disk to create a physical volume but to partition any new virtual disk as soon as it is created ie fdisk /dev/sdb to create a partition and then pvcreate /dev/sdb1 instead of pvcreate /dev/sdb. To do this follow the procedure in the following GC to create numbered physical volumes on the disk and use these to extend the Turbo logical volume in need : https://greencircle.vmturbo.com/community/products/blog/2017/07/25/how-to-extendresize-hard-drive-in-operations-manager-running-centosHow to Extend/Resize Hard Drive in Operations Manager running CentOS
Continuation of steps to extend Turbo logical volume with all of new disk:
By default, Turbonomic ships with three separate partitions.
Step 1: Add a new Disk from within your Hypervisor.
Step 2: SSH into Turbonomic using Putty or any other SSH client.
Step 3: In this step, we need to list all the detected partitions so we can then create a primary volume.
In the above screenshot, you'll see the highlighted partition detected. On your system, if you have multiple disks added without a physical volume then you will see different names.
The screenshot below is an example of the VM with two disks added without a physical volume.
Once the new disk is visible run the below commands to create the new physical volume and add it to the volume group as shown below.
Step 4: Creating Physical Volume
Don't forget to use the name of the partition you would like to use. In this example, sdb is in use.
vgextend turbo /dev/sdb
Step 5: Extending Logical Volume
lvextend -L +10G /dev/mapper/turbo-root
The disk added was 10GB but if you add more than 10GB then you need to change the command to include the space you would like to allocate to the Root partition.
The command above will extend the root volume.
Now we have extended the root volume We can look at the new size by using the command above, df -h
|df -h||Shows disk space available for each volume|
|fdisk -l||fdisk command can display the partitions and details like file system type|