Shrink guest on hosted platform: Difference between revisions

Line 4: Line 4:
If you don't have that kind of free disk space then you can skip the zero-ing out part. You can still reclaim space, but it will be less optimal.
If you don't have that kind of free disk space then you can skip the zero-ing out part. You can still reclaim space, but it will be less optimal.
Alternatively you can use the "Partially zero out" trick described below.
Alternatively you can use the "Partially zero out" trick described below.
=== How much free space do you need before shrinking? ===
Also please note that you need more free space in order to be able to run the shrinking process.
The shrinking process consists of making a copy of your virtual disk while omitting the zero'd out blocks.
So how much extra space you need depends on how you configured the virtual disk for your Virtual Machine.
If your Virtual Disk is a single file, then your free space requirement can grow up-to the full size of that virtual disk.
If OTOH you are using the split disk scheme where a virtual disk is sliced into multiple files the maximum free space you need is the maximum size a slice can be. Nowadays there's not a fixed slice size, it depends on how big your virtual disk actually is.
The split disk scheme since VMware Workstation 11 (VMware Fusion 7), older version of Workstation/Fusion use a 2GB split disk scheme.
Capacity          Extent size
================================
<=128GB            4GB (increased from 2GB)
>128GB && <2TB    Capacity / 32 (so maximum of 32 extents)
>=2TB              2TB
For extra safety I recommend to make sure you have an additional 2GB of free space on top of those requirements as mentioned above.
As side note, this also explains why it is generally recommended at the forum by the regulars to use a split disk scheme over single disk files.
This same problem also exists when you want to commit snapshots.


==== Zero out unused space in a Linux VM ====
==== Zero out unused space in a Linux VM ====
1,274

edits