Then when file is deleted - from the point of view of the VM space is now free, but on the underlying VDI space was already reserved, size of the VDI file grew and there is no way to shrink it. The reason for that is that every time new file is created - OS can write data to a different location on the block device. rw- 1 dmitryzayats staff 9.8G Oct 29 00:13 NewVirtualDisk1.vdi dev/mapper/test-lvol 9.9G 223M 9.2G 3% /mntīut things will look very different from the host perspective. Creating and deleting 1000 relatively small 100M size files.Īt any given point in time our VM will show that we only consume 200M on the file system. Now we will run this one liner script in a sequence. So it only takes slightly less than 100M on a host. rw- 1 dmitryzayats staff 94M Oct 28 23:33 NewVirtualDisk1.vdi dev/mapper/test-lvol 9.9G 23M 9.4G 1% /mntĪnd this is how it looks like outside of VM (on the host) ls -lh|grep New This is how it looks like in VM ~]# df -h | egrep "^Filesystem|test"įilesystem Size Used Avail Use% Mounted on Let's start off with the 10G disk, which was just created and mounted. You create 10GB thin VDI disk, mount it and then start creating / deleting series of relatively small files in a loop.Įven though each of these small files will not be bigger than 100MB - your VDI disk will quickly grow to the maximum size. Thin (or so called sparse or dynamic in virtualbox terminology) disk images will grow in size over time but will never shrink.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |