Increase VMware or Cloud existing disk size for Linux Part 2

In this article we will discuss how to increase disk space on a Linux Cloud Server after increasing the existing disk space for the server through cloud Control.

This article describes how you can manually increase the existing physical volume size of Cloud Server or Virtual machine.

First you need to rescan the newly added disk on the server follow the Part 1 of this Article 

Follow the below steps to increase the VM disk size.
Step 1
Once the disk space increase on Cloud Server log into the server via SSH or console.

Step 2
Run fdisk -l to check the total size of the disk. You will notice that one of the partitions is Linux LVM and the full disk size is not been utilized, Type the pvs command which stands for physical volume show. We have to add newly added unallocated disk into LVM.



Check and make sure that the difference in size between the fdisk output and the PSize value shown from the pvs command, and fdisk output should be more than pvs output.

Step 3

Now Type fdisk /dev/sda (you have to use the Disk name shown in the output of fdisk -l) and press ENTER

Fdisk will prompt you to enter a command. Type p for print  the partitions on the disk.




Step 4

Here will  create new partition from unallocated space  read this post for Fdisk command  for more details.
Type n to create a new partition.
Next, type p for primary partition.
Type 2(depends on number of partition you have ) as the partition number .
When prompted for the First cylinder, simply press ENTER to use the default value.
When prompted for the Last cylinder, simply press ENTER again to use the default value.



Step 6

Type p and press ENTER again to view the partitions. There should now be a second partition. You will notice that the partition is no longer a Linux LVM type but simply a Linux type. We will have to change this to LVM

Type t to change the partition type.
Type 2 as the partition number .
Type 8e (as this is partition ID for LVM) and press ENTER.

You should see that the partition type has been changed to Linux LVM.



Step 7

Type p and press ENTER to list the partitions again. This time the second partition should be Linux LVM as we just changed it.
Type w and press ENTER to write (save) changes and quit fdisk.

You will receive a notice that the new partition table will be used after the next reboot.
Reboot the server by typing init 6 or run partprobe /dev/device name.


Step 8

wait for few minutes to reboot the server , then connect via SSH or console again.Type fdisk -l and press ENTER again to check the disk size. The disk size listed by fdisk should not have changed.
Type pvs and press enter to check the physical volume size. The value should not have changed as it is not updated

Type pvresize /dev/sda2 . You should use the Disk name shown in the output of fdisk -l) and press ENTER.

You will receive a notice that the physical volume has been resized.
Type command pvs  and see The PSize value should be now increased.   You are now finished!


Above process will increase only Psychical volume, to Add into Volume group and Logical Volume read this article
Increase VMware or Cloud existing disk size for Linux Part 2 Increase VMware or Cloud existing disk size for Linux Part 2 Reviewed by Unknown on October 27, 2016 Rating: 5

No comments:

Get Your Business Online Now


Powered by Blogger.