VDI file size not decreasing after deleting files in guest.
-
TheGuyNextDoor
- Posts: 2
- Joined: 5. Aug 2020, 10:35
VDI file size not decreasing after deleting files in guest.
So I am using Ubuntu and I have kali as virtual machine but recently I used a large password list files for testing something and then deleted it but when I analysed , the Host OS still shows that Kali is using 76GB where as running analyser in Kali shows that it's only 10GB I don't know why the host os is still not refreshed back. I used multiple packages to test disk usage I checked the VDI file it's 76GB but why ?. Any idea?.
-
mpack
- Site Moderator
- Posts: 39134
- Joined: 4. Sep 2008, 17:09
- Primary OS: MS Windows 10
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Mostly XP
Re: VDI file size not decreasing after deleting files in guest.
That is correct. VDI size does not decrease when you delete files inside the guest OS, because the latter is simply a book-keeping exercise, it does not unwrite the disk sectors.
You can compact the disk using CloneVDI (on Linux hosts this will require Wine). Be sure to choose the "Keep UUID" option. The cloned VDI will be smaller and a one for one replacement for the large VDI. Note however that the VDI will grow again the next time you store data on it, so maybe best just get used to it.
You can compact the disk using CloneVDI (on Linux hosts this will require Wine). Be sure to choose the "Keep UUID" option. The cloned VDI will be smaller and a one for one replacement for the large VDI. Note however that the VDI will grow again the next time you store data on it, so maybe best just get used to it.
-
TheGuyNextDoor
- Posts: 2
- Joined: 5. Aug 2020, 10:35
Re: VDI file size not decreasing after deleting files in guest.
Thanks for the info ..so the best option is to keep the VDI file before copying large files and then after work I can switch back to the older smaller VDI.
-
mpack
- Site Moderator
- Posts: 39134
- Joined: 4. Sep 2008, 17:09
- Primary OS: MS Windows 10
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Mostly XP
Re: VDI file size not decreasing after deleting files in guest.
Yes, that would do it too, though it would also undo changes you wanted to be permanent, e.g. OS updates.