Last PHPTR edits.
[Samba/gebeck_regimport.git] / docs / Samba3-HOWTO / TOSHARG-VFS.xml
blob41b9562c40f6518cc461a53830940fe8f2801dcf
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE chapter PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
3 <chapter id="VFS">
4 <chapterinfo>
5         &author.jelmer;
6         &author.jht;
7         &author.tpot;
8         <author><firstname>Simo</firstname><surname>Sorce</surname><contrib>original vfs_skel README</contrib></author>
9         <author><firstname>Alexander</firstname><surname>Bokovoy</surname><contrib>original vfs_netatalk docs</contrib></author>
10         <author><firstname>Stefan</firstname><surname>Metzmacher</surname><contrib>Update for multiple modules</contrib></author>
11         <author><firstname>Ed</firstname><surname>Riddle</surname><contrib>original shadow_copy docs</contrib></author>
12 </chapterinfo>
13 <title>Stackable VFS modules</title>
15 <sect1>
16 <title>Features and Benefits</title>
18 <para>
19 <indexterm><primary>Virtual File System</primary><see>VFS</see></indexterm>
20 <indexterm><primary>modules</primary></indexterm>
21 <indexterm><primary>loaded modules</primary></indexterm>
22 Stackable VFS (Virtual File System) modules support was new to Samba-3 and has proven quite popular. Samba
23 passes each request to access the UNIX file system through the loaded VFS modules. This chapter covers the
24 modules that come with the Samba source and provides references to some external modules.
25 </para>
28 </sect1>
30 <sect1>
31 <title>Discussion</title>
33 <para>
34 <indexterm><primary>IRIX</primary></indexterm>
35 <indexterm><primary>GNU/Linux</primary></indexterm>
36 If not supplied with your platform distribution binary Samba package, you may have problems compiling these
37 modules, as shared libraries are compiled and linked in different ways on different systems. They currently
38 have been tested against GNU/Linux and IRIX.
39 </para>
41 <para>
42 <indexterm><primary>VFS modules</primary></indexterm>
43 <indexterm><primary>modules</primary></indexterm>
44 <indexterm><primary>recycle bin</primary></indexterm>
45 To use the VFS modules, create a share similar to the one below. The important parameter is the <smbconfoption
46 name="vfs objects"/> parameter where you can list one or more VFS modules by name. For example, to log all
47 access to files and put deleted files in a recycle bin, see <link linkend="vfsrecyc">the smb.conf with VFS
48 modules example</link>:
49 </para>
51 <example id="vfsrecyc">
52         <title>smb.conf with VFS modules</title>
53         <smbconfblock>
54         <smbconfsection name="[audit]"/>
55 <smbconfoption name="comment">Audited /data directory</smbconfoption>
56 <smbconfoption name="path">/data</smbconfoption>
57 <smbconfoption name="vfs objects">audit recycle</smbconfoption>
58 <smbconfoption name="writeable">yes</smbconfoption>
59 <smbconfoption name="browseable">yes</smbconfoption>
60         </smbconfblock>
61 </example>
63 <para>
64 <indexterm><primary>virus scanner</primary></indexterm>
65 <indexterm><primary>scanner module</primary></indexterm>
66 <indexterm><primary>recycle bin</primary></indexterm>
67 The modules are used in the order in which they are specified.  Let's say that you want to both have a virus
68 scanner module and a recycle bin module. It is wise to put the virus scanner module as the first one so that
69 it is the first to get run and may detect a virus immediately, before any action is performed on that file.
70 <smbconfoption name="vfs objects">vscan-clamav recycle</smbconfoption>
71 </para>
73 <para>
74 <indexterm><primary>/usr/local/samba/lib/vfs</primary></indexterm>
75 <indexterm><primary>/usr/lib/samba/vfs</primary></indexterm>
76 Samba will attempt to load modules from the <filename>/lib</filename> directory in the root directory of the
77 Samba installation (usually <filename>/usr/lib/samba/vfs</filename> or
78 <filename>/usr/local/samba/lib/vfs</filename>).
79 </para>
81 <para>
82 <indexterm><primary>modules</primary></indexterm>
83 <indexterm><primary>VFS</primary></indexterm>
84 <indexterm><primary>multiple modules</primary></indexterm>
85 <indexterm><primary>multiple VFS</primary></indexterm>
86 Some modules can be used twice for the same share.  This can be done using a configuration similar to the one
87 shown in <link linkend="multimodule">the smb.conf with multiple VFS modules</link>.
89 <example id="multimodule">
90         <title>smb.conf with multiple VFS modules</title>
91         <smbconfblock>
92 <smbconfsection name="[test]"/>
93 <smbconfoption name="comment">VFS TEST</smbconfoption>
94 <smbconfoption name="path">/data</smbconfoption>
95 <smbconfoption name="writeable">yes</smbconfoption>
96 <smbconfoption name="browseable">yes</smbconfoption>
97 <smbconfoption name="vfs objects">example:example1 example example:test</smbconfoption>
98 <smbconfoption name="example1: parameter">1</smbconfoption>
99 <smbconfoption name="example:  parameter">5</smbconfoption>
100 <smbconfoption name="test:     parameter">7</smbconfoption>
101 </smbconfblock>
102 </example>
103 </para>
105 </sect1>
107 <sect1>
108 <title>Included Modules</title>
110         <sect2>
111         <title>audit</title>
113                 <para>
114 <indexterm><primary>audit file access</primary></indexterm>
115                 A simple module to audit file access to the syslog facility. The following operations are logged:
116                 <itemizedlist>
117                         <listitem><para>share</para></listitem>
118                         <listitem><para>connect/disconnect</para></listitem>
119                         <listitem><para>directory opens/create/remove</para></listitem>
120                         <listitem><para>file open/close/rename/unlink/chmod</para></listitem>
121                 </itemizedlist>
122                 </para>
124         </sect2>
126         <sect2>
127         <title>extd_audit</title>
129                 <para>
130 <indexterm><primary>audit module</primary></indexterm>
131 <indexterm><primary>extd_audit module</primary></indexterm>
132 <indexterm><primary>smbd</primary></indexterm>
133                 This module is identical with the <command>audit</command> module above except
134                 that it sends audit logs to both syslog as well as the <command>smbd</command> log files. The 
135                 <smbconfoption name="log level"/> for this module is set in the &smb.conf; file. 
136                 </para>
138                 <para>
139                 Valid settings and the information that will be recorded are shown in <link linkend="xtdaudit">the next table</link>.
140                 </para>
142                 <table frame="all" id="xtdaudit">
143                         <title>Extended Auditing Log Information</title>
144                 <tgroup cols="2" align="center">
145                         <thead>
146                         <row><entry align="center">Log Level</entry><entry>Log Details - File and Directory Operations</entry></row>
147                         </thead>
148                         <tbody>
149                         <row><entry align="center">0</entry><entry align="left">Make Directory, Remove Directory, Unlink</entry></row>
150                         <row><entry align="center">1</entry><entry align="left">Open Directory, Rename File, Change Permissions/ACLs</entry></row>
151                         <row><entry align="center">2</entry><entry align="left">Open &amp; Close File</entry></row>
152                         <row><entry align="center">10</entry><entry align="left">Maximum Debug Level</entry></row>
153                         </tbody>
154                 </tgroup>
155                 </table>
157                 <sect3>
158                 <title>Configuration of Auditing</title>
160                 <para>
161 <indexterm><primary>logging</primary></indexterm>
162                 This auditing tool is more felxible than most people readily will recognize. There are a number of ways
163                 by which useful logging information can be recorded.
164                 </para>
166                 <itemizedlist>
167                         <listitem><para>Syslog can be used to record all transaction. This can be disabled by setting
168                                         in the &smb.conf; file <parameter>syslog = 0</parameter>.</para></listitem>
169                         <listitem><para>Logging can take place to the default log file (<filename>log.smbd</filename>)
170                                         for all loaded VFS modules just by setting in the &smb.conf; file
171                                         <parameter>log level = 0 vfs:x</parameter>, where x is the log level.
172                                         This will disable general logging while activating all logging of VFS
173                                         module activity at the log level specified.</para></listitem>
174                         <listitem><para>Detailed logging can be obtained per user, per client machine, etc.
175                                         This requires the above together with the creative use of the
176                                         <parameter>log file</parameter> settings.</para>
177                                         <para>An example of detailed per-user and per-machine logging can
178                                         be obtained by setting 
179                                         <smbconfoption name="log file">/var/log/samba/%U.%m.log</smbconfoption>.
180                                         </para></listitem>
181                 </itemizedlist>
183                 <para>
184                 Auditing information often must be preserved for a long time. So that the log files do not get rotated
185                 it is essential that the <smbconfoption name="max log size">0</smbconfoption> be set
186                 in the &smb.conf; file.
187                 </para>
189                 </sect3>
191         </sect2>
193         <sect2 id="fakeperms">
194         <title>fake_perms</title>
196                 <para>
197 <indexterm><primary>fake_perms</primary></indexterm>
198 <indexterm><primary>Roaming Profile</primary></indexterm>
199 <indexterm><primary>writeable</primary></indexterm>
200 <indexterm><primary>read only</primary></indexterm>
201                 This module was created to allow Roaming Profile files and directories to be set (on the Samba server
202                 under UNIX) as read only. This module will, if installed on the Profiles share, report to the client
203                 that the Profile files and directories are writeable. This satisfies the client even though the files
204                 will never be overwritten as the client logs out or shuts down.
205                 </para>
207         </sect2>
209         <sect2>
210         <title>recycle</title>
212                 <para>
213 <indexterm><primary>recycle</primary></indexterm>
214 <indexterm><primary>unlink calls</primary></indexterm>
215 <indexterm><primary>recycle directory</primary></indexterm>
216                 A Recycle Bin-like module. Where used, unlink calls will be intercepted and files moved
217                 to the recycle directory instead of being deleted. This gives the same effect as the
218                 <guiicon>Recycle Bin</guiicon> on Windows computers.
219                 </para>
221                 <para>
222 <indexterm><primary>recycle</primary></indexterm>
223 <indexterm><primary>.recycle</primary></indexterm>
224 <indexterm><primary>recycle:keeptree</primary></indexterm>
225 <indexterm><primary>deleted files</primary></indexterm>
226                 The <guiicon>Recycle Bin</guiicon> will not appear in <application>Windows Explorer</application> views of the
227                 network file system (share) nor on any mapped drive. Instead, a directory called <filename>.recycle</filename>
228                 will be automatically created when the first file is deleted. Users can recover files from the
229                 <filename>.recycle</filename> directory. If the <parameter>recycle:keeptree</parameter> has been specified,
230                 deleted files will be found in a path identical with that from which the file was deleted.
231                 </para>
232                 
233                 <para>Supported options for the <command>recycle</command> module are as follow:
234                 <variablelist>
235                         <varlistentry>
236                         <term>recycle:repository</term>
237                                 <listitem><para>
238 <indexterm><primary>recycle:repository</primary></indexterm>
239                                 Relative path of the directory where deleted files should be moved.
240                                 </para></listitem>
241                         </varlistentry>
243                         <varlistentry>
244                         <term>recycle:keeptree</term>
245                                 <listitem><para>
246 <indexterm><primary>recycle:keeptree</primary></indexterm>
247                                 Specifies whether the directory structure should be kept or if the files in the directory that is being 
248                                 deleted should be kept separately in the recycle bin.
249                                 </para></listitem>
250                         </varlistentry>
251                         
252                         <varlistentry>
253                         <term>recycle:versions</term>
254                                 <listitem><para>
255 <indexterm><primary>recycle:versions</primary></indexterm>
256                                 If this option is set, two files 
257                                 with the same name that are deleted will both 
258                                 be kept in the recycle bin. Newer deleted versions 
259                                 of a file will be called <quote>Copy #x of <replaceable>filename</replaceable></quote>.
260                                 </para></listitem>
261                         </varlistentry>
263                         <varlistentry>
264                         <term>recycle:touch</term>
265                                 <listitem><para>
266 <indexterm><primary>recycle:touch</primary></indexterm>
267                                 Specifies whether a file's access date should be touched when the file is moved to the recycle bin.
268                                 </para></listitem>
269                         </varlistentry>
271                         <varlistentry>
272                         <term>recycle:maxsize</term>
273                                 <listitem><para>
274 <indexterm><primary>recycle:maxsize</primary></indexterm>
275                                 Files that are larger than the number of bytes specified by this parameter will not be put into the recycle bin.
276                                 </para></listitem>
277                         </varlistentry>
279                         <varlistentry>
280                         <term>recycle:exclude</term>
281                                 <listitem><para>
282 <indexterm><primary>recycle:exclude</primary></indexterm>
283                                 List of files that should not be put into the recycle bin when deleted, but deleted in the regular way.
284                                 </para></listitem>
285                         </varlistentry>
287                         <varlistentry>
288                         <term>recycle:exclude_dir</term>
289                                 <listitem><para>
290 <indexterm><primary>recycle:exclude_dir</primary></indexterm>
291                                 Contains a list of directories. When files from these directories are
292                                 deleted, they are not put into the
293                                 recycle bin but are deleted in the
294                                 regular way.
295                                 </para></listitem>
296                         </varlistentry>
298                         <varlistentry>
299                         <term>recycle:noversions</term>
300                                 <listitem><para>
301 <indexterm><primary>recycle:noversions</primary></indexterm>
302                                 Specifies a list of paths (wildcards such as * and ? are supported) for which no versioning
303                                 should be used. Only useful when <emphasis>recycle:versions</emphasis> is enabled.
304                                 </para></listitem>
305                         </varlistentry>
306                 </variablelist>
307                 </para>
309         </sect2>
311         <sect2>
312         <title>netatalk</title>
314                 <para>
315 <indexterm><primary>netatalk</primary></indexterm>
316                 A netatalk module will ease co-existence of Samba and netatalk file sharing services.
317                 </para>
319                 <para>Advantages compared to the old netatalk module:
320                 <itemizedlist>
321 <indexterm><primary>.AppleDouble</primary></indexterm>
322                         <listitem><para>Does not care about creating .AppleDouble forks, just keeps them in sync.</para></listitem>
323                         <listitem><para>If a share in &smb.conf; does not contain .AppleDouble item in hide or veto list, it will be added automatically.</para></listitem>
324                 </itemizedlist>
325                 </para>
327         </sect2>
329     <sect2>
330       <title>shadow_copy</title>
332         <warning><para>
333 <indexterm><primary>shadow_copy</primary></indexterm>
334         <emphasis>THIS IS NOT A BACKUP, ARCHIVAL, OR VERSION CONTROL SOLUTION!</emphasis>
335         </para>
337         <para>
338 <indexterm><primary>version control</primary></indexterm>
339         With Samba or Windows servers, shadow_copy is designed to be an end-user tool only.  It does not replace or
340         enhance your backup and archival solutions and should in no way be considered as such.  Additionally, if you
341         need version control, implement a version control system.  You have been warned.
342         </para></warning>
345         <para>
346         The shadow_copy module allows you to setup functionality that is similar to MS shadow copy services.  When
347         setup properly, this module allows Microsoft shadow copy clients to browse "shadow copies" on Samba shares.
348         You will need to install the shadow copy client.  You can get the MS shadow copy client <ulink noescape="1"
349         url="http://www.microsoft.com/windowsserver2003/downloads/shadowcopyclient.mspx">here.</ulink>.  Note the
350         additional requirements for pre-Windows XP clients.  I did not test this functionality with any pre-Windows XP
351         clients.  You should be able to get more information about MS Shadow Copy <ulink noescape="1"
352         url="http://www.microsoft.com/windowsserver2003/techinfo/overview/scr.mspx">from the Microsoft's site</ulink>.
353         </para>
355         <para>
356 <indexterm><primary>shadow_copy</primary></indexterm>
357 <indexterm><primary>VFS module</primary></indexterm>
358 <indexterm><primary>shadow_copy module</primary></indexterm>
359 <indexterm><primary>LVM</primary></indexterm>
360 <indexterm><primary>EVMS</primary></indexterm>
361 <indexterm><primary>Logical Volume Manager</primary><see>LVM</see></indexterm>
362         The shadow_copy VFS module requires some underlying file system setup with some sort of Logical Volume Manager
363         (LVM) such as LVM1, LVM2, or EVMS.  Setting up LVM is beyond the scope of this document; however, we will
364         outline the steps we took to test this functionality for <emphasis>example purposes only.</emphasis> You need
365         to make sure the LVM implementation you choose to deploy is ready for production.  Make sure you do plenty of
366         tests.
367         </para>
369         <para>
370         Here are some common resources for LVM and EVMS:
371         </para>
373         <itemizedlist>
374           <listitem>
375             <para><ulink noescape="1"
376             url="http://www.sistina.com/products_lvm_download.htm">Sistina's
377             LVM1 and LVM2</ulink></para>
378           </listitem>
379           <listitem>
380             <para><ulink url="http://evms.sourceforge.net/">Enterprise Volume Management System (EVMS)</ulink></para>
381           </listitem>
382           <listitem>
383             <para><ulink url="http://tldp.org/HOWTO/LVM-HOWTO/">The LVM HOWTO</ulink></para>
384           </listitem>
385           <listitem>
386             <para>
387               See <ulink url="http://www-106.ibm.com/developerworks/linux/library/l-lvm/">Learning
388               Linux LVM, Part 1</ulink> and <ulink url="http://www-106.ibm.com/developerworks/library/l-lvm2.html">Learning
389               Linux LWM, Part 2</ulink> for Daniel Robbins' well-written, two part tutorial on Linux and LVM using LVM
390               source code and reiserfs.</para>
391           </listitem>
392         </itemizedlist>
394         <sect3>
395         <title>Shadow Copy Setup</title>
396         <para>
397 <indexterm><primary>XFS file system</primary></indexterm>
398 <indexterm><primary>Debian Sarge</primary></indexterm>
399         At the time of this writing, not much testing has been done.  I tested the shadow copy VFS module with a
400         specific scenario which was not deployed in a production environment, but more as a proof of concept.  The
401         scenario involved a Samba-3 file server on Debian Sarge with an XFS file system and LVM1.  I do NOT recommend
402         you use this as a solution without doing your own due diligence with regard to all the components presented
403         here.  That said, following is an basic outline of how I got things going.
404         </para>
406         <orderedlist>
407           <listitem>
408             <formalpara><title>Installed Operating System </title> 
409             <para>
410                 In my tests, I used <ulink url="http://www.debian.org/devel/debian-installer/">Debian
411                 Sarge</ulink> (i.e., testing) on an XFS file system.  Setting up the OS is a bit beyond the scope of this
412                 document.  It is assumed that you have a working OS capable of running Samba.
413                 </para></formalpara>
414           </listitem>
416           <listitem>
417             <formalpara><title>Install &amp; Configure Samba</title>
418                 <para>
419                 See the <link linkend="introduction">installation section</link> of this HOWTO for more detail on this.
420                 It doesn't matter if it is a Domain Controller or Member File Server, but it is assumed that you have a
421                 working Samba 3.0.3 or later server running.
422                 </para></formalpara>
423           </listitem>
425           <listitem>
426             <formalpara><title>Install &amp; Configure LVM</title>
427                 <para>
428 <indexterm><primary>shadow copies</primary></indexterm>
429 <indexterm><primary>Snapshots</primary></indexterm>
430                 Before you can make shadow copies available to the client, you have to create the shadow copies.  This is
431                 done by taking some sort of file system snapshot.  Snapshots are a typical feature of Logical Volume
432                 Managers such as LVM, so we first need to have that setup.
433                 </para></formalpara>
435             <itemizedlist>
436                 <para>
437                 The following is provided as an example and will be most helpful for Debian users.  Again, this was tested
438                 using the "testing" or "Sarge" distribution.
439                 </para>
441                         <listitem>
442                         <para>
443 <indexterm><primary>lvm10 package</primary></indexterm>
444 <indexterm><primary>devfsd package</primary></indexterm>
445 <indexterm><primary>Debian</primary></indexterm>
446 <indexterm><primary>xfsprogs</primary></indexterm>
447 <indexterm><primary>apt-get</primary></indexterm>
448                         Install lvm10 and devfsd packages if you have not done so already.  On Debian systems, you are warned of the
449                         interaction of devfs and lvm1 which requires the use of devfs filenames.  Running <command>apt-get update
450                         &amp;&amp; apt-get install lvm10 devfsd xfsprogs</command> should do the trick for this example.
451                         </para></listitem>
453                         <listitem><para>
454 <indexterm><primary>create volume</primary></indexterm>
455 <indexterm><primary>create partition</primary></indexterm>
456 <indexterm><primary>fdisk</primary></indexterm>
457 <indexterm><primary>cfdisk</primary></indexterm>
458 <indexterm><primary>Linux LVM</primary></indexterm>
459                         Now you need to create a volume.  You will need to create a partition (or partitions) to add to your volume.
460                         Use your favorite partitioning tool (e.g., Linux fdisk, cfdisk, etc.).  The partition type should be set to
461                         0x8e for "Linux LVM."  In this example, we will use /dev/hdb1.
462                         </para>
464                         <para>
465 <indexterm><primary>Linux LVM partition</primary></indexterm>
466 <indexterm><primary>LVM volume</primary></indexterm>
467 <indexterm><primary>modprobe</primary></indexterm>
468                         Once you have the Linux LVM partition (type 0x8e), you can run a series of commands to create the LVM volume.
469                         You can use several disks and/or partitions, but we will use only one in this example.  You may also need to
470                         load the kernel module with something like <command>modprobe lvm-mod</command> and set your system up to load
471                         it on reboot by adding it to (<filename>/etc/modules</filename>).
472                         </para></listitem>
474                         <listitem><para>
475 <indexterm><primary>pvcreate</primary></indexterm>
476                         Create the physical volume with <command>pvcreate /dev/hdb1</command>
477                         </para></listitem>
479                         <listitem><para>
480 <indexterm><primary>vgcreate</primary></indexterm>
481 <indexterm><primary>volume group</primary></indexterm>
482                         Create the volume group and add /dev/hda1 to it with <command>vgcreate shadowvol /dev/hdb1</command>
483                         </para>
485                         <para>
486 <indexterm><primary>vgdisplay</primary></indexterm>
487                         You can use <command>vgdisplay</command> to review information about the volume group.
488                         </para></listitem>
490                         <listitem><para>
491 <indexterm><primary>lvcreate</primary></indexterm>
492                         Now you can create the logical volume with something like <command>lvcreate -L400M -nsh_test shadowvol</command>
493                         </para>
495                         <para>
496 <indexterm><primary>/dev/shadowvol</primary></indexterm>
497                         This creates the logical volume of 400 MBs named "sh_test" in the volume group we created called shadowvol.
498                         If everything is working so far, you should see them in <filename>/dev/shadowvol</filename>.
499                         </para></listitem>
501                         <listitem><para>
502 <indexterm><primary>mkfs.xfs</primary></indexterm>
503                         Now we should be ready to format the logical volume we named sh_test with <command>mkfs.xfs
504                         /dev/shadowvol/sh_test</command>
505                         </para>
507                         <para>
508 <indexterm><primary>logical volume</primary></indexterm>
509 <indexterm><primary>LVM</primary></indexterm>
510 <indexterm><primary>freezing</primary></indexterm>
511 <indexterm><primary>resizing</primary></indexterm>
512 <indexterm><primary>growing</primary></indexterm>
513                         You can format the logical volume with any file system you choose, but make sure to use one that allows you to
514                         take advantage of the additional features of LVM such as freezing, resizing, and growing your file systems.
515                         </para>
517                         <para>
518 <indexterm><primary>LVM volume</primary></indexterm>
519 <indexterm><primary>shadow_copy</primary></indexterm>
520 <indexterm><primary>module</primary></indexterm>
521                         Now we have an LVM volume where we can play with the shadow_copy VFS module.
522                         </para></listitem>
524                         <listitem><para>
525 <indexterm><primary>mkdir</primary></indexterm>
526 <indexterm><primary>permissions</primary></indexterm>
527 <indexterm><primary>chmod</primary></indexterm>
528                         Now we need to prepare the directory with something like
529 <screen>
530 &rootprompt; mkdir -p /data/shadow_share
531 </screen>
532                         or whatever you want to name your shadow copy-enabled Samba share.  Make sure you set the permissions so that
533                         you can use it.  If in doubt, use <command>chmod 777 /data/shadow_share</command> and tighten the permissions
534                         once you get things working.
535                         </para></listitem>
537                         <listitem><para>
538 <indexterm><primary>mount</primary></indexterm>
539                         Mount the LVM volume using something like <command>mount /dev/shadowvol/sh_test /data/shadow_share</command>
540                         </para>
542                         <para>
543 <indexterm><primary>/etc/fstab</primary></indexterm>
544                         You may also want to edit your <filename>/etc/fstab</filename> so that this partition mounts during the system boot.
545                         </para></listitem>
546                 </itemizedlist>
548                 </listitem>
550           <listitem>
551             <formalpara><title>Install &amp; Configure the shadow_copy VFS Module</title>
552                 <para>
553                 Finally we get to the actual shadow_copy VFS module.  The shadow_copy VFS module should be available in Samba
554                 3.0.3 and higher.  The smb.conf configuration is pretty standard.  Here is our example of a share configured
555                 with the shadow_copy VFS module:
556                 </para></formalpara>
558                 <example id="vfsshadow">
559                 <title>Share With shadow_copy VFS</title>
560                 <smbconfblock>
561                 <smbconfsection name="[shadow_share]"/>
562                 <smbconfoption name="comment">Shadow Copy Enabled Share</smbconfoption>
563                 <smbconfoption name="path">/data/shadow_share</smbconfoption>
564                 <smbconfoption name="vfs objects">shadow_copy</smbconfoption>
565                 <smbconfoption name="writeable">yes</smbconfoption>
566                 <smbconfoption name="browseable">yes</smbconfoption>
567                 </smbconfblock>
568                 </example>
570                 </listitem>
572                 <listitem>
573             <formalpara><title>Create Snapshots and Make Them Available to shadow_copy.so</title> 
574                 <para>
575 <indexterm><primary>shadow_copy</primary></indexterm>
576 <indexterm><primary>LVM snapshots</primary></indexterm>
577 <indexterm><primary>module</primary></indexterm>
578                 Before you can browse the shadow copies, you must create them and mount them.  This will most likely be done
579                 with a script that runs as a cron job.  With this particular solution, the shadow_copy VFS module is used to
580                 browse LVM snapshots.  Those snapshots are not created by the module.  They are not made available by the
581                 module either.  This module allows the shadow copy-enabled client to browse the snapshots you take and make
582                 available.
583                 </para></formalpara>
585             <para>
586                 Here is a simple script used to create and mount the snapshots:
587 <screen>
588 #!/bin/bash
589 # This is a test, this is only a test
590 SNAPNAME=`date +%Y.%m.%d-%H.%M.%S`
591 xfs_freeze -f /data/shadow_share/
592 lvcreate -L10M -s -n $SNAPNAME /dev/shadowvol/sh_test
593 xfs_freeze -u /data/shadow_share/
594 mkdir /data/shadow_share/@GMT-$SNAPNAME
595 mount /dev/shadowvol/$SNAPNAME \
596        /data/shadow_share/@GMT-$SNAPNAME -onouuid,ro
597 </screen>
598                 Note that the script does not handle other things like remounting snapshots on reboot.
599             </para></listitem>
601                 <listitem>
602             <formalpara><title>Test From Client</title>
603                 <para>
604                 To test, you will need to install the shadow copy client which you can obtain from the <ulink
605                 url="http://www.microsoft.com/windowsserver2003/downloads/shadowcopyclient.mspx">Microsoft web site.</ulink> I
606                 only tested this with an XP client so your results may vary with other pre-XP clients.  Once installed, with
607                 your XP client you can right-click on specific files or in the empty space of the shadow_share and view the
608                 "properties."  If anything has changed, then you will see it on the "Previous Versions" tab of the properties
609                 window.
610                 </para></formalpara>
611           </listitem>
612         </orderedlist>
614         </sect3>
615 </sect2>
617 </sect1>
619 <sect1>
620 <title>VFS Modules Available Elsewhere</title>
622 <para>
623 <indexterm><primary>VFS modules</primary></indexterm>
624 This section contains a listing of various other VFS modules that have been posted but do not currently reside
625 in the Samba CVS tree for one reason or another (e.g., it is easy for the maintainer to have his or her own
626 CVS tree).
627 </para>
629 <para>
630 No statements about the stability or functionality of any module should be implied due to its presence here.
631 </para>
633 <sect2>
634 <title>DatabaseFS</title>
636 <para>
637 <indexterm><primary>DatabaseFS</primary></indexterm>
638 URL: <ulink noescape="1" url="http://www.css.tayloru.edu/~elorimer/databasefs/index.php">
639 Taylors University DatabaeFS</ulink>
640 </para>
642 <para>By <ulink url="mailto:elorimer@css.tayloru.edu">Eric Lorimer.</ulink></para>
644 <para>
645 I have created a VFS module that implements a fairly complete read-only filesystem. It presents information
646 from a database as a filesystem in a modular and generic way to allow different databases to be used.
647 (Originally designed for organizing MP3s under directories such as <quote>Artists,</quote> <quote>Song
648 Keywords,</quote> and so on. I have since easily applied it to a student roster database.) The directory
649 structure is stored in the database itself and the module makes no assumptions about the database structure
650 beyond the table it requires to run.
651 </para>
653 <para>
654 Any feedback would be appreciated: comments, suggestions, patches, and so on. If nothing else, it
655 might prove useful for someone else who wishes to create a virtual filesystem.
656 </para>
658 </sect2>
660 <sect2>
661 <title>vscan</title>
663 <indexterm><primary>vscan</primary></indexterm>
664 <para>URL: <ulink noescape="1" url="http://www.openantivirus.org/projects.php#samba-vscan">
665 Open Anti-Virus vscan</ulink>
666 </para>
668 <para>
669 <indexterm><primary>samba-vscan</primary></indexterm>
670 samba-vscan is a proof-of-concept module for Samba, which provides on-access anti-virus support for files
671 shared using Samba.  samba-vscan supports various virus scanners and is maintained by Rainer Link.
672 </para>
674 </sect2>
675 </sect1>
677 </chapter>