Linux vmdk file instant growth

Hello!

We've got Hyper-V 2012r2 and CentOS 6.6 running in VM.

We have web-server running on it. And in fact it uses space:

df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_bitrix2-lv_root
                       50G  3,7G   43G   8% /
tmpfs                 1,9G     0  1,9G   0% /dev/shm
/dev/sda1             477M   46M  406M  11% /boot
/dev/mapper/vg_bitrix2-lv_home
                      439G  101G  316G  25% /home

But vmdk file in Hyper-V weights 300Gb.

I tried 

cd / ; cat /dev/zero > zero.fill ; sync ; sleep 1 ; sync ; rm -f zero.fill

And after that:

Mount-VHD 'D:\Hyper-V\bitrix2\Virtual Hard Disks\bitrix2.vhdx' -ReadOnly
Optimize-Vhd -path 'D:\Hyper-V\bitrix2\Virtual Hard Disks\bitrix2.vhdx' -Mode Full
Dismount-VHD 'D:\Hyper-V\bitrix2\Virtual Hard Disks\bitrix2.vhdx'

But it doesn't help..Can anyone help us with the problem?

July 18th, 2015 10:41am

Hi Greg IT,

You must using the dynamic virtual disk, if yes, please refer the following article to compact the vm disk.

Compacting a Dynamically Expanding virtual hard disk in Windows Server 2012

http://blogs.technet.com/b/askcore/archive/2012/09/20/compacting-a-dynamically-expanding-virtual-hard-disk-in-windows-server-2012.aspx

Best Regards,

Free Windows Admin Tool Kit Click here and download it now
July 22nd, 2015 3:42am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics