Windows DFS

The links below lead to sections within this page.


Distributed File Sharing(DFS) Overview

DFS was introduced in Windows NT, and then developed further in subsequent Windows releases. DFS consists of two parts, DFS Name Spaces and DFS Replication

The idea behind DFS Name Spaces is to hide the location of a file or directory from a user, so that if a file or disk moves around the user is unaware of the details. There is no requirement to change drive mappings or add extra drive letters. This also means that if data is moved onto new servers, or consolidated, this can also be transparent to users. The user does not need to know or care about the physical location of the file, only where it is located in the hierarchical view. That means that users no longer search for files by opening file servers and disk drives, and looking through a separate directory structure on each. Instead, users look through a logical directory that places shared information in a place that makes more sense to users and administrators alike.

DFS Replication is about having more than one copy of data distributed around your enterprise. Windows will automatically direct clients to use the closest DFS server and If that server fails, then you will be automatically switched to another DFS server. DFS can also refer to alternate data volumes, which can be used to balance performance by spreading the workload. The effectiveness of application failover depends on how quickly an application can detect that a disk has failed. Once the failure is detected, the application will switch to another disk. However open files cannot be failed over and might be unusable.

The two terms that are critical to understanding DFS are:
The DFS root is the starting point for DFS links and is visible on the Network.
A DFS link is a pointer from the DFS root to another share on the Network. When someone clicks on the link they are redirected to the network share.

The original DFS replication product was FRS, which was replaced by DFSN in Windows Server 2003 R2. The main improvements that DFSR introduced were:

  • Replication works at block level instead of file level. This means that if a large file such as a database or an outlook pst file is changed, only the changed blocks are replicated, not the entire file.
  • DFSR uses compression, which, combined with block level replication above, reduces the amount of replication traffic on the network.
  • DFSR has better scheduling capabilities so replication can be timed to run a times when network traffic is lower than normal.

back to top


The DFS root and DFS volumes

The starting point for DFS is the DFS root, which is a local share that hosts other shares. You define and administer the DFS root from 'Start', 'Programs', 'Administrative Tools', 'Distributed File System'.

There are two types of DFS root, stand-alone or domain-based.

  • A stand-alone DFS root can have only a single level of DFS links and cannot have root-level DFS shared folders.
  • A domain-based DFS root can have multiple levels of DFS links, can have root-level DFS shared folders and must be hosted on a domain member server.

A DFS volume is the combination of a DFS root, and the DFS links attached to it. A DFS volume is accessed using a standard UNC name:

\\Server-Name\Dfs-Share-Name\Path\File

where Server-Name is the name of the host computer, Dfs-Share-Name is your DFS root, and Path\File is any valid Win32 path name.

A volume can contain thousands of shares. If you access a remote share, then the system caches certain information locally. The next time you accesses that share, you access the local cache, rather than pulling a fresh copy from the remote server.

It is possible for this cache to be either pointing to the wrong location or to be corrupt, usually identified by the informative message "Server cannot find network path of DFS name space"

To fix this you need to have 'File Services Tools' installed on the server. If you don't have them installed, you can find them in Server Manager, Add Feature, Remote Server Administration Tools (RSAT), Role Administration Tools, File Services Tools. Once you have them installed, open a command window as Administrator and run the command

dfsutil cache referral flush

This should clear your cache without a server reboot and the share should be accessable again.

If you can't actually see your DFS links, first check the obvious and make sure you do not have a filter in place. There was a known error under Win2000 where the local file system place holders were missing because the 8.3 file name support had been disabled.

To fix this, you need to update a registry key. You use the registry editor at your own risk and if you really get it wrong, you may need to reload the windows operating system.

If you know what you are doing, then the key you need to update is

HKEY-LOCAL-MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem

Look for the NtfsDisable8dot3NameCreation value, change the DWORD to type 0 then reboot the server.

back to top


Shares

Windows allows you to mark directories or files as 'shares', which means that other users on a Network can access them. To enable shares for a directory, right click it with your mouse, then select the sharing option. This is 'sharing and security' on Windows XP. Click the 'Share this Folder' radio button, give the share a name, and by default the 'Everyone' user group will get read access. You can change the access levels with the 'Permissions' button.
Drives will have a default share which ends in a dollar sign, for example c$, this is the administrative share, and is not visible to others. To make a drive visible to others, you need to add a new share with the 'new share' radio button. Do not delete the administrative share.

Administrators can link shares together to create a single volume that looks like one massive hard drive to the users. Individual users can define their own DFS volumes, and these can be combined with other DFS volumes using inter-DFS links. Suppose you define the c: drive on your PC as a DFS volume. If you then turn your PC off, the volume is unavailable, but that does not affect any of the other DFS volumes in the DFS volume name space.
DFS will support either FAT or NTFS format DFS roots. If you cross a 'junction' to a DFS root with a different format, you change from one file format to the other.

back to top


DFS Applications

DFS can simplify server replacement. Every node in the DFS directory is assigned a logical name that points to a file share. The DFS node can be switched to point to a new server and the users do not know that they are accessing a different server. The logical names can be descriptive.

DFS can also simplify backup, especially if you need to backup workstations. The workstations can all be defined as DFS nodes, and then processed from a single root. The only issue is that your backup utility will not be able to re-create the DFS if a recovery is needed. You need to rebuild the DFS tree first before recovering the workstations. You could also apply the same principle to group all your servers together into a single volume, but the backup time will probably be excessive. If you chose to do this, you need to make sure that your recovery plan takes DFS into account.

You can run virus scanning and content indexing over several volumes from a single DFS root too, but make sure that any application you run that scans files is 'DFS Aware' and will not trigger unnecessary replication.

Managing DFS

There are at least two ways to manage your DFS environment, you can use the 'DFS Management' MMC, which will appear in 'Administrative Tools' after you add the DFS role service in Server Manager, or you can use the Dfsutil command from an Administrator command line.

A selection of dfsutil commands include

  • To add a new root in a domain based DFS:
    dfsutil /addftroot: new_dfs_root_name /server: dfs_server_name /share: dfs_share_name
  • To create a new stand-alone namespace:
    dfsutil root addstd \\SRV02xx01\StandaloneNamesapce1
  • To delete the namespace root
    dfsutil root remove \\lascon.co.uk\DomainNamespace1
  • To display information about the links:
    dfsutil link \\lascon.co.uk\DomainNamespace1
  • To add a link to a namespace:
    dfsutil link add \\lascon.co.uk\DomainNamespace1\link1 \\server\share
  • To delete a link and any associated targets:
    dfsutil link remove \\lascon.co.uk\DomainNamespace1\link1

DFS Backup and Restore

The dfsutil command cal also be used to backup and recreate a DFS namespace. To backup the namespace use the following command to create a script file. Add the 'downlevel' parameter if you need your export to be WIN2003 compatible. The sytax is export dfs_name file_name as shown below.

dfsutil root export \\lascon.co.uk\DomainNamespace1 C:\dfsexport\exp021113.txt

To recreate a DFS namespace, use the import command. Two options are available, SET which creates a new namespace and MERGE which combines the information from the import file with any that exists in the namespace. If conflicts occur, then the data in the import file takes precedence. There is also a COMPARE option that lets you see what will happen before running the import. The examples below show sample file and share names.

dfsutil root import compare C:\dfsexport\exp021113.txt \\lascon.co.uk\DomainNamespace1
dfsutil root import set C:\dfsexport\exp021113.txt \\SRV02xx01\DomainNamespace1
dfsutil root import Merge C:\dfsexport\exp021113.txt \\SRV02xx01\DomainNamespace1