This project is read-only.

adding files to a vhd which is nearly full and defrag

Dec 3, 2009 at 1:03 PM


when I add some files to a vhd which is nearly full (Partition is 25 GB and e.g. used 24GB), the discutils start to defragment the vhd, for afai can see every file I add.
This takes ages when the disk is full ....

Can I do something so e.g.
- defrag is done just once at the end of adding the files
- defrag isn't done at all
- use another format, currently it's dynamic

Any hints?

Ciao Ephraim

Dec 6, 2009 at 12:39 PM

Hi Ephraim,

This is a limitation in the NTFS implementation right now.  The big problem is there's no code to support writing to highly fragmented files, or files with lots of NTFS attribute data.  In these cases, the file needs to occupy multiple Master File Table records - right now, if that situation occurs a primitive copy ('defrag') is done to try to squeeze the file back into a single MFT record.  As disks get full, the likelihood of all this happening increases greatly.

It's horribly inefficient the way it's implemented right now.

I'll change this thread into a work item.



Dec 6, 2009 at 12:41 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.