# 列出可以压缩空间的path
vmware-toolbox-cmd disk list
# 压缩指定的路径
vmware-toolbox-cmd disk shrink /1234
参数详解,请参考shrink过程
list: list available locations 显示所有路径
shrink : wipes and shrinks a file system at the given location 注:wipe+shrink
shrinkonly: shrinks all disks 注:仅压缩,不经过wipe的话效果不好。
wipe : wipes a file system at the given location 扫描文件系统,檫除未使用的空间。
以上就是压缩回收空间的过程,下面讲解一下压缩的细节,大家出现其他错误可以根据下面的知识排查分析。
四 不能shrink的情况(对于很多人,了解下面知识是必须的)
1,在你创建磁盘时,就立即分配了所有空间。( Allocate all disk space now)。 2,shrink只适用于虚拟磁盘,如果创建的物理磁盘或者CD-ROM就不能shink。 3,如果虚拟机有snapshot快照就不能shrink,如果想要shrink就先删除虚拟机所有快照。 4,磁盘必须是独立永久模式(磁盘设置,高级里能找到)。 5,不能是链接方式的克隆虚拟机,或者被以链接方式克隆。完整的克隆是没关系的,因为克隆的两台机器没有关联了。 6,必须保证你的宿主机所在硬盘有足够的空间。(大于等于你要shrink的硬盘)。
评论专区