Link to home
Start Free TrialLog in
Avatar of gsalcedo
gsalcedo

asked on

How do I expand a certain partition on a Linux VM?

Hi,

How do I expand a partition (/var) on an already running ESX Linux VM  host without a third party software?
Avatar of Julian Parker
Julian Parker
Flag of United Kingdom of Great Britain and Northern Ireland image

are you running lvm?

you need to post more information about your system; df -k, vgdisplay -v.

if you have free disk space in the volume group it's straight forward enough but your file system type will have a bearing on this.
Avatar of gsalcedo
gsalcedo

ASKER

Additional note... The version of the VI Client that I am running is 2.0.2, ESX server is version 3.
The VMWare ESX environment is running as a SAN environment.  So, I can gather as much disk space as possible and add it to the VM.  From the sites that I have visited, it seems that they have been showing only the most recent version of VI Client and ESX server.  I know that I have to shutdown the VM, click the Edit Settings option, and then make the changes under the "Hardware" tab.  The sites that I have visited displayed the ability to expand the partition of the disk in the "Capacity" section that is under the "Hardware" tab of the particular hard drive.  My VI Client does not have that ability.  Is there another way?  Do I just add another hard disk that is associated with a certain Data Store, power up the VM and make the configuration changes in the Linux VM host?
ok but the df -k and vgdisplay -v listings will help at the moment
Hi Jools,

I am running lvm2
Hi,

I have tried running the vmkfstools command.  In return, I received a "Failed to extend disk : The file specified is not a virtual disk. (15)" message.  I have indicated the just the .vmdk file and also the entire path.  None worked.

vmkfstools -X <requested disk expansion>G <file name>.vmdk
example... # vmkfstools -X 3G vm1.vmdk
example2... # vmkfstools -X 3G /vmfs/volumes/DataStore2/vm1.vmdk
example3... # vmkfstools -X 3G "/vmfs/volumes/DataStore2/vm1.vmdk"

None of the examples worked...

what about;
   df -k
and
   vgdisplay -v

like I asked earlier...
Since you said you want to increase /var of the ESX host, I believe that it is on the local disk. Normal ESX
installation do not use LVM but normal partitions. Most modern systems have large disks (usually at least 70GB) though and an ESX install normally does not use the whole 70GB, when there is a SAN connection for the VMs.
I would check if you have free space left, go single user, create a new partition vor /var and copy stuff over. Then edit fstab and reboot.
If /var was the last partition you created, you could even copy the files temporarily somewhere else, delete the partiton and create it again bigger. If  there is for  example /home after /var, you have to do this twice...

But, since it is a ESX and you probably have more than one or two of thos, why don't you move the VMs, shut it down, and reinstall them, this time the correct way (at least 25GB for / and some GB for /var)


lqw

Also run "fdisk -l" to display the non-LVM disks.
ASKER CERTIFIED SOLUTION
Avatar of gsalcedo
gsalcedo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial