5 <firstname>Shirish</firstname><surname>Kalele</surname>
7 <orgname>Samba Team & Veritas Software</orgname>
9 <email>samba@samba.org</email>
14 <pubdate>12 Jul 2000</pubdate>
17 <title>Hosting a Microsoft Distributed File System tree on Samba</title>
20 <title>Features and Benefits</title>
23 The Distributed File System (or DFS) provides a means of separating the logical
24 view of files and directories that users see from the actual physical locations
25 of these resources on the network. It allows for higher availability, smoother
26 storage expansion, load balancing etc.
30 For information about DFS, refer to
31 <ulink url="http://www.microsoft.com/NTServer/nts/downloads/winfeatures/NTSDistrFile/AdminGuide.asp">
32 Microsoft documentation at http://www.microsoft.com/NTServer/nts/downloads/winfeatures/NTSDistrFile/AdminGuide.asp</ulink>.
36 This document explains how to host a DFS tree on a Unix machine (for DFS-aware
37 clients to browse) using Samba.
41 To enable SMB-based DFS for Samba, configure it with the <parameter>--with-msdfs</parameter>
42 option. Once built, a Samba server can be made a DFS server by setting the global
43 boolean <ulink url="smb.conf.5.html#HOSTMSDFS"><parameter> host msdfs</parameter></ulink>
44 parameter in the <filename>smb.conf </filename> file. You designate a share as a DFS
45 root using the share level boolean <ulink url="smb.conf.5.html#MSDFSROOT"><parameter>
46 msdfs root</parameter></ulink> parameter. A DFS root directory on Samba hosts DFS
47 links in the form of symbolic links that point to other servers. For example, a symbolic link
48 <filename>junction->msdfs:storage1\share1</filename> in the share directory acts
49 as the DFS junction. When DFS-aware clients attempt to access the junction link,
50 they are redirected to the storage location (in this case, \\storage1\share1).
54 DFS trees on Samba work with all DFS-aware clients ranging from Windows 95 to 200x.
58 Here's an example of setting up a DFS tree on a Samba server.
61 <para><programlisting>
68 path = /export/dfsroot
70 </programlisting></para>
73 <para>In the /export/dfsroot directory we set up our dfs links to
74 other servers on the network.</para>
77 &rootprompt;<userinput>cd /export/dfsroot</userinput>
78 &rootprompt;<userinput>chown root /export/dfsroot</userinput>
79 &rootprompt;<userinput>chmod 755 /export/dfsroot</userinput>
80 &rootprompt;<userinput>ln -s msdfs:storageA\\shareA linka</userinput>
81 &rootprompt;<userinput>ln -s msdfs:serverB\\share,serverC\\share linkb</userinput>
84 <para>You should set up the permissions and ownership of
85 the directory acting as the DFS root such that only designated
86 users can create, delete or modify the msdfs links. Also note
87 that symlink names should be all lowercase. This limitation exists
88 to have Samba avoid trying all the case combinations to get at
89 the link name. Finally set up the symbolic links to point to the
90 network shares you want, and start Samba.</para>
92 <para>Users on DFS-aware clients can now browse the DFS tree
93 on the Samba server at \\samba\dfs. Accessing
94 links linka or linkb (which appear as directories to the client)
95 takes users directly to the appropriate shares on the network.</para>
99 <title>Common Errors</title>
101 <listitem><para>Windows clients need to be rebooted
102 if a previously mounted non-dfs share is made a dfs
103 root or vice versa. A better way is to introduce a
104 new share and make it the dfs root.</para>
107 <listitem><para>Currently there's a restriction that msdfs
108 symlink names should all be lowercase.</para>
111 <listitem><para>For security purposes, the directory
112 acting as the root of the DFS tree should have ownership
113 and permissions set so that only designated users can
114 modify the symbolic links in the directory.</para>