5
1
Just sort of remembered something from OS class about fragmentation and was wondering if anyone knows for sure whether a VM file is liable to become fragmented if you tell it what size the hard drive should be from the outset.
I'm not asking whether the files in the VM can become fragmented, if they're truly a virtual machine then anything that can happen to a physical hard drive can happen to a virtual hard drive.
What I am asking is whether when virtual machines change the state of a particular session, does the big huge file itself get fragmented. I'd imagine that a fragmented virtual machine file can be a big problem because you could be reaching over several platters for data that a regular hard drive would keep right next to each other.
For instance, if I have 30 gigabytes free and I create a 20 gigabyte VM file (fixed size), there may be a good chance that the file is not occupying contiguous space on my hard drive. In a perfect world, defrag might be able to fix that.
But say I've got 150 gig's free, I get add a 20 gig VM (fixed size) then I download all of Star Trek The Next Generation, leaving me with 5 gigabytes of free space. I open and close my virtual machine 900 times. Do I have fragmentation in my VM or does it still occupy the same awesome contiguous hunk?
If the answer depends on the OS, that's useful info too. – Peter Turner – 2009-11-23T17:47:09.287
It might help if you clarified whether you're talking about internal or external defragmentation of the virtual disk--internal being the data stored within it, and external meaning whether the virtual disk file itself is fragmented on the host volume. – rob – 2009-11-23T19:05:18.617
Yeah, I was talking about external fragementation. Internally I'd assume it's managed just like any other hunk of memory. I guess maybe it's unclear but I meant VM file, not files in a VM. – Peter Turner – 2009-11-24T14:17:29.817
Yeah, it seems as though the 2/3rds of the answers my question is generating are leading me to believe it was confusing. – Peter Turner – 2009-11-24T14:18:52.170