In OpenVZ, you can decrease the space your virtual machines and containers occupy on the physical server’s disk drive by compacting their virtual disks. Compacting virtual disks allows you to save your server’s disk space and host more virtual machines and containers on the server.
To compact a virtual disk, you can use the prl_disk_tool compact
command. For example, to compact the disk /vz/vmprivate/d35d28e5-11f7-4b3f-9065-8fef6178bc5b/harddisk.hdd
, run this command:
# prl_disk_tool compact --hdd /vz/vmprivate/d35d28e5-11f7-4b3f-9065-8fef6178bc5b/ \
harddisk.hdd/
To check the space that was freed by compacting the virtual disk, you can use standard Linux utilities (for example, df
).