Article ID: 123258, created on Oct 25, 2014, last review on Oct 25, 2014

  • Applies to:
  • Virtuozzo 6.0


A significant amount of files were deleted inside the virtual machine. After that the space occupied by the VM's hdd image exceeds the actual amount of information inside, e.g:

On the node:

# ls -lah /var/parallels/myvm.pvm/harddisk.hdd/
total 218G
drwx--x--x 2 root root 4.0K May 28 15:33 .
drwx--x--x 3 root root 4.0K May 28 15:33 ..
-rw------- 1 root root 1.5K May 28 14:39 DiskDescriptor.xml
-rw------- 1 root root 1.5K May 28 14:39 DiskDescriptor.xml.Backup
-rw------- 1 root root    0 May 28 12:30 harddisk.hdd
-rw------- 1 root root 218G May 28 16:43 harddisk.hdd.0.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds

Inside the VM:

# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             219G   40G  169G  19% /
/dev/sda2             3.9G  163M  3.6G   5% /tmp
tmpfs                 9.9G     0  9.9G   0% /dev/shm
none                  4.0T     0  4.0T   0% /media/psf


The image can be compacted using the following command from the node:

Note: The virtual machine needs to be stopped for this operation:

# prlctl list -i myvm | grep hdd
Boot order: hdd0 cdrom0 fdd0 net0
  hdd0 (+) sata:0 image='/var/parallels/myvm.pvm/myvm.hdd' type='expanded' 224256Mb
# prl_disk_tool compact --hdd /var/parallels/myvm.pvm/myvm.hdd

(Change the VM name and path to the hdd to the correct ones).

Search Words

compact hdd

compact vm disk

shrink Hard-Disk

shrink hdd

c62e8726973f80975db0531f1ed5c6a2 2897d76d56d2010f4e3a28f864d69223 0dd5b9380c7d4884d77587f3eb0fa8ef

Email subscription for changes to this article
Save as PDF