Increasing VMWare Disk Sizes in Linux Without Rebooting
By Chris Gilbert
You can increase disk sizes in vmware guests whilst they are running. This is supported, but Linux will not see the new size of the disk until it reboots. There is a way around this (assuming here we are using LVM disks): 1. Increase the disk size in the vmware settings. 2. Logon as root onto the Linux guest system. 3. Do:
echo "1" > /sys/class/scsi\_device/<device>/device/rescan
..where is the SCSI bus you wish to rescan. This will take a while. 4. Increase the physical volume size by doing this:
pvresize -v /dev/<disk>
5. Check the volume group has an increased size:
vgs
6. If this is ok, you can then increase the appropriate logical volume(s) with the following command:
lvextend -L +<amount to extend by e.g. 10G> <lv name>
For a list of the logical volumes:
lvs
7. Finally you can extend the filesystem online:
resize2fs /the/filesystem
```**Note:** If you have created partitions on the disk (which was a mistake!) you will need to use parted or fdisk to add an additional partition first, before then adding this partition to the volume group, using the vgextend command.
Please comment below. You'll need a GitHub account to add them, but creating one is free.