Leider ist der Eintrag nur auf Amerikanisches Englisch verfügbar. Der Inhalt wird unten in einer verfügbaren Sprache angezeigt. Klicken Sie auf den Link, um die aktuelle Sprache zu ändern.

It happens that VHD files get quite large, even it they are dynamically sized, for various reasons (growing logfiles, user mistakes or other scenarios where large files are deleted afterwards).

The dynamic VHD grows automatically, but does never shrink by itself. The VHD size on the hypervisor stays large by default, but you can manually let it shrink again, even if the guest’s HDD format is not NTFS.

First, make sure that the VHD is of type „dynamic“ and the guest OS shows free space. The whole procedure would not make much sense otherwise.

For Linux machines (e.g. with EXT2/3/4 file system), do the following:

  1. Download SystemRescueCd ISO file
  2. Boot your VM from this image file
  3. Execute „zerofree /dev/sda1 -v“. (sda1 should be your VHD by default, -v shows the progress in percent)
  4. When finished, shut down the system and disconnect the ISO.
  5. Like with Windows guest VHDs, compress your VHD now via common Hyper-V harddisk compression wizard.
  6. Your VHD should be shrinked now.

 

  [email protected]