How to extend FS in Azure Linux VM without VM Resize
Based on usages we may often need to expand file system to accommodate various application demands.When ever your virtual machine is hosted in Azure or any other IAAS cloud services. As per their offerings virtual machines comes with restrictions that number of luns can be associated with specific virtual machine type.For example see below DV2 Series virtual machines number of LUNs can be provisioned.If you have further space requirement you will be forced to virtual machine resizing which may lead to additional costs.So how we can achieve this without resizing virtual machine.We are discussing same here how we can achieve further space requirement without resizing virtual machine.Solution is quite simple to expand the existing LUN size and reconfigure it on your RHEL virtual machines and you will be good and can avoid virtual machine resizing and you will be only paying only for storage you additionally required and you will have better control on pricing.
Below is the steps you need to perform on virtual machine to start using additional space recently added by increasing LUN size.
Procedure to be used for how to extend FS in Azure Linux VM without VM Resize is as below.
1.Run below command to detect the new lun size to OS.
# echo 1 > /sys/block/sdc/device/rescan
2.Resize physical Volume like below
# pvresize /dev/sdc
3.Extend Logical Volume(Re-reading configuration)
Below command will increase the LV size to total 10G and FS will be resized too .
# lvextend -L10G -r /dev/vgName/LVName
Below command will only add 10G with previous size + FS resize
# lvextend -L+10G -r /dev/vgName/LVName
Below command will extend to all extended space + FS resize and you will see filesystem is expanded.
# lvextend -l +100%FREE -r /dev/vgName/LVName
Use any above method to have FS expanded without VM resizing.That,s all about how you can avoid VM resize and keep the VM cost in control without any impact.Efficient way to keep VM cost in control .
Thanks for keep going through the above procedure.If you like you can subscribe our news letter to get latest tips,tricks and how to steps to accomplish specific task.Please do not hesitate to share this with all possible social account where ever you have presence.