How to expand volume of a linux virtual machine residing in a ESXi host

1. Power off VM
2. Expand volume size
3. Power on VM
4. Confirm new volume size
# fdisk -l
5. Create primary partition
# fdisk /dev/sda
# p
# n
# p
# 3
# [enter] [enter]
# t
# 3
# 8e
# w
# exit
# sudo reboot
6. Verify changes
# fdisk -l
7. Convert new partion to physical volume
# vgextend centos /dev/sda3
8. Verify
# vgdisplay centos | grep "Free"
9. Extend Logical Volume
# lvextend -l+100%FREE /dev/mapper/centos-root
10. Expand file system inside Logical Volume
# xfs_growfs /dev/centos/root
11. Verify that / has the new space available
# df -h /

Other commands
----------------------------------------------
Install Epel:
yum install epel-release

Install gparted
yum install gparted

view persistent schemes
lsblk -f

Leave a Reply

Your email address will not be published. Required fields are marked *