5
6

More than 5 years have passed since last update.

vdiイメージのtrim

Last updated at Posted at 2013-08-04
  • vmdkはvboxmanageで圧縮ができないので注意。

  • linuxの場合は以下でzero埋めする。

zero埋め
$ dd if=/dev/zero of=zero bs=4k; rm zero
  • windowsの場合はsdeleteを使って必ず空き容量をzero埋めしておく。
sdelete.exe -z c:
UUIDで指定し圧縮
$ vboxmanage list hdds
$ vboxmanage modifyhd [UUID] --compact
ファイル名を指定して圧縮
$ vboxmanage modifyhd linux.vdi --compact
$ vboxmanage list hdds
UUID:        0490685d-d218-4561-be29-d30ce83d81a3
Parent UUID: base
Format:      VDI
Location:    /home/User/VirtualBox VMs/windows7_vagrant/80gb.vdi
State:       created
Type:        normal
Usage:       windows7_vagrant (UUID: ce7504bb-cc22-4914-8ce8-ccd028bc516e)

$ vboxmanage modifyhd 0490685d-d218-4561-be29-d30ce83d81a3 --compact
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
$ 
5
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
6