"Go" to compress VirtualBox VDI files

Source: Internet
Author: User
Tags arch linux

Original URL: http://i.rexdf.org/blog/2014/10/06/ya-suo-virtualboxde-vdiwen-jian/

The problem is actually quite simple, and I've given a way to increase VDI disk space in the Arch Linux notes. is actually copying the file system with Gparted-live-iso. This method also has the effect of compression. Linux is not very clear, the Windows system can be directly attached to the disk Diskgenius, and then directly in the Diskgenius inside the file copy. The effect is obviously better than Ghost-iso disc copy. Windows VMDK virtual machine I do backup, are directly with Diskgenius copy and then RAR compression, the effect is very good, the original XPSP3 new installation hit all patches, upgrade all system components, RAR package only about 800M, Such a system is convenient to create a new system at any time.

Because the arch I basically do not start the graphical interface, the start is the shift headless way, so installed in the VirtualBox inside. After a while, the disk is getting bigger and the disk is not enough after compiling gpg4win some days ago. It was then that I realized that pacman -Sc the trick of cleaning up the system would be great.

This article is mainly a note, recording problems and solutions for future reference.

The way I'm using it right now is here.

Linux virtual machines :

sudo dd if=/dev/zero of=/bigemptyfile bs=4096ksudo rm -rf /bigemptyfile

Windows virtual machine , download SDelete (Sysinternals a component):

sdelete –z

And then execute

VBoxManage.exe modifyhd arch.vdi --compact

I use 10.3.16, here is a more interesting phenomenon, the above DD command after the execution of the df -h view, you can find that the disk remaining space is 0%, but I see on the physical machine, no changes in disk space observed, not at all. After the RM command is executed, df -h it is normal to see the values before they are restored, no more and no less.

There is also the execution to more than 60% of the time, I did not observe arch.vdi this file size of a bit changes (I keep on pressing F5 refresh view). But after the execution I went to see the time from the original 28.8G reduced to 21.5G, the release of 7.3G space, really good.

Another website also recommended a zerofree, in the Arch of the Aur source inside, can be used yourt zerofree for installation. I did not use this method is because, although the official web surface 1.0.1 said is to support EXT2,EXT3,EXT4, but the Aur source inside version 1.0.2 description is ext2 filesystem, see this I gave up trying.

The scheme given by the official website

Windows virtual Machine

sdelete -c Csdelete -c D

Linux virtual Machines

mount -n -o remount,ro -t ext2 /dev/sda1 /mount -n -o remount,ro -t ext2 /dev/sdb1 /varzerofree /dev/sda1zerofree /dev/sdb1

"Go" to compress VirtualBox VDI files

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.