Page 1 of 1
How is the virtual disk overwritten?
Posted: 2. May 2011, 19:53
by asiga
Hi,
What does it happen when some file(s) in the guest operating system change? Does the whole virtual disk file need to be overwritten, or just the affected blocks are overwritten? I'm asking this question because I'm using VirtualBox on a SSD, and I'd to know if everytime I run it the whole disk file is written.
TIA!
Re: How is the virtual disk overwritten?
Posted: 3. May 2011, 10:23
by mpack
Does it seem to you like it takes long enough that it could be overwriting the whole thing? And how much do you think VirtualBox knows about guest filesystems anyway? VDI updates happen on a sector by sector basis like the physical disk it emulates, though because it's actually emulated using a host file, normal host filesystem caching may apply.
Re: How is the virtual disk overwritten?
Posted: 6. May 2011, 00:00
by asiga
Well, my virtual disk file is about 2GB and my hard disk is SSD, so I'm not sure if I would notice a huge delay if it overwrites the whole disk image everytime.
Btw, I don't think the guest filesystem has anything to do with this... I believe it's a matter of how Virtualbox overwrites the virtual disk, and that's a matter of the policy it uses to access the host filesystem. Any info on how it overwrites virtual disks? Just the modified data is overwriten, or the whole disk is written again -perhaps in the background- ?
TIA
Re: How is the virtual disk overwritten?
Posted: 6. May 2011, 00:35
by Perryg
It's exactly what mpack said "sector by sector basis like the physical disk". It works exactly the same as a real hard drive.
Re: How is the virtual disk overwritten?
Posted: 6. May 2011, 15:54
by mpack
asiga wrote:Well, my virtual disk file is about 2GB and my hard disk is SSD, so I'm not sure if I would notice a huge delay if it overwrites the whole disk image everytime.
Are SSDs considered particularly fast for writing? I thought they were based on NAND-flash, which I know is not particularly fast for writes. Actual performance would depend on the design details: individual flash chips may be slow, but if you could write lots of them in parallel then that could be made plenty fast. Of course that would be an expensive design, and you would have to use eSATA or something to get the benefit.
SSDs are not something I've given much attention to - I'm quite happy with mechanical drives when I need big, I use my 16GB USB thumb drive for everything else (and I dont expect great performance with it). With USB3 and eSATA either here already or coming down the pipe I expect the bandwidth issue will be addressed soon.
Re: How is the virtual disk overwritten?
Posted: 6. May 2011, 16:51
by smartysmart34
[quote="mpack"]Are SSDs considered particularly fast for writing?[/quote]
You are kidding, right?
A current SSD (Crucial M4, OCZ Vertex 3... in the size of about 256 GB) pushes out roughly 250 - 350 MB/sec (some even above 400 MB/sec) with sequential writes for uncompressible data.
When it comes to random 4k writes they still go as high as 50 - 90 MB/sec.
Try and find a hard-Disc that fast
Cheers,
Martin
Re: How is the virtual disk overwritten?
Posted: 6. May 2011, 17:00
by mpack
Well, I'd love to argue, but this isn't the place.