The Storage Team Blog about file services and storage features in Windows and Windows Server.
Chat Topic: Disk DefragmentationDate: Wednesday, July 26, 2006Wendy [MSFT] (Moderator):Welcome to today’s chat with the Windows Defrag Team. We will try to answer as many questions as we can today. Participants should type their questions, select the “Ask the experts” check box, and click “Send.” Those posts will go into a private queue, from which our experts will draft answers and repost questions in the upper window with their answers. (To confirm: if you selected the “Ask the experts” check box when you posted, you don’t need to resubmit.
At this time, I’ll let the experts introduce themselves.
Wendy [MSFT] (Moderator):My name is Wendy and I’ll be your tour guide today. If you look out the left window, you’ll see the Vista landscape and off to the right we’re just coming upon the Disk Defrag chat.Sam[MSFT] (Expert):Hello my name is Sam and I am a developer working on Defrag. Sitting with me is Victoria, a tester working on Defrag.Defrag Team [MSFT] (Expert):Hi I am Ivan. I am the Dev Lead for Defrag.
Hi I am Varun. I am one of the testers for Defrag.Georgi Matev [MSFT] (Expert):Hi everyone. My name is Georgi Matev and I'm the Program Manager for defrag in Vista. Charles [MSFT] (Expert):Hi all, I am Charles, one of the developers for DefragDefrag Team [MSFT] (Expert):Q: Could a user lose access on some files while Vista is performing a defrag? (example, the ability to save or move a file while defrag is handling it?)A: No you should be able to continue to use normally the files while they are defragmentedDefrag Team [MSFT] (Expert):Q: Has the MFT % been set to change dynamically based on the drive contents?A: The percentage of initial space reserved for MFT on the volumes has been decreased on Vista. Both on Vista and on XP the MFT can grow as needed when new files are added to the volume.Sam[MSFT] (Expert):Q: Is defrag supposed to be running automaticaly? and if Yes how often with each SKU?A: Yes, defrag in Vista is scheduled to run once per week by default. This happens now at 1am every Wednesday. In previous builds it was 4am Sunday. This is the same for every SKU.Defrag Team [MSFT] (Expert):Q: Doses Defrag optimize on file usage?A: Can you please clarify what you mean by "Doses Defrag optimize on file usage?"Defrag Team [MSFT] (Expert):Q: Have there been any changes to the reporting, or logs, generated by defrag?A: No there are no changes in that aspectGeorgi Matev [MSFT] (Expert):Q: Is Executive software still providing the defrag program for vista?A: No the defrag in Vista is done by the Microsoft team. Charles [MSFT] (Expert):Q: Is there or will their be options for compacting (defraggin freespace) and 'wear leveling' (spreading the data across the disk)?A: Vista Defrag will move files fragments to the front of the as part of the defragging process . This aims to consolidate free spaces at the end of the disk. There is no command line option exposed for compacting free spaces only though.Defrag Team [MSFT] (Expert):Q: Q: Although defrag is supposed to use low-priority I/O in Vista, are you guys actually testing this on underpowered boxes? Believe me, people are going to run Vista on underpowered boxes by the dozen...A: Defrag in Vista uses low priority IO, as well as low CPU and memory priority. This is tested thoroughly. Can you please clarify what do you mean by "underpowered boxes"?Sam[MSFT] (Expert):Q: When does my computer get defragged if it is down at 1 AM on Wednesday?A: Next time you turn it on, defrag will run 30 minutes after starting Vista. Georgi Matev [MSFT] (Expert):Q: Are there plans to build a GUI for the detailed defrag status?A: Not for Vista. There will be improvements in the defrag engine APIs which will aloow for much better reporting of status in the future. For Vista all of the defrag UI is built on top of a scheduled task and the command line. Wendy [MSFT] (Moderator):For those just joining us, today’s chat is about Disk Defragmentation. To post a question, please type your question, select the ���Ask the experts” check box, and click “Send.” Sam[MSFT] (Expert):Q: How often should the average computer user defrag their hard drives?A: Defrag is currently scheduled to run once per week without any user input. We believe that this should suffice for the average user. Power users can schedule defrag to run more frequently if they wish.Defrag Team [MSFT] (Expert):Q: Will the defrag utility in Vista allow you to set a static MFT size to prevent fragmentation?A: The size of the MFT is controlled by the file system. It grows the MFT dynamically as needed when more files are added to the volume. Restricting the size of the MFT would lead to severe problems using the volume. However Defrag does support defragmenting the MFT, except the first fragment, which is unmovable.Georgi Matev [MSFT] (Expert):Q: Can we please have some form of GUI to see what it's doing? Moving little blocks satisfies that need, if even just a little. Please let us see what's going on!A: There will be future improvements in this area for future releases of Windows. For Vista the whole idea is to eliminate the need for users to ever run defrag explicitly. It is a process that can take a while watching it move file blocks is not really useful. When done on a schedule defrag will happen regularly and will have just little chunks of work to do each time and will be completing much faster so reporting status correctly is not crucial. Georgi Matev [MSFT] (Expert):A: Good question. As far as the user experience changes are concerned, the decision to simplify the user interface came as a result of usability research that we did accross various types of users (advanced to novice). The results in most cases indicated that people did not have good understanding of defragmentation and were not using it very often. Because of this we chose to simplify the UI while leaving control to advanced users in the command line. For some of the technical changes you can refer to the blog entry at https://blogs.technet.com/filecab/articles/440717.aspxGeorgi Matev [MSFT] (Expert):Q: Can you share with us the data you have that led to the decision to change the way defrag works in Vista compared to XP?A: Good question. As far as the user experience changes are concerned, the decision to simplify the user interface came as a result of usability research that we did accross various types of users (advanced to novice). The results in most cases indicated that people did not have good understanding of defragmentation and were not using it very often. Because of this we chose to simplify the UI while leaving control to advanced users in the command line. For some of the technical changes you can refer to the blog entry at https://blogs.technet.com/filecab/articles/440717.aspxGeorgi Matev [MSFT] (Expert):Q: Why was the XP style Graphical User Interface dropped? (the before and after defragmentation look was a good design)A: You can find a lot of detail about this at the Defrag FAQ http://blogs.technet.com/filecab/articles/440717.aspxSam[MSFT] (Expert):Q: "power users can use a command-line tool to view detailed fragmentation status and results". Where do I find info about it?A: If you run defrag from the command line (defrag.exe <driveLetter>), you can use the verbose flag /v to get more detailed output. Running defrag.exe /? will list the other options that you can use with the Command Line defrag tool. Make sure to run from an elevated (administrator) command prompt.Defrag Team [MSFT] (Expert):Q: Q: Many testers reported that multiple command-line defrags of their Vista partitions made zero improvement to the reported fragmentation, and in some cases it got worse. Have you observed this? Why does this happen when it's not an issue in XP?A: The Beta2 builds were had some problems properly acounting the free space in the fragmentation report. This has been improved significantly in recent builds. You should see difference in future builds.Georgi Matev [MSFT] (Expert):Q: Why is choosen to leave the 64 Bit chunks in place and not moved, the way defrag is working for now it's not doing the needed job, when disabled and do a defrag from XP to the Vista drive with 3erd party tools Vista responds better.A: I assume you are refering to the partial defrag algorithm which is the default in Vista. We want to take advantage of the fact that the biggest performance gain from defragmentation is when you combine files in "big enough" extents. "Big enough" here is 64 MB, which happens to be about the extent size for which the disk-seek latency starts to become negligible compared to the latency associated with sequentially reading the extent. This means that the performance benefit of coalescing two extents larger than 64 MB is minimal while the I/O load and free space requirements are significant. The different levels of fragmentation that you see for the same volume from Windows XP and Windows Vista are a result of this different treatment of large extents.
Sam[MSFT] (Expert):Q: a bug report was filed that showed discrepencies between what the defrag GUI said, and what the CLI defrag said (ie one said you should defrag, the other said you shouldn't). given those drastic differences in opinion why should anyone trust the defrag GUIA: This was a bug and it has been fixed. The two should agree.Defrag Team [MSFT] (Expert):Q: Will Defrag adjust to not run when Low Power profiles are loaded? Because I've seen high activity from defrag when idle on battery.A: Defrag is not designed to address such problems. It does not directly modify the on disk file system structures. You should run chkdsk /r on the volume in question. Chkdsk is the tool, which has the knowledge how fix such problems.Georgi Matev [MSFT] (Expert):Q: Will the final version have a display on defragment process when run from the GUI? command line options are useless for end users.A: This will not be done for Vista but we'll be making improvements in this area in future releases when some of the interfaces for communicating with the defrag engine are improved. Charles [MSFT] (Expert):Q: Q: [...] was there any change in Vista to help NTFS resist fragmentation? Have the algorithms changed at all since XP/WS2003?A: There has been tremendous change to Defrag algorithm in Vista over WS2003 and especially over XP. In Vista, we allow defragmentation of large files under low disk space or highly fragmented free space condition. Vista defrag also attempt to consolidate free space at the end of the disk so as to allow NTFS to grow file contiguously.
Georgi Matev [MSFT] (Expert):Q: Any chance the UI will be improved to give advanced users more control ie which drives are defragged and more information like graphical display we get in XP?A: This will not be done for Vista but we'll be making improvements in this area in future releases when some of the interfaces for communicating with the defrag engine are improved.
Defrag Team [MSFT] (Expert):Q: Will there be any GPO settings that can be used to schedule disk defragmention?A: No, there are no GPO settings in Vista client. Still you can create a custom scheduled task running the defrag. Adding GPO settings is something we may consider for the incoming server release.Wendy [MSFT] (Moderator):For those just joining us, today’s chat is about Disk Defragmentation. To post a question, please type your question, select the “Ask the experts” check box, and click “Send.” Sam[MSFT] (Expert):Q: Will Defrag adjust to not run when Low Power profiles are loaded? Because I've seen high activity from defrag when idle on battery.A: Defrag will not start if the computer is running on batteries. It will only run on battery power if you start defrag explicitly. Also, if defrag is running and your battery becomes very low, it will quit and show a message to the user.Georgi Matev [MSFT] (Expert):Q: Where can we find the defrag program in vista beta 2? can't seem to locate it in the program filesA: You can find it in Accessories -> System tools Defrag Team [MSFT] (Expert):Q: Will primary disk "offline" defragging be available in Vista?A: No currently there are no plans to have such ability in Vista.Charles [MSFT] (Expert):Q: In what ways are the Disk Defragmentation team working on external media?A: On external hardisk, there should be no difference as internal harddisk.
Defrag will not touch removeable media.Georgi Matev [MSFT] (Expert):Q: I ever wondered why the S.M.A.R.T. technology wasn’t used to preserve hard-disks’ health while defragmenting huge files, like for example VPC virtual hard-disks. Do you plan to add the S.M.A.R.T. support?A: We do query volumes for the disk status reported by SMART and if the disk comes back as failing defrag willl not run. Defrag Team [MSFT] (Expert):Q: Q: If you make a CompletePC[tm] backup, replace the hard drive with anew one, and restore the backup, is the fragmentation restored as well?A: Yes, the volume is restore block by block to exactly the same state as it was during the backup, including the file placement and fragmentation.Sam[MSFT] (Expert):Q: in a multi-drive system (C, D, etc) and systems with connected external USB drives - will all of these drives be defragmented by default? or just the C drive? can that behavior be changed?A: If you run defrag with the -c command line option (this is how it is run by default) all volumes will be defragmented. This includes local hard disks and external drives. There are command line options provided with defrag to select one specific drive to defragment.Defrag Team [MSFT] (Expert):Q: If defrag is set to run automagicaly at 1 am every week and you are on dial up, meaning you shut the machine down every night, how is you hdd going to get defraged???A: The defragmenter scheduled task is created in such way that if the normal run time is missed, half an hour after the next boot it will run automatically. I don't understand how "dial up" is related to defrag though, can you please clarify with more details?Georgi Matev [MSFT] (Expert):Q: Have there been any improvements in the speed? If so, could you elaborate a little on how the process was sped up?A: There are two different factors working in opposite directions here. On one hand the partial defrag algorithm allows for faster defragmentation but on the other hand defrag is doing low-priority I/O (to minimize impact on interactive use) which will cause defragmentation to take longer if there is other higher priority I/O activity. Sam[MSFT] (Expert):Q: Does Defrg do a "Dirty" Flag check before running ?A: Yes it does. If it finds the "dirty" flag on a volume, it will skip that volume and recommend that the user run autochk.Georgi Matev [MSFT] (Expert):Q: probably the question everyone wants the answer to concerning disk defragmenter is why the lack of a visual GUI or at least any kind of indication as to its progress while defragmenting?A: I've answered this a few times today already. The idea here is that we want to take defrag completely out of the picture. Users should not have to run defrag explicitly and they with schedule defrag the need to actually sit and watch defrag work is eliminated. Charles [MSFT] (Expert):Q: Some defrag tools have been noted to cause problems with PGP Laptop Encryption, which stores some decryption information in a hidden file C:\PGPWDE - have you been able to test your defrag with third-party disk-driver-based tools such as drive encryption?A: We have tested defrag on various applications but not on PGP LE particularly. We will recommend that to the test team.Georgi Matev [MSFT] (Expert):Q: will administrators be able to schedule defrags through group policy? will they be able to start a defrag remotely through management console?A: This is something we are considering for the LH server release and Vista SP1. We understand this is an important feature for enterprises. Sam[MSFT] (Expert):Q: Presumably a defrag doesn't affect system performance noticably because I'm frequently working on my PC at 1 am! Why the change from 4 am? Perhaps a compromise is in order, say 3 am. :-)A: Defrag runs with low priority IO so it should not noticably affect your system performance if you are using the machine when it runs.
The decision to change from 4am Sunday to 1am Wednesday was made taking average business and home users into account.Defrag Team [MSFT] (Expert):Q: Q: Have the defrag APIs changed for Vista?A: The file system defragmentation support did not change in Vista. Improvements were made to the inbox defrag.Georgi Matev [MSFT] (Expert):Q: Q: ON XP and WS2k3, third-party defrag apps (we use both O&O and Defrag Manager) seem to be able to deliver much better performance with MUCH lower system load - yet they are using the Win32 defrag API. Why is this? Is this going to be the case in VistaA: On certain workloads the algorithms used by third party perform indeed better. After all better defragmentation is one of the differentiators for these products. The builtin defrag is intended to do maintain the file system in good enough state for most users but users who have especially demanding needs can still benefit from using third party tools. Charles [MSFT] (Expert):Q: Q(20) Does it place defragged files in places on the hdd based on frequency of usage?A: Defrag will move prefetch files (such as system files) in close proximity to each other, and closer to the front of the disk. This list of prefetch files are determined by observing the file access pattern by the system during boot up.
Sam[MSFT] (Expert):Q: Presumably a defrag doesn't affect system performance noticably because I'm frequently working on my PC at 1 am! Why the change from 4 am? Perhaps a compromise is in order, say 3 am. :-)A: System administrators can easily change the time at which defrag runs, using the Disk Defragmenter UI. Georgi Matev [MSFT] (Expert):Q: why move to 1am wednesday - on vista I can see that - but on longhorn server - it shoudl still be sunday - data centerr servers are running at this time and sunday is the least busy timeA: For LH server chances are that the defrag task will be turned off by default as server workloads and requirements vary too much. Defrag Team [MSFT] (Expert):Q: Q: How exactly does the defrag GUI call the defrag APIs? Why does the GUI give different results/performace from the command-line app?A: The UI is running the same scheduled task, which would normally be executed. Also the UI does not recommend you need to defragment your disk if the automatic defrag is on, since it is assuming it will be taken care of on the next run. In such case you may see a recommendation from the command line tool. When the automatic defrag is turned off, the UI performs analyze as well and there were some discrepancies in older builds. This should be fixed in future builds.Charles [MSFT] (Expert):Q: Since Defrag is an automated process, how do users determine it has sucessfully run and when it's last run was completed ?A: Defragging is a best-effort process especially since the disk/volume is live, so it does not indicate a clear success/failure.
As for when the last run was completed, user can verify that in the event log.Defrag Team [MSFT] (Expert):Q: When a PC wakes up from sleep mode, usually you are required to sign in. How does this effect the Wednesday morning defrag?A: The scheduled defrag runs as a system task and does not require an user to be logged on. So the defragmentation should work fine after getting out of sleep, even w/o signing in.Sam[MSFT] (Expert):Q: Re 21 Can the user/admin change the times? Can Vista come out of hibernation by itself to do the defrag per schedule or does machine have to be "on"?A: Yes, system administrators can change the time at which defrag runs, using the Disk Defragmenter UI. You can configure the Defrag scheduled task to wake the computer from Hibernation when it runs. However, this feature is not turned on by default.Georgi Matev [MSFT] (Expert):Q: i know defrag uses lo priority I/O - but its no use if a low priority I/O seeks to the middle/end of the disk when all my high priority i/o is localised at the front. Diskeeper and other defrag engines back off completely with competing disk activity.A: I/O prioritization happens in the I/O subsystem before the I/Os actually hit the disk so the schenario where the disk will be trashing between low and high pri I/O. We are also doing some work for the RTM milestone to further improve this situation. Defrag Team [MSFT] (Expert):Q: Defrag with a bit locked drive is slowing very much?A: The BitLocker encryption is on a volume level below the file system. When any defragmenter moves files the blocks need to be read, decrypted, then encrypterd and written by the BitLocker driver, which may be more CPU intensive then the same operation on non encrypted volume.Sam[MSFT] (Expert):Q: On multiple drive systems are the disks are defragged serially, one after the other?A: Yes, Defrag runs on each volume serially.Georgi Matev [MSFT] (Expert):Q: I still see defrag slow my system when it starts - so it does not really appear to back off. it also competes with the search function and the windows defender. why dont all 2 products comuunicate and work serially together.A: Does your system actually become more responsive if you turn off defrag? Often times it is actually different processes that are causing the machine to slow down. If you look at resource manager you will see that a very small portion of the disk activity is generated by defrag. We are also doign some work for the RTM milestone to further reduce the impact of defrag when there is an active user interacting with the system. Charles [MSFT] (Expert):Q: Other defrag programs put often-changed programs together in a separate area from those that are less often modified to allow for a faster defrag. Will you do this?A: Vista Defrag will move prefetch files closer to the start of disk.
This list of prefetch files determined by its access pattern (such as system boot up)Defrag Team [MSFT] (Expert):Q: Q: In Vista, is there any way to do a boot-time defrag [like Defrag Manager] to defrag system files that are in use? We'reve had very positive results using this idea on our servers.A: Defrag can derfagment files that are in use, during normal runs. The only files that cannot be defragmented are special files that are written directly to, like the swap file, the hybernation file and the files used for shadow copy storage. Moving some of those files will cause data loss/corruption.Wendy [MSFT] (Moderator):Q: Q: Is there a maximum length of time the Vista scheduled backup will run before it times out? Or will it run for e.g. 10 hours if the performance is bad enough and the fragmentation awful? Can we adjust this? You can in Defrag Manager...A: Unfortunately, this is not related to today's chat topic. However, this is a great question to ask in the NGs and get some assistance from the product groups and/or your fellow BTs!Georgi Matev [MSFT] (Expert):Q: Q: Is there a maximum length of time the Vista scheduled backup will run before it times out? Or will it run for e.g. 10 hours if the performance is bad enough and the fragmentation awful? Can we adjust this? You can in Defrag Manager...A: There are no plans to do this. Defrag will run as long as it needs to. Defrag Team [MSFT] (Expert):Q: Is defrag going to fix problems with bad blocks stored from recovery on a new physical media?A: Defrag is not designed to address such problems. It does not modify the on disk file system structures. Chkdsk is the only tool, which has the needed knowledge how to address such problems. You should run chkdsk /r on the volume to fix this problem.Georgi Matev [MSFT] (Expert):Q: Are there any thoughts to automating defrag to run on shut-down on a scheduled basis?A: Not at this time. You can certainly use task scheduler and defrag.exe to configure such a task though. Wendy [MSFT] (Moderator):We will need to wrap up this chat in about 15 minutes. Please post any other questions (select the “Ask the experts” check box) that you would like us to answer. Georgi Matev [MSFT] (Expert):Q: will defrag restart a missed task? Eg If the PC isn't on at 1am on Weds.A: Yes. The task will start after some delay when the machine comes back online. Wendy [MSFT] (Moderator):Q: Experts & Mod, thank you for hosting this chat, and for your time and expertise!A: Before you leave the chat, don’t forget to let us know how we’re doing! To the right of your emoticon pull-down box is a “Chat Feedback” option. If you don’t feel the chat was helpful, please ensure that you provide verbose comments on why you didn’t feel it was helpful and what we can do to improve the experience for you!! If you would like to provide more feedback than the 1000 characters will allow, feel free to eMail us at LHBeta@microsoft.com.Defrag Team [MSFT] (Expert):Q: Is there any system in place to defragment system files, those that are in use by the system at all times? Will there be any offline option on restart for Vista system files?A: There is such feature since Windows XP. It is called Prefetch. It exists in Vista and we have made improvements to it. The process works online, there is no need to be offline.Sam[MSFT] (Expert):Q: Will defrag detect disk errors and alert the user? Will it check the SMART status of the drive?A: We do query volumes for the disk status reported by SMART and if the disk comes back as failing defrag willl not runDefrag Team [MSFT] (Expert):Q: can you confirm if defrag is completely mutitheaded for multicoresA: Defrag is mostly IO bound, not CPU bound. Further defrag supports defragmenting only 1 volume at a time. So optimizations for hyperthreaded/multicore CPUs are not much applicable to Defrag. Further Defrag is running at low CPU priority, trying to leave as much CPU power as possible to the user.Charles [MSFT] (Expert):Q: Q: Can the scheduled defrag be clever enough NOT to start if the system is not idle?A: Defrag IO are presently low-priority.
What being said, we are presently working with the scheduler team to launch defrag when the system is less active. Also, we are adding back off behavior for defrag when there are user interaction.Sam[MSFT] (Expert):Q: how does defrag handle multiple disks/partitions? Do they all start at 1am on Weds? Or is only the system drive scheduled in this way?A: By default, the defrag scheduled task runs on all volumes serially. The first volume will be defragged at the scheduled task-run time. The second will be defragged immediately after the first volume finishes.Defrag Team [MSFT] (Expert):Q: [Defrag team] by "underpowered boxes" I mean machines that meet the minimum system requirements for Vista but run very slowly. Load lots of apps and things slow to a crawl... and then if defrag kicks in, I wonder whether the lower priority I/O ideaworksA: Low CPU, memory and IO priority used for Defrag means that the kernel will always give more CPU timeslices, and IO bandwidth to other applications, running with normal priority. On a slow and loaded machine, defrag will run slow, but eventually should finish.Georgi Matev [MSFT] (Expert):Q: Why do multiple defrags of the same volume show so little improvement in fragmentation analysis after the defrags? It almost seems as if defrag is not only doing little, but sometimes, making things worse.A: There have been some issues with inaccurate reports in previous builds. This has been greatly improved for the RC1 build which you will get. I believe you will see a big difference. Charles [MSFT] (Expert):Q: in XP the prefetch files are placed 2/3 down the volume. unless I have a heavy used volume - ( i use 300gb drivers with 10gb in use for performance) then the disk seek overhead is high - why not move them and swap file near data actually in use.A: In Vista, we have move the prefetch zone closer to the start of the disk.Georgi Matev [MSFT] (Expert):Q: will defrag restart a missed task? Eg If the PC isn't on at 1am on Weds.A: A missed task will run after some delay the next time the machine is online. Defrag Team [MSFT] (Expert):Q: Does Vista defrag defrag the swap file? If not, is there a workaround so we can get it defraged without "outside" utilities?A: No Defrag cannot defragment the swap file, since it is written to directly and locked by the memory manager. However the strategies for allocating the swap file have been improved on Vista and you should see less file fragments in it.Georgi Matev [MSFT] (Expert):Q: Sometimes you have to run XP defrag several times to get the best results. In particular it doesn't compact files totally on the first run. Does Vista do this as well?A: The compacting behavior of defrag for vista has changed quite a bit so you should see an improvement. Defrag Team [MSFT] (Expert):Q: Will defragging a Vista drive while in XP SP2 cause any problems for Vista and its file structure?A: No there should not be any problems WRT file system structures.Wendy [MSFT] (Moderator):Due to the number of questions, the team has agreed to stay for another 15 minutes to get as many of your questions answered as possible. However, I will be closing down further new questions.Sam[MSFT] (Expert):Q: Are there any benefits to defragging a USB flash drive?A: Not really because there is no seek time on a USB flash drive, like there is on a hard disk. Also, it is not a good idea to read and write regularly from a flash drive because it can wear them out quicker.Charles [MSFT] (Expert):Q: Sometimes you have to run XP defrag several times to get the best results. In particular it doesn't compact files totally on the first run. Does Vista do this as well?A: A problem with XP defrag is that it does requires large contiguous free space to optimize large files. This in turn causes files compaction to be ineffective until several runs. We have improved that for Vista.Georgi Matev [MSFT] (Expert):Q: Since we are all "beta" testers and install, remove programs frequently the need to defrag more often is real, will we have to use a command line evertime to defrag?A: You are correct about people testing betas but once the product is released we don't expect people to be continuously installign and uninstalling programs. Defrag Team [MSFT] (Expert):Q: Q: Are you testing Vista with really really large partitions? I have a 900GB partition on a x64 system and it's almost full. I would hate to see what happens if Vista starts defrag on this every week. Is there a "sanity check" of any kind?A: Yes we do test with different volume sizes. For effective defragmentation on a volume of any size you should have some reasonable free space left on it. If that is the case, after couple scheduled runs, even on a heavily fragmented volumes, most of the files should not moved further, until significant changes happen to the volume.Charles [MSFT] (Expert):Q: If you install Virtual PC on a VISTA workstation and cereate a VISTA Virtual PC image and have it running when the scheduled defrag starts, the host VISTA could be defragging the vhd file and the Virtual VISTA could be defraggin the files in the VHD file?A: Yes.Sam[MSFT] (Expert):Q: If I have USB disks, and thumb drives plugged in when the scheduled defrag starts will they be defragged also and do all drives get defragged at once ore are then done sequentially?A: USB flash drives wil be skipped by defrag if they are formatted with FAT. All other drives will be defragged sequentially.Charles [MSFT] (Expert):Q: Why do we not see individual drive fragmentation or am able to choose which drives we want defragged automatically? for instance i have a 250 gig drive with dvds on it and dont want that drive defragged all the time.A: Thanks for the suggestion. We are considering volume exclusion on Defrag for SP releases.Defrag Team [MSFT] (Expert):Q: The XP defrag has an available space requirement of (I think) 15% The UI tells you when it's lower than this (and the defrag doesn't work too well). In the absence of a UI, how does Vista handle this?A: The Vista defrag has been improved to require significantly less disk space to defragment a volume. Still if the volume is mostly full, this will impact the ability of defrag to do it's job. But it will not give up w/o trying.Georgi Matev [MSFT] (Expert):Q: For defrag process, especially when run manually which will be done, a progress bar either with or without a display like 2K and XP have would easily fix the problem and greatly improve Defrag.A: I agree that the current manual defrag experience is less than ideal. In future versions there will be improvements to the defrag engine interfaces that will allow for better status reporting. Keep in mind that since the file system is changing under defrag, it backs off when there is higher priority I/O and it may take serveral passes to complete defrag, accurate progress reporting is almost impossible. Sam[MSFT] (Expert):Q: Does defrag cleanup fragmented MFTs?A: All movable MFT fragments are defragmented after the defrag operation is completed. Georgi Matev [MSFT] (Expert):Q: If defrag is ment to be akin to to a low level windows operation, would it not be better to run it as a service that is started and stopped by the schedule managerA: This is something which we are in fact considering for future releases. Sam[MSFT] (Expert):Q: Q: Does defrag defragment all drives at the same time, or one after another?A: Volumes are defragmented sequentially.Georgi Matev [MSFT] (Expert):Q: Is there a way to analyse the stat of fragmentation on the disk, via the command line tool?A: Sure. defrag.exe -a -v <volume drive letter>Defrag Team [MSFT] (Expert):Q: If defrag is ment to be akin to to a low level windows operation, would it not be better to run it as a service that is started and stopped by the schedule managerA: The defrag engines always run as a COM server, w/o any UI. We may consider consolidating the defrag process in a service for a future release. Still the standard and supported way to have scheduled tasks in Windows is via the task scheduler.Georgi Matev [MSFT] (Expert):Q: Why will there be no GPO settings for defrag?A: We are considering this for the LH server release. Charles [MSFT] (Expert):Q: [Charles] I'm talking about changes in the NTFS storage algorithms to prevent fragmentation, not changes in the algorithms to defrag once the FS is already fragmented....A: I can't speak for NTFS in detail, but I know there are consideration made by NTFS in their file allocation policySam[MSFT] (Expert):Q: At one point on Windows 2003 defrag would sometimes confuse VSS into thinking files had changed when they were moved by defrag and excess copies would be made in the VSS storage is that completly corrected in VISTA VSS?A: This issue has been fixed in Vista. Vista defrag has been optimized for volsnap.Georgi Matev [MSFT] (Expert):Q: Can defrag be disabled?A: The scheduled task can be turned off. Georgi Matev [MSFT] (Expert):Q: Will manual degrag allow it to run not at a low priority so it is finished faster?A: Not for Vista. Georgi Matev [MSFT] (Expert):Q: Does defrag post status entries to the event log?A: It posts messages when it finishes defragmenting a volume. Sam[MSFT] (Expert):Q: Q: Does defrag back off / abort if it detects FS corruption or disk errors? If not, why not?A: Yes, defrag will skip a corrupt volume. It will alert the user and recommend running autochk.Georgi Matev [MSFT] (Expert):Q: Thank you on Q8. Please alert the user to SMART failure tooA: There will be a popup message for the user in case of SMART failures. Defrag Team [MSFT] (Expert):Q: Is there any plan to run defrag when inactivity is detected?A: No not at this time. The reason behind this is that running constantly defrag may make many unnecessary moves on temporary files, which will not give realistic fragmentation improvements in the long run, but may affect the life time of the hard disk.
However we may consider doing the opposite, backing off the defrag when there is user activity.Georgi Matev [MSFT] (Expert):Q: Do you have a kind of "I-FAAST" technologies (Intelligent File Access Acceleration Sequencing) in the built in defragmenter ?A: I'm unfortunately not familiar with this technology. Georgi Matev [MSFT] (Expert):Q: Can defrag be disabled?A: Yes.Sam[MSFT] (Expert):Q: Will automatic background HDD defrag be available in VistaA: Yes, Vista's defrag is set by default to run once per week at Wednesday 1am.Georgi Matev [MSFT] (Expert):Q: How do you prevent the built-in defrag from overwritting a 3rd-Party defragmenter's layout/placement ?A: We do not. Third party tools can choose to disable the built in defrag task.Georgi Matev [MSFT] (Expert):Q: Is there a defrag newsgroup for us to discuss this feature more?A: You post in the general filesystems beta newsgroup. Sam[MSFT] (Expert):Q: Will there be document to explain the related API for the defragemenation seeting? Such as if a build will like to customerize the setting to OPK build?A: If you have questions or need documentation you should bring this up with your Microsoft Liason.Charles [MSFT] (Expert):Q: How do you prevent the built-in defrag from overwritting a 3rd-Party defragmenter's layout/placement ?A: Unfortunately you can't.
In general, a user should not be running two different versions of defrag as the 2 algorithms can easily stepped on each others' feet. Georgi Matev [MSFT] (Expert):Q: Does defrag support mounted volumes or do they have to have a drive letter ?A: We support mounted volumes. Defrag Team [MSFT] (Expert):Q: How much or will there be any performance loss using disk defragmentation on a bitlocker enabled laptop?A: There will be some performance hit. Defrag is running at low CPU priority in order to make sure it does not starve the programs running at the same moment. The actually performance penalty depends on the CPU speed, the disk speed and on the TPM chip (or absense of such).Georgi Matev [MSFT] (Expert):Q: What happens if the -v switch is added to the scheduled defrag job?A: We do not interpret the output of the command line in any way so it will have no effect. Charles [MSFT] (Expert):Q: If the defrag uses that low priority, why can't we select to let it run all times? Like if I boot my system, and my disks are fragmented for 2% or more, it starts defrag my discs???A: This is because, even at low priority, it still requires system resources.Georgi Matev [MSFT] (Expert):Q: My VISTA system was running fine when I went to bed last night. It had a BSOD this morning when I got up. Is it possible there was a problem with the 1am Defrag?A: Unlikely. Defrag interacts with the file system just like any other user mode application. Georgi Matev [MSFT] (Expert):Q: In XP defrag seems to do a better job, is that because all the restore files have been deleted?A: Defrag does not delete any files in either XP or Vista. Defrag Team [MSFT] (Expert):Q: re q I see defrag use 100% of the cpu (50% on a hyperthread) many times - so it is still too compute intensive. The vista scheduler is still not that good..... to back off low priority 100% compute and not affect performance.A: I don't know what was q, but running at low CPU priotity does not mean that defrag is not going to use the CPU if available. It means that if there are other applications, which need the CPU and run at normal priority, the kernel will give them more time slices than to defrag.Charles [MSFT] (Expert):Q: When defrag moves files does it leave information fragments in the original location that could be read by low level disk utilities or does it blank the old space?A: It will leave blank in the old space.Georgi Matev [MSFT] (Expert):Q: Any worries for situation of system unexpectedly powered off / haulted whilst defrag is running? Will the UPS service stop it?A: Defrag uses the file system defrag APIs which will preserve the consistency of the file system in the case of a crash or power off. Sam[MSFT] (Expert):Q: How does Disk Defragmentation handle the "Previous Versions" information for files/folders?A: Defrag will not affect the "Previous Versions" of your files. This information is stored in the VSS diff area, which cannot be moved by defrag, or 3rd party tools.Defrag Team [MSFT] (Expert):Thanks for the chat, it was great one, see you in the news groups.Sam[MSFT] (Expert):Thanks for the chat guys -- great questions!! We'll see you in the newsgroups!Wendy [MSFT] (Moderator):Great chat, everyone!!!!! See you in the newsgroups!Charles [MSFT] (Expert):Thanks all for the questions and suggestions, folks! We will meet again!Georgi Matev [MSFT] (Expert):Thanks guys. Unfortunately our time is up. Please post any unanswered questions to the newsgroups and we'll do our best to answer them.