Manually Clearing the ConflictAndDeleted Folder in DFSR
Ned here again. Today I’m going to talk about a couple of scenarios we run into with the ConflictAndDeleted folder in DFSR. These are real quick and dirty, but they may save you a call to us someday.
Scenario 1: We need to empty out the ConflictAndDeleted folder in a controlled manner as part of regular administration (i.e. we just lowered quota and we want to reclaim that space).
Scenario 2: The ConflictAndDeleted folder quota is not being honored due to an error condition and the folder is filling the drive.
Let’s walk through these now.
Emptying the folder normally
It’s possible to clean up the ConflictAndDeleted folder through the DFSMGMT.MSC and SERVICES.EXE snap-ins, but it’s disruptive and kind of gross (you could lower the quota, wait for AD replication, wait for DFSR polling, and then restart the DFSR service). A much faster and slicker way is to call the WMI method CleanupConflictDirectory from the command-line or a script:
1. Open a CMD prompt as an administrator on the DFSR server.
2. Get the GUID of the Replicated Folder you want to clean:
WMIC.EXE /namespace:\\root\microsoftdfs path dfsrreplicatedfolderconfig get replicatedfolderguid,replicatedfoldername
(This is all one line, wrapped)
Example output:
3. Then call the CleanupConflictDirectory method:
WMIC.EXE /namespace:\\root\microsoftdfs path dfsrreplicatedfolderinfo where "replicatedfolderguid='<RF GUID>'" call cleanupconflictdirectory
Example output with a sample GUID:
WMIC.EXE /namespace:\\root\microsoftdfs path dfsrreplicatedfolderinfo where "replicatedfolderguid='70bebd41-d5ae-4524-b7df-4eadb89e511e'" call cleanupconflictdirectory
4. At this point the ConflictAndDeleted folder will be empty and the ConflictAndDeletedManifest.xml will be deleted.
Emptying the ConflictAndDeleted folder when in an error state
We’ve also seen a few cases where the ConflictAndDeleted quota was not being honored at all. In every single one of those cases, the customer had recently had hardware problems (specifically with their disk system) where files had become corrupt and the disk was unstable – even after repairing the disk (at least to the best of their knowledge), the ConflictAndDeleted folder quota was not being honored by DFSR.
Here’s where quota is set:
Usually when we see this problem, the ConflictAndDeletedManifest.XML file has grown to hundreds of MB in size. When you try to open the file in an XML parser or in Internet Explorer, you will receive an error like “The XML page cannot be displayed” or that there is an error at line X. This is because the file is invalid at some section (with a damaged element, scrambled data, etc).
To fix this issue:
- Follow steps 1-4 from above. This may clean the folder as well as update DFSR to say that cleaning has occurred. We always want to try doing things the 'right' way before we start hacking.
- Stop the DFSR service.
- Delete the contents of the ConflictAndDeleted folder manually (with explorer.exe or DEL).
- Delete the ConflictAndDeletedManifest.xml file.
- Start the DFSR service back up.
For a bit more info on conflict and deletion handling in DFSR, take a look at:
Staging folders and Conflict and Deleted folders (TechNet) DfsrConflictInfo Class (MSDN)
Until next time...
- Ned "Unhealthy love for DFSR" Pyle
Comments
- Anonymous
October 06, 2008
The comment has been removed - Anonymous
October 06, 2008
There will be a small service fee for my psychic powers. :)
- nedpyle
Anonymous
October 07, 2008
The comment has been removedAnonymous
November 04, 2008
Hi there, Thank you very much for the info. our DFS conflict folder bloated to a massive 130GB, and it almost gave me a panic attack! :P I initially tried the WMI script, weirdly enough, it did not work (gasp!) I am now doing a manual delete (DEL command), cross fingers and toes that it works as planned and won't bring down our infra. :P will update the blog again. Cheers! NathanielAnonymous
November 04, 2008
The comment has been removedAnonymous
April 09, 2010
The comment has been removedAnonymous
April 09, 2010
The comment has been removedAnonymous
June 22, 2010
The comment has been removedAnonymous
June 22, 2010
The comment has been removedAnonymous
June 22, 2010
The comment has been removedAnonymous
July 02, 2010
I stumbled on this article by accident but it prompted me to check my folder sizes. Turned out I had several that had exceeded their quotas many times over. This was on a Server 2003 R2 so I wasn't sure if your trick would work. It did brilliantly though so thanks very much. It would be great to work this little function into a button on the GUI (as shown on your 3rd image)Anonymous
July 06, 2010
The comment has been removed