Defrag in Vista – what’s new?

There is a new article in the hard-to-discover world, about various improvements of defrag in Vista. In summary: defragmentation is now performed automatically by default (at 1 AM on every Wednesday – that is, if your laptop is not powered off) and it works nicely in an incremental manner – no need to restart a full new defrag every time.

Here is an excerpt:


Partial defragmentation

By default, the defrag tool only defragments files smaller than 64 megabytes (MB). Therefore, files larger than 64 MB are not moved unnecessarily. You can use the -w parameter to tell the defrag tool to defragment all files, regardless of size.

Cancellable defragmentation

In earlier versions of Windows operating systems, if the defrag engine was in the middle of a large move request, it could take lots of time to cancel defragmentation. In Windows Vista, the defrag engine processes input and output requests in smaller portions. Therefore, you can avoid situations where the defrag engine is busy with processing large move requests when you cancel a defragmentation session.

Low priority defragmentation

The defrag engine in Windows Vista does not affect the performance of other processes that are running on the computer. Other processes are not affected because defragmentation runs as a low priority process. And, defragmentation uses only minimal CPU resources and memory resources. If the system is using lots of CPU resources and memory resources, the defragmentation process may take a longer time to finish.

Ability to defragment volumes with less free space

You can defragment volumes in Windows Vista when volumes have less free space than is the case in earlier versions of Windows operating systems.

Faster defragmentation

In some defragmentation modes in Windows Vista, defragmentation of a volume is two or three times faster than defragmentation in earlier versions of Windows. Windows Vista uses significantly improved algorithms that move files toward the front of the hard disk. In earlier versions of the defrag engine, the defrag engine defragmented data at the end of the hard disk before the defrag engine defragmented the data toward the beginning of the hard disk.

Scheduled defragmentation

You can now use Task Scheduler to schedule defragmentation. Therefore, you do not have to manually start defragmentation. By default, a task is created and is set to run at 1 A.M. on every Wednesday. If the computer is turned off or if the task does not run at the scheduled time, the task will run the next time that the computer is idle.

Shadow-copy-aware defragmentation

In shadow-copy-aware defragmentation, defragmentation uses Volume Shadow Copy Service (VSS) in-box software to optimize defragmentation. The VSS software minimizes copy-on-write change blocks. Shadow-copy-aware optimization slows down filling the difference area. This kind of optimization also slows down the reclaiming of old snapshots during defragmentation.

Master File Table (MFT) defragmentation

If the MFT is spread into multiple fragments, the defrag engine can combine the MFT fragments during defragmentation.

Comments (11)

  1. Carlo says:

    Before reading this, I thought Vista had gone backwards when it comes to defragmentation. One thing that’s still a little annoying is that you can’t choose which drives to defragment.

  2. Michael McCollough says:

    I have been searching high and low for a way to connect to a shadow copy and get data off of it programatically but have yet to find an answer. I have a posting in the MSDN forums but it has been there with no attempts to answer since August.

    If I can connect to \servershare and view previous versions with Explorer, why isn’t there some documented way to connect using a script say: \serverspecialchars{shadowid}folder1folder2?

    I could, I supposed, use the VSS api to write a program that would reside on the server (or use vshadow) that could be called from WMI, but I do not see the since in it since there appears to be some facility available that I just do not know how to use. I could probably turn out a lot more programs if I just took the easiest path to follow, but this seems the most logical path.

  3. Adi Oltean says:

    >>> I have been searching high and low for a way to connect to a shadow copy and get data off of it programatically but have yet to find an answer. I have a posting in the MSDN forums but it has been there with no attempts to answer since August.

    Actually it’s easy – what you have to do is:

    1) Get the shadow copy device using VSSADMIN LIST SHADOWS command (or the Win32_ShadowCopy WMI class)

    2) Use CreateFile/FindFirstFile/FindNextFile on the shadow copy device (which is a regular volume device).

    You can also assign a drive letter to the device (using APIs such as CreateDosDevice) and look at the shadow copy contents in Explorer.

    I blogged about this a while back – this works on XP and Windows Server 2003 as well:

    Thanks, Adi

  4. Mick says:

    Is there a way to use Win32_ShadowCopy on 64-bit versions of Windows from a 32-bit application?

  5. Adi Oltean says:

    >>> Is there a way to use Win32_ShadowCopy on 64-bit versions of Windows from a 32-bit application?

    AFAIK – this should work – since this is a WMI class. Calling 64bit WMI providers from 32-bit clients (running in WOW mode) should work by default. Please see MSDN for more details:


  6. Windows Vista e la deframmentazione del disco

  7. Stephen McConnell says:

    I like to SEE what is happening.  Vista is a huge step backwards.  Every time I try to do something, it treats me like a child asking me if I want to do it.

    And now the Defrag utility does not give me a picture of the hard drive that it’s defragging.

    I’m getting ready to Dual Boot my system now.  I’ve got to keep Windoz for the office (small partition) and I’ll use Linux for my personal use.

  8. joby says:

    Totally second Stephen. My Vista is very slow and having ensured its nothing else, its probably fragmentation. I am contemplating switching to another utility before the sickness gets to my drives.

  9. Rangefinders_Rule says:

    Vista’s defrag utility combines a visionary concept with improper execution.

    Microsoft is correct in it’s approach that the workload of routine and boring (but important) system maintenance should be taken off the user and passed on to the PC instead. Theoretically, a system maintenance tool (defrag in this case) that can intelligently manage itself according to CPU/disk activity and other parameters; superior to the obsolete manual or scheduled way of defragging that involves heavy user intervention. Intelligent + automatic = higher efficiency + lesser manpower + better results.

    However, in execution, it has overdone some things by denying users most control options and a progress indicator. The actual performance also leaves quite a bit to be desired. Commercial automatic defragmenters do this in a much sensible manner, giving the user the option of comprehensive involvement in the defrag or a total hands-off  but effective method.

  10. Mark says:

    I’m downloading Diskeeper as we speak. i just tried to run the Vista defragger and cancelled when it appeared that I would have no control. I have 2 physical drives on my new laptop and I want to make sure that each is used as a scratch drive for defragging the other, and in the right order. Way faster that way.

    Microsoft is still trying to emulate Apple, but they just arent smart enough 🙂