Opened 17 years ago

Closed 15 years ago

Last modified 14 years ago

#709 closed defect (fixed)

I can't compact linux guest VDIs efficiently

Reported by: Christophe Muller Owned by:
Component: virtual disk Version: VirtualBox 1.5.0
Keywords: compact linux ext2 ext3 Cc:
Guest type: other Host type: other


I'm wondering if I'm the only one having this problem (?). Using the VBoxManage modifyvdi name.vdi compact command, and after zeroing the disk, I am able to always recover space on FAT32 partitions (Windows guests) but I could never succeed doing that with Linux guests, either on ext2 or ext3 partitions. I have being also zeroing them with dd if=/dev/zero or with the zerofree method described in the forums but nothing seems to work. On FAT32 I have a vdi which is maybe 10% bigger of what Windows tells as size. On ext2 it can be as bad as a partition containing 250 MB (that's what du and df say) gives me a 2GB VDI!! (after compacting). It's a / partition of a Debian/Etch minimum install and I zeroed it using a rescue iso disk. I really can't see what I'm doing wrong! Thanks for your help.

Change History (6)

comment:1 by Shivanand, 17 years ago

I am having similar issues. I have a variable size hdd, with ubuntu (ext3), and the used size is around 400 MB, but the vdi is >4GB. Help!!!

comment:2 by nvivo, 17 years ago

I use Linux host, XP Guest, and I have this VDI with 10Gb in size that only has ~2Gb of data, and even if I defrag before, there is no differenct after compact.

Any updates on this?

comment:3 by markba, 17 years ago

Tested with Ubuntu JeOS as guest (ext3) on VB 1.5.4 and is resulted is doubling the vdi, from 750 MB to 1,5GB.

I want to make virtual appliances based on VB and Ubuntu JeOS, so this is very important to me because those appliances should be downloadable from internet and therefore, size matters (that's why I choose JeOS anyway).

comment:4 by Frank Mehnert, 16 years ago

Component: othervirtual disk

comment:5 by Christophe Muller, 15 years ago

Well.. two years after.. I tried again using the dd if=/dev/zero method and *again* it failed! :-) but, but, but, then I discovered in the best tutorial ever this paragraph:

advocating a read-only remount followed by the use of the zerofree tool. (on Debian/Ubuntu: apt-get install zerofree)

and it just works! It is not as efficient as using FAT32 though.. but with the dd method I could go from 4GB to 3GB (for 400MB real :-( ) whereas with zerofree, I can get a 600MB vdi. We are still loosing about one third but it might have to be with how ext2/ext3 is designed.. anyway, it's much much better than GBs!

You can close this bug if you wish, or re-cast it in optimization of compact for Linux FS..

Thanks a lot TerryE for the tutorial!



comment:6 by Klaus Espenlaub, 15 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use