Dfs, NTFRS and replicating root targets

Created 6th December, 2005 11:02 (UTC), last edited 4th September, 2006 12:51 (UTC)

I've been meaning to take a look at Dfs to see if it would help to manage the server shares on our networks for a long, long time. Finally after doing a transfer of the network to a more secure footing on Windows 2003™ servers I had the chance to do so. It always seems much easier to get these things working from a clean slate.

Generally it works pretty well, but I'm guessing that my choice to replicate the root share is probably not the smartest move. In any case it seems to work pretty well, although I haven't tried it with the master offline. It seems a bit pointless to set up redundant shares if there is still a single point of failure in the root master.

One general tip is to make sure that a given share is empty before adding it to the Dfs tree and certainly before you replicate it, or change the replication settings. If you don't do this expect some weird results as NTFRS tries to work out which copy of the data is the master (the new empty share or the existing one with content). I suspect (but haven't tested) that a manual copy before adding the replication may help, but NTFRS still wouldn't know which security and owner settings to use (unless you take a lot of care to ensure these are properly copied).¹ [1The manual copy doesn't seem to help, you just get two copies of all of the weirdness instead.]

In any case there is only one problem that I'm experiencing.

Extra directories with _NTFRS_ in their names

A bug that was meant to be quashed in Windows 2000™ server has been very much in evidence on our network, fully populated by Windows 2003™ servers resplendent in their service pack one-ery.

In deciding to replicate the Dfs root I'm sure I'm showing my lack of understanding of how Dfs works and how it should be managed. What I'm seeing is the random accumulation of extra directories in the root share when I add new shares to it.

For example, when attaching a new user directory, Bernie, to the Dfs root I ended up with an extra Bernie_NTFRS_14745596 directory in some roots. Occasionally these can be deleted using Explorer, but sometimes they can't.

The solution

The commands for handling it involve use of two commands, dfsutil and fsutil² [2These are both shipped as part of the Windows Server 2003 Service Pack 1 Support Tools set.].

Use dfsutil to find the local path of the offending directory:

dfsutil /viewdfsdirs:drive: /verbose

Replace drive with the offending drive letter (i.e. the drive where the Dfs root share resides).

Follow this with fsutil to remove it with:

fsutil reparsepoint delete directoryname

This time replacing directoryname with one that you want to remove the _NTFS_ link on. Don't forget your double quotes if there are spaces in the names.