dannybeckett
Contributor
Contributor

Massive Disk Space Usage Disparity

Jump to solution

Hi Everyone,

 

I have a problem with one of my VM's. I have an Ubuntu instance running on a 500GB SSD (reported total space of 476GB). The problem is that the SSD is now nearly full, with Host Windows and VMware Player both reporting 425GB used leaving 51GB free.

 

However, the Guest OS Ubuntu reports taking only 328GB. This was measured by Disk Usage Analyzer running as root. There's a massive 97GB disparity I cannot account for between the claimed Guest OS usage and actual size on disk. To try and fix this, I defragmented then compacted the Guest OS using VMWare Player, which freed only a very small amount of space.

 

Does anyone have any experience with this issue? I'd greatly appreciate some help! The last time my VM ran out of disk space it corrupted the guest OS!

 

Dan

0 Kudos
1 Solution

Accepted Solutions
gbohn
Enthusiast
Enthusiast

If I understand correctly (the Linux Guest reports about 97 GB less usage than the space used on the Host by the grow-able .vmdk files), It might be the case where your .vmdk files are accumulating a fair amount of detritus that was once used, but is now un-allocated in the Guest.

In my experience with Linux Guests on a Windows 10 Host (using Guest EXT4 formatted virtual drives), I needed to zero out the unused space before trying to shrink/compact the .vmdk files in order for it to actually free up the space.

Otherwise it appeared as though it wasn't recognized as unused.

It's been a long time since I last did this, but it went something like:

*) In Linux Guest

     dd if=/dev/zero of=wipefile bs=1024x1024; rm wipefile

    This fills all available unused storage space (on the current partition) with bytes of 'zeros'. It did not expand the Host .vmdk size to any noticeable amount.

    This can take a while and you don't want the guest to be doing anything at the time.

    I think this needed to be done with the VM not having any snapshots.

*) From Host Windows command line run the Shrink/Compact command while the Guest was shut down:

      vmware-vdiskmanager.exe -k "<path to vmdk>"

I'm not sure if it's your issue, but good luck. Make sure you have a backup in case things go wrong.

Also, if you are low on free space it might become an issue trying to shrink the .vmdk (But if your prior attempt worked I guess that's a good sign).

View solution in original post

7 Replies
continuum
Immortal
Immortal

Your numbers dont make a lot of sense.
How can a disk with 476 gb of free space be nearly full ?
Also you dont tell us anything about the size of the Ubuntu vmdk

 

 

Do you need support with a recovery problem ? - send a message via skype "sanbarrow"
0 Kudos
oligarch
Enthusiast
Enthusiast

I think @dannybeckett means 476GB of available space?

gbohn
Enthusiast
Enthusiast

If I understand correctly (the Linux Guest reports about 97 GB less usage than the space used on the Host by the grow-able .vmdk files), It might be the case where your .vmdk files are accumulating a fair amount of detritus that was once used, but is now un-allocated in the Guest.

In my experience with Linux Guests on a Windows 10 Host (using Guest EXT4 formatted virtual drives), I needed to zero out the unused space before trying to shrink/compact the .vmdk files in order for it to actually free up the space.

Otherwise it appeared as though it wasn't recognized as unused.

It's been a long time since I last did this, but it went something like:

*) In Linux Guest

     dd if=/dev/zero of=wipefile bs=1024x1024; rm wipefile

    This fills all available unused storage space (on the current partition) with bytes of 'zeros'. It did not expand the Host .vmdk size to any noticeable amount.

    This can take a while and you don't want the guest to be doing anything at the time.

    I think this needed to be done with the VM not having any snapshots.

*) From Host Windows command line run the Shrink/Compact command while the Guest was shut down:

      vmware-vdiskmanager.exe -k "<path to vmdk>"

I'm not sure if it's your issue, but good luck. Make sure you have a backup in case things go wrong.

Also, if you are low on free space it might become an issue trying to shrink the .vmdk (But if your prior attempt worked I guess that's a good sign).

View solution in original post

dannybeckett
Contributor
Contributor

Sorry guys, yes, I meant total available space on that drive*

0 Kudos
dannybeckett
Contributor
Contributor

@gbohn, wow, thank you so much for your contribution!!

 

You have understood my issue exactly, and offered some excellent advice. I will follow what you said carefully and precisely and then report back with the results.

 

Thanks again 🙂

0 Kudos
gbohn
Enthusiast
Enthusiast

You're welcome.

Also, I happened to use the command line to do the compact part (after filling with zeroes), but I would imagine that you should be able to do that from the GUI drive settings as well.

dannybeckett
Contributor
Contributor

It worked, absolute legend. Thanks for the advice 🙂

dannybeckett_0-1607119597091.png

 

0 Kudos