VDI-file size increase
Posted: 11. Jun 2015, 17:52
After struggling for days I can't find the solution and can't find a hint in the net...
The effect I have on two different hosts:
1) Ubuntu 12.04 server - VirtualBox 4.1.12_Ubuntu r77245 - no Guestadditions
2) Xubuntu 14.04 - VirtualBox 4.3.28 r100309 - with Guestadditions
The Guest:
Ubuntu server 14.04 - with Guestadditions - 512 MB RAM - VT-x/AMD-V, Nested Paging - SATA-Controller - AHCI - 1 Port - HDD: VDI - virtual size 8 GB - actual size 3,07 GB - dynamic
I currently have the effect that my VirtualBox vdi-file is growing much more than it should. It is growing by several 100 MB within 24 hours even if the virtual machine is only started in headless mode - no user logged in, no other action within the machine. I did several tests within the last week - what I found is that the file is growing always by 1 Mi (mebi - 1.048.576 Bytes) or x times 1 Mi. It seems that every write action is done into a (or several) new 1 MB block(s).
I found further that I can compress the vdi file again to nearly it's original value by the normal means (zerofree / VboxManage ...--compact). I checked all possible files (e.g. /var/log, /mail etc) several times and can't find a file being extremely big or growing by the size the vdi file is growing. And if it would exist it would have been impossible to compress the vdi file ...
As I had the suspicion that it might have to do with Webmin - what is not true as I know in the meantime - I did the following:
Since yesterday evening I'm running 24 hours test with 2 identical VB Guests. The only difference between the two guests is that in the first one the webmin service is stopped and in the second one running:
Time - Size of vdi-file - increase (Bytes) - increase divided by 1 Mi (1.048.576 Bytes)
without Webmin
02:59:00 - 3.515.875.328
03:04:00 - 3.696.230.400 - 180.355.072 = 172 Mi (increase / 1 Mi)
06:34:00 - 3.696.230.400
06:39:00 - 3.697.278.976 - 1.048.576 = 1 Mi
06:44:00 - 3.915.382.784 - 218.103.808 = 208 Mi
no changes in the size of the vdi file since 06:44 (Europe, Berlin time).
What happens at 03:00 (in both boxes) I know - its a cronjob (sudo apt-get update && apt-get upgrade), what happens between 6:43 and 6:44 I have to find out
with Webmin
20:43:00 - 3.424.649.216
20:48:00 - 3.536.846.848 - 112.197.632 = 107 Mi
02:43:00 - 3.536.846.848
02:48:00 - 3.744.464.896 - 207.618.048 = 198 Mi
02:58:00 - 3.744.454.896
03:03:00 - 3.872.391.168 - 127.936.272 = 122,0095367432 Mi
06:33:00 - 3.872.391.168
06:38:00 - 4.004.511.744 - 132.120.576 = 126 Mi
08:48:00 - 4.004.511.744
08:53:00 - 4.010.803.200 - 6.291.456 = 6 Mi
08:58:00 - 4.090.494.976 - 79.691.776 = 76 Mi
13:43:00 - 4.090.494.976
13:48:00 - 4.091.543.552 - 1.048.576 = 1 Mi
14:53:00 - 4.091.543.552
14:58:00 - 4.104.126.464 - 12.582.912 = 12 Mi
as you can see with Webmin service running much more activity and therefore a bigger increase of the vdi file size.
By the way - I gave you the details of the guest higher up in my post - "actual size 3,07 GB" - I copied this from the guest with started Webmin service a few minutes ago - now compare this value with the actual size of the vdi (4,1 GB) ...
Furthermore the protocols show that the increase of the file is going in 1 Mi steps or x time 1 Mi (last column). Jamie Cameron (thanks to him) from the Webmin team gave me following hint: "Webmin does some background status collection every 5 minutes, which writes to files in /etc/webmin/system-status. Perhaps that is the cause? It just re-writes the same file over and over though." and "If VirtualBox is tracking modified blocks as part of some kind of filesystem journal, that would explain it."
As I'm not so deep in file system questions I can't fully understand the consequences of his hint...
Can somebody help me to understand what's going on here? Is it a kind of bug or misconfiguration I unknowingly made? This is not my first Linux guest I created with Virtual Box on a Linux host but it is the first time that I see this effect...
But for the application I have to get running within this guest it is absolutely necessary that the vdi file remains as small as possible (for backup and transfer reasons) and so I can't live with this effect and I can't compress the vdi file every 24 or 48 hours... So I need a solution to avoid this effect.
Thanks for any hint.
The effect I have on two different hosts:
1) Ubuntu 12.04 server - VirtualBox 4.1.12_Ubuntu r77245 - no Guestadditions
2) Xubuntu 14.04 - VirtualBox 4.3.28 r100309 - with Guestadditions
The Guest:
Ubuntu server 14.04 - with Guestadditions - 512 MB RAM - VT-x/AMD-V, Nested Paging - SATA-Controller - AHCI - 1 Port - HDD: VDI - virtual size 8 GB - actual size 3,07 GB - dynamic
I currently have the effect that my VirtualBox vdi-file is growing much more than it should. It is growing by several 100 MB within 24 hours even if the virtual machine is only started in headless mode - no user logged in, no other action within the machine. I did several tests within the last week - what I found is that the file is growing always by 1 Mi (mebi - 1.048.576 Bytes) or x times 1 Mi. It seems that every write action is done into a (or several) new 1 MB block(s).
I found further that I can compress the vdi file again to nearly it's original value by the normal means (zerofree / VboxManage ...--compact). I checked all possible files (e.g. /var/log, /mail etc) several times and can't find a file being extremely big or growing by the size the vdi file is growing. And if it would exist it would have been impossible to compress the vdi file ...
As I had the suspicion that it might have to do with Webmin - what is not true as I know in the meantime - I did the following:
Since yesterday evening I'm running 24 hours test with 2 identical VB Guests. The only difference between the two guests is that in the first one the webmin service is stopped and in the second one running:
Time - Size of vdi-file - increase (Bytes) - increase divided by 1 Mi (1.048.576 Bytes)
without Webmin
02:59:00 - 3.515.875.328
03:04:00 - 3.696.230.400 - 180.355.072 = 172 Mi (increase / 1 Mi)
06:34:00 - 3.696.230.400
06:39:00 - 3.697.278.976 - 1.048.576 = 1 Mi
06:44:00 - 3.915.382.784 - 218.103.808 = 208 Mi
no changes in the size of the vdi file since 06:44 (Europe, Berlin time).
What happens at 03:00 (in both boxes) I know - its a cronjob (sudo apt-get update && apt-get upgrade), what happens between 6:43 and 6:44 I have to find out
with Webmin
20:43:00 - 3.424.649.216
20:48:00 - 3.536.846.848 - 112.197.632 = 107 Mi
02:43:00 - 3.536.846.848
02:48:00 - 3.744.464.896 - 207.618.048 = 198 Mi
02:58:00 - 3.744.454.896
03:03:00 - 3.872.391.168 - 127.936.272 = 122,0095367432 Mi
06:33:00 - 3.872.391.168
06:38:00 - 4.004.511.744 - 132.120.576 = 126 Mi
08:48:00 - 4.004.511.744
08:53:00 - 4.010.803.200 - 6.291.456 = 6 Mi
08:58:00 - 4.090.494.976 - 79.691.776 = 76 Mi
13:43:00 - 4.090.494.976
13:48:00 - 4.091.543.552 - 1.048.576 = 1 Mi
14:53:00 - 4.091.543.552
14:58:00 - 4.104.126.464 - 12.582.912 = 12 Mi
as you can see with Webmin service running much more activity and therefore a bigger increase of the vdi file size.
By the way - I gave you the details of the guest higher up in my post - "actual size 3,07 GB" - I copied this from the guest with started Webmin service a few minutes ago - now compare this value with the actual size of the vdi (4,1 GB) ...
Furthermore the protocols show that the increase of the file is going in 1 Mi steps or x time 1 Mi (last column). Jamie Cameron (thanks to him) from the Webmin team gave me following hint: "Webmin does some background status collection every 5 minutes, which writes to files in /etc/webmin/system-status. Perhaps that is the cause? It just re-writes the same file over and over though." and "If VirtualBox is tracking modified blocks as part of some kind of filesystem journal, that would explain it."
As I'm not so deep in file system questions I can't fully understand the consequences of his hint...
Can somebody help me to understand what's going on here? Is it a kind of bug or misconfiguration I unknowingly made? This is not my first Linux guest I created with Virtual Box on a Linux host but it is the first time that I see this effect...
But for the application I have to get running within this guest it is absolutely necessary that the vdi file remains as small as possible (for backup and transfer reasons) and so I can't live with this effect and I can't compress the vdi file every 24 or 48 hours... So I need a solution to avoid this effect.
Thanks for any hint.