Welcome 微信登录

首页 / 操作系统 / Linux / 回收VMWare虚拟机占用的磁盘空间

虚拟机里装了个Ubuntu 10.04,是老早以前了的了,由于仅安装了开发环境和Oracle 10g,占用空间在8G左右。前几天升级了12.04.01,麻烦来了,虚拟机硬盘空间暴增至16G左右,卸载了openoffice等不用的软件,apt-get clean了,apt-get autoremove了。df -H了一下,OK,磁盘占用8G左右了,可是虚拟机硬盘还是16G大小!折腾了半天,查了N多资料,终于搞定:1. 虚拟机设置的硬盘选项中先Compac一下;2.开虚拟机Before we try to shrink the virtual disk files, we should try to remove any unneeded files from the virtual machine to free space. For example, on Debian-based VMs, you can runapt-get cleanto clear out the local repository of retrieved package files.Next, runcat /dev/zero > zero.fill;sync;sleep 1;sync;rm -f zero.fillto fill the unused space with zeros.Then power down the VM and open the command window on the Windows host:3.宿主机执行命令:vmware-vdiskmanager.exe -k F:*****ubuntu-10.04.4-desktop-i386.vmdk提示 Shrink: 100% done.Shrink completed successfully.完成注意:折腾了多次,就是因为,没有cat /dev/zero > zero.fill;sync;sleep 1;sync;rm -f zero.fill,所以没成,可能是需要wipe吧。小提示以下这些情况是无法使用shrink功能的:★使用默认方式新建的GSX Server虚拟机。★使用了快照功能的虚拟机。★使用了物理磁盘为虚拟机磁盘。★虚拟磁盘保存在CD-ROM或DVD-ROM上。★你不能收缩预分配的磁盘。在进行收缩之前,需要删除创建的快照,之后,直接登录虚拟,打开VmwareTools就可能收缩磁盘了。Oralce Solaris 11 源码安装Qt 4.8.3openSUSE 12.1硬盘安装相关资讯      VMware虚拟机 
  • 使用VMware虚拟机安装virt-manager  (01月01日)
  • VMware Workstation虚拟机Ubuntu中  (03/14/2015 19:25:21)
  • 如何将VirtualBox和VMware虚拟机相  (11/02/2014 08:36:48)
  • VMware虚拟机无法上网 无法启动  (05/19/2015 10:19:19)
  • VMware 虚拟机使用RedHat,出现   (02/08/2015 20:41:14)
  • VMware虚拟机克隆以后出现“需要整  (10/16/2014 19:18:13)
本文评论 查看全部评论 (0)
表情: 姓名: 字数