Category: General

How to increase the storage to Linux VM without rebooting the OS

  • Clear messages
dmesg -c
  • Go to the appropriate Vcenter and edit the VM to have the additional disk drive
  • Run the following on the linux VM
for i in /sys/class/scsi_host/host*; do echo "- - -" > $i/scan; done
  • View information about physical drives that are used by LVM
pvs
  • Check if the new disk can be seen by OS by running “dmesg” again. Type ‘ls /dev/sd’ and double tab – should see the next disk that was not in the previous “pvs”command – run the below commands with that new letter
ls /dev/sd[x
pvcreate /dev/sd[x
  • Check if you can see the new drive and extend the Volume Group
pvs
vgs
vgextend [VolGroup /dev/sd[x
vgextend centos /dev/sd[x (For Centos 7)
vgs
lvs #Use this to display which LV group is being used for storage if LV group not specified already 
  • Extend the disk and check it has been extended
pvdisplay
lvextend -l +100%FREE /dev/[VolGroup/[lv_root
lvs
  • Check what type of file system is being used
df -T
  • If ext4 file system resize the disk with
resize2fs /dev/[VolGroup/[lv_root
  • If xfs file system resize the disk with
xfs_growfs /dev/[VolGroup/[lv_root 
mount -o remount,inode64 /mnt/nfs # remount the directory to work around the bug in xfs 

Keywords: VMware, extending storage, Linux, without reboot

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.