Manually Clearing the ConflictAndDeleted Folder in DFSR

Manually Clearing the ConflictAndDeleted Folder in DFSR

  • Comments 12
  • Likes

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:

image

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

image

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:

image

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:

  1. 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.
  2. Stop the DFSR service.
  3. Delete the contents of the ConflictAndDeleted folder manually (with explorer.exe or DEL).
  4. Delete the ConflictAndDeletedManifest.xml file.
  5. 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

  • Ned,

    great. I actually was looking for this today, because we had an issue where the "normal" cleanup for some reason did not occur and 130 GB of data was roaming around the ConflictAndDeleted folder. The WMI call did the trick, thanks.

    regards,

    Marcel Heek

  • There will be a small service fee for my psychic powers. :)

    - nedpyle

  • Hi Ned!

    Now that you´re into the cleaning business =), what about the Staging folder under DfsrPrivate folder.

    Are there any special considerations to have in mind if you want to clean that folder if there is data that seems to be stuck in it.

    Regards

    Stefan Nilsson

  • 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!

    Nathaniel

  • Thanks Ned for your tip. it worked and our DFS is now back to a stable size.

    Cheers

    Nathaniel

  • Ok, bump into this one...

    I seem to have a problem with doing the initial command (the one where we get the GUIDs).

    My namespace is \\rodic.com\dfs, when I do the path dfsrreplicatedfolderconfig part I get an error 0x8004100e INVALID NAMESPACE .

    Hmm, any ideas? What am I doing wrong?

  • Since you didn't post your syntax I cannot be sure. It sounds like you are confusing your DFS Namespace with the WMI namespace of the command. You do not need to alter the command line to obtain the Replicated folder GUIDs. Run it as is.

    The same is true for the command that you run to purge the ConflictAndDeleted folder. The Namespace we are targeting with WMIC is the WMI namespace "\\root\microsoftdfs" not your DFS Namespace. For example:

    wmic /namespace:\\root\microsoftdfs path dfsrreplicatedfolderinfo where "replicatedfolderguid='81CD0A52-F132-4A91-BEF7-205262F526BA'" call  cleanupconflictdirectory.

    The only portion of command line you need to change is the GUID "81CD0A52-F132-4A91-BEF7-205262F526BA" with your replicated folder's GUID.

    wmic /namespace:\\root\microsoftdfs path dfsrreplicatedfolderinfo where "replicatedfolderguid='Darko's RF GUID goes here'" call  cleanupconflictdirectory.

    This KB also explains how to run the command. http://support.microsoft.com/default.aspx?scid=kb;EN-US;951010

  • Hi Ned,

    Did this command work in windows server 2008 DFS? I'd submit it as below. But nothing to happen with conflict folder pass 12 hour.

    C:\>wmic /namespace:\\root\microsoftdfs path dfsrreplicatedfolderinfo where "rep

    licatedfolderguid='9CEE25F4-E557-48A8-8933-0D2F79F2E2CB'" call cleanupconflictdi

    rectory

    Executing (\\FTCHD01\root\microsoftdfs:DfsrReplicatedFolderInfo.ReplicatedFolder

    Guid="9CEE25F4-E557-48A8-8933-0D2F79F2E2CB")->cleanupconflictdirectory()

    Method execution successful.

    Out Parameters:

    instance of __PARAMETERS

    {

           ReturnValue = 0;

    };

    regards,

    Aidan Wen

  • Hi Ned,

    Did this command work in windows server 2008 DFS? I'd submit it as below. But nothing to happen with conflict folder pass 12 hour.

    C:\>wmic /namespace:\\root\microsoftdfs path dfsrreplicatedfolderinfo where "rep

    licatedfolderguid='9CEE25F4-E557-48A8-8933-0D2F79F2E2CB'" call cleanupconflictdi

    rectory

    Executing (\\FTCHD01\root\microsoftdfs:DfsrReplicatedFolderInfo.ReplicatedFolder

    Guid="9CEE25F4-E557-48A8-8933-0D2F79F2E2CB")->cleanupconflictdirectory()

    Method execution successful.

    Out Parameters:

    instance of __PARAMETERS

    {

           ReturnValue = 0;

    };

    regards,

    Aidan Wen

  • Hi Ned,

    I do it again and work now. I'm not sure that what's happen. Anywey,Thanks!

    regards,

    Aidan

  • 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)

  • "It would be great to work this little function into a button on the GUI (as shown on your 3rd image)"

    Agreed. Maybe someday...

    - Ned