Shrink guest on hosted platform: Difference between revisions

Jump to navigation Jump to search
m (and for Fusion)
(4 intermediate revisions by the same user not shown)
Line 91: Line 91:


If this is not for you, then do read on.
If this is not for you, then do read on.
=== Zero out using fstrim ===
These days there's an alternative way for zero-ing out the parts of the disk that are not used using [https://www.man7.org/linux/man-pages/man8/fstrim.8.html fstrim].
The great thing about this is that it only zero's out the parts of the disk that are not zero and as such the disk does not inflate to its full size.
* [https://forums.freebsd.org/threads/ssd-trim-maintenance.56951/post-328912 Detail comment from Theodore Ts'o on using fstrim]
* [https://github.com/vmware/open-vm-tools/issues/457 Avoid disk expansion while shrinking (github issue tracker)]


== Zero out unused space on a Windows VM ==
== Zero out unused space on a Windows VM ==
Line 149: Line 159:
Where "/" is the mount point of the partition that you want to shrink.
Where "/" is the mount point of the partition that you want to shrink.


On Windows in order to use this run:
On Windows in order to use this run (as administrator):


  C:\Program Files\VMware\VMware Tools>VMwareToolboxCmd.exe disk shrink <location>
  C:\Program Files\VMware\VMware Tools>VMwareToolboxCmd.exe disk shrink <location>


where <location> is the drive you want to shrink
where <location> is the drive you want to shrink
For example:
C:\Program Files\VMware\VMware Tools>VMwareToolboxCmd.exe disk shrink c:\
Please disregard any warnings about disk space for the duration of shrink process.
Progress: 62 [=======>  ]
The progress you see here is VMware Tools blanking out the unused space.
At 99% it will popup the "Shrinking Disk" progress dialog at the host that takes care of the actual shrinking process.
If you are logged in via remote desktop then do expect to loose the connection for a bit while the actual shrinking is taking place.


On OS X / macOS the command to use is:
On OS X / macOS the command to use is:
1,274

edits

Navigation menu

Guest

Support my products