首先,将所有可用空间(对于HDD上的所有分区和逻辑卷)清零,然后关闭VM.
cat / dev / zero> z; sync; sleep 3; sync; rm -f z
然后,使用以下命令压缩VDI.
VBoxManage modifyhd /path/to/image.vdi –compact
VBox Doc
With the –compact option,can be used to compact disk images,i.e. remove blocks that only contains zeroes. This will shrink a dynamically allocated image again; it will reduce the physical size of the image without affecting the logical size of the virtual disk. Compaction works both for base images and for diff images created as part of a snapshot.
顺便说一句:对于VMWare(.vmdk),您需要使用vmware-vdiskmanager -k xxx.vmdk来执行相同 *** 作.
总结以上是内存溢出为你收集整理的linux – 为什么当我删除虚拟机中的大文件时,主机上的磁盘映像文件没有减少?全部内容,希望文章能够帮你解决linux – 为什么当我删除虚拟机中的大文件时,主机上的磁盘映像文件没有减少?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)