]> git.sur5r.net Git - bacula/docs/blobdiff - docs/manual/storedconf.tex
work in progress
[bacula/docs] / docs / manual / storedconf.tex
index cc9007fe9f24145567937e149ca38d54691149f0..34133bf9dbd5be848fb85f69e5a39bc5f43a9f3a 100644 (file)
@@ -1,15 +1,10 @@
 %%
 %%
 
-\section*{Storage Daemon Configuration}
-\label{_ChapterStart31}
+\chapter{Storage Daemon Configuration}
+\label{StoredConfChapter}
 \index[general]{Storage Daemon Configuration}
 \index[general]{Configuration!Storage Daemon}
-\addcontentsline{toc}{section}{Storage Daemon Configuration}
-
-\subsection*{General}
-\index[general]{General}
-\addcontentsline{toc}{subsection}{General}
 
 The Storage Daemon configuration file has relatively few resource definitions.
 However, due to the great variation in backup media and system capabilities,
@@ -26,7 +21,7 @@ here.
 
 For a general discussion of configuration file and resources including the
 data types recognized by {\bf Bacula}, please see the 
-\ilink{Configuration}{_ChapterStart16} chapter of this manual. The
+\ilink{Configuration}{ConfigureChapter} chapter of this manual. The
 following Storage Resource definitions must be defined: 
 
 \begin{itemize}
@@ -40,15 +35,14 @@ following Storage Resource definitions must be defined:
    \ilink{Device}{DeviceResource} -- to define  the
    characteristics of your storage device (tape  drive).  
 \item 
-   \ilink{Messages}{_ChapterStart15} -- to define where error  and
+   \ilink{Messages}{MessagesChapter} -- to define where error  and
    information messages are to be sent. 
 \end{itemize}
 
-\subsection*{Storage Resource}
+\section{Storage Resource}
 \label{StorageResource}
 \index[general]{Resource!Storage}
 \index[general]{Storage Resource}
-\addcontentsline{toc}{subsection}{Storage Resource}
 
 In general, the properties specified under the Storage resource define global
 properties of the Storage daemon. Each Storage daemon configuration file must
@@ -89,14 +83,25 @@ have one and only one Storage resource definition.
    \index[sd]{Directive!Heartbeat Interval}
    \index[general]{Heartbeat Interval}
    \index[general]{Broken pipe}
-   This directive defines an interval of time.  When the Storage daemon is
-   waiting for the operator to mount a tape, each time interval, it will
-   send a heartbeat signal to the File daemon.  The default interval is
-   zero which disables the heartbeat.  This feature is particularly useful
-   if you have a router such as 3Com that does not follow Internet
-   standards and times out an valid connection after a short duration 
-   despite the fact that keepalive is set. This usually results
-   in a broken pipe error message.
+   This directive defines an interval of time in seconds.  When
+   the Storage daemon is waiting for the operator to mount a
+   tape, each time interval, it will send a heartbeat signal to
+   the File daemon.  The default interval is zero which disables
+   the heartbeat.  This feature is particularly useful if you
+   have a router such as 3Com that does not follow Internet
+   standards and times out an valid connection after a short
+   duration despite the fact that keepalive is set.  This usually
+   results in a broken pipe error message.
+
+\item [Client Connect Wait = \lt{}time-interval\gt{}]
+   \index[sd]{Connect Wait}
+   \index[sd]{Directive!Connect Wait}
+   \index[general]{Client Connect Wait}
+   This directive defines an interval of time in seconds that
+   the Storage daemon will wait for a Client (the File daemon)
+   to connect.  The default is 30 seconds.  Be aware that the
+   longer the Storage daemon waits for a Client, the more
+   resources will be tied up.
 
 \item [Maximum Concurrent Jobs = \lt{}number\gt{}]
    \index[sd]{Maximum Concurrent Jobs}
@@ -194,11 +199,10 @@ Storage {
 \end{verbatim}
 \normalsize
 
-\subsection*{Director Resource}
+\section{Director Resource}
 \label{DirectorResource1}
 \index[general]{Director Resource}
 \index[general]{Resource!Director}
-\addcontentsline{toc}{subsection}{Director Resource}
 
 The Director resource specifies the Name of the Director which is permitted
 to use the services of the Storage daemon.  There may be multiple Director
@@ -245,10 +249,9 @@ Director {
 \normalsize
 
 \label{DeviceResource}
-\subsection*{Device Resource}
+\section{Device Resource}
 \index[general]{Resource!Device}
 \index[general]{Device Resource}
-\addcontentsline{toc}{subsection}{Device Resource}
 
 The Device Resource specifies the details of each device (normally a tape
 drive) that can be used by the Storage daemon.  There may be multiple
@@ -293,7 +296,7 @@ specified within the Device resource are specific to the Device.
    If you want to write into more than one directory (i.e.  to spread the load to
    different disk drives), you will need to define  two Device resources, each
    containing an Archive Device with a  different directory.  
-   
+   \label{SetupFifo}
    In addition to a tape device name or a directory name, Bacula will  accept the
    name of a FIFO. A FIFO is a special kind of file that  connects two programs
    via kernel memory. If a FIFO device is specified  for a backup operation, you
@@ -306,9 +309,26 @@ specified within the Device resource are specific to the Device.
    the Storage daemon to open it only  when a job starts, so you must explicitly
    set it to {\bf No}.  Since a FIFO is a one way device, Bacula will not attempt
    to read  a label of a FIFO device, but will simply write on it. To create a 
-   FIFO Volume in the catalog, use the {\bf add} command rather than  then {\bf
-   label} command to avoid attempting to write a label.  
-   
+   FIFO Volume in the catalog, use the {\bf add} command rather than the {\bf
+   label} command to avoid attempting to write a label.
+
+\footnotesize
+\begin{verbatim}
+Device {
+  Name = FifoStorage
+  Media Type = Fifo
+  Device Type = Fifo
+  Archive Device = /tmp/fifo
+  LabelMedia = yes
+  Random Access = no
+  AutomaticMount = no
+  RemovableMedia = no
+  MaximumOpenWait = 60
+  AlwaysOpen = no
+}
+\end{verbatim}
+\normalsize
+
    During a restore operation, if the Archive Device is a FIFO, Bacula  will
    attempt to read from the FIFO, so you must have an external program  that
    writes into the FIFO. Bacula will wait {\bf MaximumOpenWait} seconds  for the
@@ -352,7 +372,7 @@ specified within the Device resource are specific to the Device.
   If the Device Type is not explicitly specified, then the mount point
   must exist when the Storage daemon starts.
 
-  This directive was implemented in Bacula version 1.39.5.
+  This directive was implemented in Bacula version 1.38.6.
 
 
 \item [Media Type = {\it name-string}]
@@ -392,8 +412,10 @@ specified within the Device resource are specific to the Device.
 \item [Autochanger = {\it Yes|No}]
    \index[sd]{Autochanger}
    \index[sd]{Directive!Autochanger}
-   If {\bf Yes}, this device belongs to an automatic tape changer, and  you should also
-   specify a {\bf Changer Device} as well as  a {\bf Changer Command}.  If {\bf
+   If {\bf Yes}, this device belongs to an automatic tape changer, and you
+   must specify an {\bf Autochanger} resource that points to the {\bf
+   Device} resources.  You must also specify a 
+   {\bf Changer Device}.  If the Autochanger directive is set to {\bf
    No} (default), the volume must be manually changed.  You should also
    have an identical directive to the  
    \ilink{Storage resource}{Autochanger1}  in the Director's
@@ -405,14 +427,14 @@ specified within the Device resource are specific to the Device.
    The specified {\bf name-string} must be the {\bf generic SCSI} device
    name of the autochanger that corresponds to the normal read/write
    {\bf Archive Device}  specified in the Device resource. This
-   gemeric SCSI device name should be specified if you have an autochanger 
+   generic SCSI device name should be specified if you have an autochanger 
    or if you have a standard tape drive and want to use the
    {\bf Alert Command} (see below). For example, on Linux systems, for 
    an Archive Device name of {\bf /dev/nst0}, you would specify {\bf
    /dev/sg0} for the Changer Device name. Depending on your exact
    configuration, and the number of autochangers or the type of
    autochanger, what you specify here can vary.  This directive is
-   optional.  See the \ilink{ Using Autochangers}{_ChapterStart18} chapter
+   optional.  See the \ilink{ Using Autochangers}{AutochangersChapter} chapter
    of this manual for more details of using this and the following
    autochanger directives.
 
@@ -420,7 +442,11 @@ specified within the Device resource are specific to the Device.
    \index[sd]{Changer Command}
    \index[sd]{Directive!Changer Command}
    The {\bf name-string} specifies an external program to be called  that will
-   automatically change volumes as required by {\bf Bacula}.  Most frequently,
+   automatically change volumes as required by {\bf Bacula}.  Normally,
+   this directive will be specified only in the {\bf AutoChanger} resource,
+   which is then used for all devices.  However, you may also specify
+   the different {\bf Changer Command} in each Device resource.
+   Most frequently,
    you will specify the Bacula supplied {\bf mtx-changer}  script as follows:  
 
 \footnotesize
@@ -433,20 +459,19 @@ Changer Command = "/path/mtx-changer %c %o %S %a %d"
    release). An example of this command is in the default bacula-sd.conf file. 
    For more details on the substitution characters that may be specified  to
    configure your autochanger please see  the 
-   \ilink{Autochangers}{_ChapterStart18} chapter of this  manual.
+   \ilink{Autochangers}{AutochangersChapter} chapter of this  manual.
    For FreeBSD users, you might want to see one of the  several {\bf chio}
    scripts in {\bf examples/autochangers}.  
 
 \item [Alert Command = {\it name-string}]
    \index[sd]{Alert Command}
    The {\bf name-string} specifies an external program to be called  at the
-   \index[sd]{Directive!Changer Command}
    completion of each Job after the device is released.  The purpose of this
    command is to check for Tape Alerts, which  are present when something is
    wrong with your tape drive  (at least for most modern tape drives).  The same
    substitution characters that may be specified  in the Changer Command may also
    be used in this string.  For more information, please see  the 
-   \ilink{Autochangers}{_ChapterStart18} chapter of this  manual. 
+   \ilink{Autochangers}{AutochangersChapter} chapter of this  manual. 
    
    
    Note, it is not necessary to have an autochanger to use this  command. The
@@ -479,18 +504,19 @@ bacula-sd  Alert: TapeAlert[32]: Interface: Problem with SCSI interface
 \item [Drive Index = {\it number}]
    \index[sd]{Drive Index}
    \index[sd]{Directive!Drive Index}
-   The {\bf Drive Index} that you specify is passed to the  {\bf mtx-changer}
-   script and is thus passed to the {\bf mtx}  program. By default, the Drive
-   Index is zero, so if you have only  one drive in your autochanger, everything
-   will work normally.  However, if you have multiple drives, you may specify two
-   Bacula  Device resources. The first will either set Drive Index to zero,  or
-   leave it unspecified, and the second Device Resource should  contain a Drive
-   Index set to 1. This will then permit you to  use two or more drives in your
-   autochanger. However, you must ensure  that Bacula does not request the same
-   Volume on both drives  at the same time. You may also need to modify the
-   mtx-changer  script to do locking so that two jobs don't attempt to use  the
-   autochanger at the same time. An example script can  be found in {\bf
-   examples/autochangers/locking-mtx-changer}.
+   The {\bf Drive Index} that you specify is passed to the {\bf
+   mtx-changer} script and is thus passed to the {\bf mtx} program.  By
+   default, the Drive Index is zero, so if you have only one drive in your
+   autochanger, everything will work normally.  However, if you have
+   multiple drives, you must specify multiple Bacula Device resources (one
+   for each drive).  The first Device should have the Drive Index set to 0,
+   and the second Device Resource should contain a Drive Index set to 1,
+   and so on.  This will then permit you to use two or more drives in your
+   autochanger.  As of Bacula version 1.38.0, using the {\bf Autochanger}
+   resource, Bacula will automatically ensure that only one drive at a time
+   uses the autochanger script, so you no longer need locking scripts as in
+   the past -- the default mtx-changer script works for any number of
+   drives.
 
 \item [Autoselect = {\it Yes|No}]
    \index[sd]{Autoselect}
@@ -511,6 +537,8 @@ bacula-sd  Alert: TapeAlert[32]: Interface: Problem with SCSI interface
    Bacula will invalidate the Volume slot number stored in the catalog and
    try again.  If no additional changer volumes exist, Bacula will ask the
    operator to intervene.  The default is 5 minutes.      
+% TODO: if this is the format, then maybe "5 minutes" should be in
+% TODO: quotes? define style. see others.
 
 \item [Maximum Rewind Wait = {\it time}]
    \index[sd]{Maximum Rewind Wait}
@@ -531,11 +559,12 @@ bacula-sd  Alert: TapeAlert[32]: Interface: Problem with SCSI interface
    \index[sd]{Directive!Always Open}
    If {\bf Yes} (default), Bacula will always keep the device open unless
    specifically {\bf unmounted} by the Console program.  This permits
-   Bacula to ensure that the tape drive is always available.  If you set
+   Bacula to ensure that the tape drive is always available, and properly
+   positioned. If you set
    {\bf AlwaysOpen} to {\bf no} {\bf Bacula} will only open the drive when
    necessary, and at the end of the Job if no other Jobs are using the
    drive, it will be freed.  The next time Bacula wants to append to a tape
-   on a drive that was freed, Bacula must rewind the tape and position to
+   on a drive that was freed, Bacula will rewind the tape and position it to
    the end.  To avoid unnecessary tape positioning and to minimize
    unnecessary operator intervention, it is highly recommended that {\bf
    Always Open = yes}.  This also ensures that the drive is available when
@@ -552,7 +581,9 @@ bacula-sd  Alert: TapeAlert[32]: Interface: Problem with SCSI interface
    Please note that if you set this directive to {\bf No} Bacula  will release
    the tape drive between each job, and thus the next job  will rewind the tape
    and position it to the end of the data. This  can be a very time consuming
-   operation. 
+   operation. In addition, with this directive set to no, certain multiple
+   drive autochanger operations will fail.  We strongly recommend to keep
+   {\bf Always Open} set to {\bf Yes}
 
 \item [Volume Poll Interval = {\it time}]
    \index[sd]{Volume Poll Interval}
@@ -596,24 +627,119 @@ bacula-sd  Alert: TapeAlert[32]: Interface: Problem with SCSI interface
    error.  Bacula will re-attempt to open the drive the next time a Job
    starts that needs the the drive.
 
+\label{removablemedia}
 \item [Removable media = {\it Yes|No}]
    \index[sd]{Removable media}
    \index[sd]{Directive!Removable media}
    If {\bf Yes}, this device supports removable media (for example, tapes
    or CDs).  If {\bf No}, media cannot be removed (for example, an
-   intermediate backup area on a hard disk).
+   intermediate backup area on a hard disk). If {\bf Removable media} is
+   enabled on a File device (as opposed to a tape) the Storage daemon will
+   assume that device may be something like a USB device that can be
+   removed or a simply a removable harddisk. When attempting to open
+   such a device, if the Volume is not found (for File devices, the Volume
+   name is the same as the Filename), then the Storage daemon will search
+   the entire device looking for likely Volume names, and for each one 
+   found, it will ask the Director if the Volume can be used.  If so,
+   the Storage daemon will use the first such Volume found.  Thus it
+   acts somewhat like a tape drive -- if the correct Volume is not found,
+   it looks at what actually is found, and if it is an appendable Volume,
+   it will use it.
+
+   If the removable medium is not automatically mounted (e.g. udev), then
+   you might consider using additional Storage daemon device directives
+   such as {\bf Requires Mount}, {\bf Mount Point}, {\bf Mount Command},
+   and {\bf Unmount Command}, all of which can be used in conjunction with
+   {\bf Removable Media}.    
+
 
 \item [Random access = {\it Yes|No}]
    \index[sd]{Random access}
    \index[sd]{Directive!Random access}
    If {\bf Yes}, the archive device is assumed to be a random access medium
    which supports the {\bf lseek} (or {\bf lseek64} if Largefile is enabled
-   during configuration) facility.
+   during configuration) facility. This should be set to {\bf Yes} for all
+   file systems such as DVD, USB, and fixed files.  It should be set to
+   {\bf No} for non-random access devices such as tapes and named pipes.
+
+
+\item [Requires Mount = {\it Yes|No}]
+   \index[sd]{Requires Mount  }
+   When this directive is enabled, the Storage daemon will submit
+   a {\bf Mount Command} before attempting to open the device.
+   You must set this directive to {\bf yes} for DVD-writers and removable
+   file systems such as USB devices that are not automatically mounted
+   by the operating system when plugged in or opened by Bacula.
+   It should be set to {\bf no} for
+   all other devices such as tapes and fixed filesystems. It should also
+   be set to {\bf no} for any removable device that is automatically
+   mounted by the operating system when opened (e.g. USB devices mounted
+   by udev or hotplug). This directive
+   indicates if the device requires to be mounted using the {\bf Mount
+   Command}.  To be able to write a DVD, the following directives must also
+   be defined: {\bf Mount Point}, {\bf Mount Command}, {\bf Unmount
+   Command} and {\bf Write Part Command}.
+
+\item [Mount Point = {\it directory}]
+   \index[sd]{Mount Point}
+   Directory where the device can be mounted. 
+   This directive is used only
+   for devices that have {\bf Requires Mount} enabled such as DVD or 
+   USB file devices.
+
+\item [Mount Command = {\it name-string}]
+   \index[sd]{Mount Command}
+   This directive specifies the command that must be executed to mount 
+   devices such as DVDs and many USB devices. For DVDs, the
+   device is written directly, but the mount command is necessary in
+   order to determine the free space left on the DVD. Before the command is 
+   executed, \%a is replaced with the Archive Device, and \%m with the Mount 
+   Point.
+
+   Most frequently, for a DVD, you will define it as follows:  
+
+\footnotesize
+\begin{verbatim}
+  Mount Command = "/bin/mount -t iso9660 -o ro %a %m"
+\end{verbatim}
+\normalsize
+
+However, if you have defined a mount point in /etc/fstab, you might be
+able to use a mount command such as:
+
+\footnotesize
+\begin{verbatim}
+  Mount Command = "/bin/mount /media/dvd"
+\end{verbatim}
+\normalsize
+
+See the \ilink {Edit Codes}{mountcodes} section below for more details of
+the editing codes that can be used in this directive.
+
+
+\item [Unmount Command = {\it name-string}]
+   \index[sd]{Unmount Command}
+   This directive specifies the command that must be executed to unmount 
+   devices such as DVDs and many USB devices. Before the command  is
+   executed, \%a is replaced with the Archive Device, and \%m with the  Mount
+   Point.
+
+   Most frequently, you will define it as follows:  
+
+\footnotesize
+\begin{verbatim}
+  Unmount Command = "/bin/umount %m"
+\end{verbatim}
+\normalsize
+
+See the \ilink {Edit Codes}{mountcodes} section below for more details of
+the editing codes that can be used in this directive.
+
 
 \item [Minimum block size = {\it size-in-bytes}]
    \index[sd]{Minimum block size}
    \index[sd]{Directive!Minimum block size}
-   On most modern tape drives, you will not need or wamt to specify this
+   On most modern tape drives, you will not need or want to specify this
    directive, and if you do so, it will be to make Bacula use fixed block
    sizes.  This statement applies only to non-random access devices (e.g.
    tape drives).  Blocks written by the storage daemon to a non-random
@@ -626,9 +752,7 @@ bacula-sd  Alert: TapeAlert[32]: Interface: Problem with SCSI interface
    access devices (tape drives), set the {\bf Minimum block size} and the
    {\bf Maximum block size} to the same value (zero included).  The default
    is that both the minimum and maximum block size are zero and the default
-   block size is 64,512 bytes.  If you wish the block size to be fixed and
-   different from the default, specify the same value for both {\bf Minimum
-   block size} and {\bf Maximum block size}.
+   block size is 64,512 bytes. 
    
    For  example, suppose you want a fixed block size of 100K bytes, then you 
    would specify:  
@@ -665,7 +789,7 @@ bacula-sd  Alert: TapeAlert[32]: Interface: Problem with SCSI interface
    \index[sd]{Directive!Maximum block size}
    On most modern tape drives, you will not need to specify this directive.
    If you do so, it will most likely be to use fixed block sizes (see
-   Minimum block size above).  The Storage daemon will aways attempt to
+   Minimum block size above).  The Storage daemon will always attempt to
    write blocks of the specified {\bf size-in-bytes} to the archive device.
    As a consequence, this statement specifies both the default block size
    and the maximum block size.  The size written never exceed the given
@@ -708,13 +832,13 @@ bacula-sd  Alert: TapeAlert[32]: Interface: Problem with SCSI interface
    track of the  file number on the tape and report it back correctly by the 
    {\bf MTIOCGET} ioctl. Note, some SCSI drivers will correctly  forward space,
    but they do not keep track of the file number or more  seriously, they do not
-   report end of meduim.  
+   report end of medium.  
    
    Default setting for Fast Forward Space File is {\bf Yes}.
    
 \item [Use MTIOCGET = {\it Yes|No}]
-   \index[sd]{Fast Forward Space File}
-   \index[sd]{Directive!Fast Forward Space File}
+   \index[sd]{Use MTIOCGET}
+   \index[sd]{Directive!Use MTIOCGET}
    If {\bf No}, the operating system is not required to support keeping track of
    the file number and reporting it in the ({\bf MTIOCGET} ioctl). The default
    is {\bf Yes}. If you must set this to No, Bacula will do the proper file
@@ -826,17 +950,31 @@ default, Bacula will only write  one end of file to terminate the tape.
    file.  Breaking long sequences of data blocks with file marks permits
    quicker positioning to the start of a given stream of data and can
    improve recovery from read errors on the volume.  The default is one
-   Gigabyte.
+   Gigabyte.  This directive creates EOF marks only on tape media.
+   However, regardless of the medium type (tape, disk, DVD, ...) each time
+   a the Maximum File Size is exceeded, a record is put into the catalog
+   database that permits seeking to that position on the medium for
+   restore operations. If you set this to a small value (e.g. 1MB),
+   you will generate lots of database records (JobMedia) and may
+   significantly increase CPU/disk overhead.
+
+   Note, this directive does not limit the size of Volumes that Bacula
+   will create regardless of whether they are tape or disk volumes. It
+   changes only the number of EOF marks on a tape and the number of
+   block positioning records (see below) that are generated. If you
+   want to limit the size of all Volumes for a particular device, use
+   the {\bf Maximum Volume Size} directive (above), or use the
+   {\bf Maximum Volume Bytes} directive in the Director's Pool resource,
+   which does the same thing but on a Pool (Volume) basis.
 
 \item [Block Positioning = {\it yes|no}]
    \index[sd]{Block Positioning}
    \index[sd]{Directive!Block Positioning}
-   This directive is not normally used (and has not yet been  tested). It will
-   tell Bacula not to use block positioning when  it is reading tapes. This can
-   cause Bacula to be {\bf extremely}  slow when restoring files. You might use
-   this directive if you  wrote your tapes with Bacula in variable block mode
-   (the default),  but your drive was in fixed block mode. If it then works as  I
-   hope, Bacula will be able to re-read your tapes. 
+   This directive tells Bacula not to use block positioning when doing restores.
+   Turning this directive off can cause Bacula to be {\bf extremely} slow
+   when restoring files.  You might use this directive if you wrote your
+   tapes with Bacula in variable block mode (the default), but your drive
+   was in fixed block mode. The default is {\bf yes}.
 
 \item [Maximum Network Buffer Size = {\it bytes}]
    \index[sd]{Maximum Network Buffer Size}
@@ -852,7 +990,7 @@ default, Bacula will only write  one end of file to terminate the tape.
    the case that you are transmitting data over Internet.  It is clear that
    on a high speed local network, you can increase this number and improve
    performance. For example, some users have found that if you use a value
-   of 65,536 bytes they get 5-10 times the throughput.  Larger values for
+   of 65,536 bytes they get five to ten times the throughput.  Larger values for
    most users don't seem to improve performance. If you are interested
    in improving your backup speeds, this is definitely a place to
    experiment. You will probably also want to make the corresponding change
@@ -886,7 +1024,7 @@ default, Bacula will only write  one end of file to terminate the tape.
    This is the maximum size of a volume part file. The default is no limit.
    This directive is implemented only in version 1.37 and later.
 
-   If the device requires  mount, it is transfered to the device when this size
+   If the device requires  mount, it is transferred to the device when this size
    is reached.  In this case, you must take care to have enough disk space left
    in  the spool directory.  
 
@@ -897,13 +1035,36 @@ default, Bacula will only write  one end of file to terminate the tape.
 
 \end{description}
 
-\subsection*{Devices that require a mount (DVD)}
+\label{mountcodes}
+\section{Edit Codes for Mount and Unmount Directives} 
+\index[general]{Directives!Edit Codes}
+\index[general]{Edit Codes for Mount and Unmount Directives }
+
+Before submitting the {\bf Mount Command}, {\bf Unmount Command}, 
+{\bf Write Part Command}, or {\bf Free Space Command} directives 
+to the operating system, Bacula performs character substitution of the
+following characters:
+
+\footnotesize
+\begin{verbatim}
+    %% = %
+    %a = Archive device name
+    %e = erase (set if cannot mount and first part)
+    %n = part number
+    %m = mount point
+    %v = last part name (i.e. filename)
+\end{verbatim}
+\normalsize
+
+
+\section{Devices that require a mount (DVD)}
 \index[general]{Devices that require a mount (DVD)}
 \index[general]{DVD!Devices that require a mount}
-\addcontentsline{toc}{subsection}{Devices that require a mount (DVD)}
 
 All the directives in this section are implemented only in
-Bacula version 1.37 and later.  As of version 1.39.5, the directives
+Bacula version 1.37 and later and hence are available in version 1.38.6.
+
+As of version 1.39.5, the directives
 "Requires Mount", "Mount Point", "Mount Command", and "Unmount Command"
 apply to removable filesystems such as USB in addition to DVD.
 
@@ -962,16 +1123,16 @@ apply to removable filesystems such as USB in addition to DVD.
    and with 0 otherwise, and \%v with the current part filename.
 
    For a DVD, you will most frequently specify the Bacula supplied  {\bf
-   dvd-writepart} script as follows:  
+   dvd-handler} script as follows:  
 
 \footnotesize
 \begin{verbatim}
-  Write Part Command = "/path/dvd-writepart %e %a %v"
+  Write Part Command = "/path/dvd-handler %a write %e %v"
 \end{verbatim}
 \normalsize
 
   Where {\bf /path} is the path to your scripts install directory, and
-  dvd-writepart is the Bacula supplied script file.  
+  dvd-handler is the Bacula supplied script file.  
   This command will already be present, but commented out,
   in the default bacula-sd.conf file. To use it, simply remove
   the comment (\#) symbol.
@@ -986,18 +1147,18 @@ apply to removable filesystems such as USB in addition to DVD.
    the first part, and with 0 otherwise, and \%v with the current part filename.
 
    For a DVD, you will most frequently specify the Bacula supplied  {\bf
-   dvd-freespace} script as follows:  
+   dvd-handler} script as follows:  
 
 \footnotesize
 \begin{verbatim}
-  Free Space Command = "/path/dvd-freespace %a"
+  Free Space Command = "/path/dvd-handler %a free"
 \end{verbatim}
 \normalsize
 
   Where {\bf /path} is the path to your scripts install directory, and
-  dvd-freespace is the Bacula supplied script file.
+  dvd-handler is the Bacula supplied script file.
   If you want to specify your own command, please look at the code of
-  dvd-freespace to see what output Bacula expects from this command.
+  dvd-handler to see what output Bacula expects from this command.
   This command will already be present, but commented out,
   in the default bacula-sd.conf file. To use it, simply remove
   the comment (\#) symbol.
@@ -1007,13 +1168,16 @@ apply to removable filesystems such as USB in addition to DVD.
 
 \end{description}
 
+%% This pulls in the Autochanger resource from another file.
 \label{AutochangerRes}
 \label{AutochangerResource1}
 \input{autochangerres}
 
-\subsection*{Capabilities}
+
+
+
+\section{Capabilities}
 \index[general]{Capabilities}
-\addcontentsline{toc}{subsection}{Capabilities}
 
 \begin{description}
 
@@ -1034,28 +1198,26 @@ apply to removable filesystems such as USB in addition to DVD.
    If {\bf Yes} (the default), permits the daemon to examine the device to
    determine if it contains a Bacula labeled volume.  This is done
    initially when the daemon is started, and then at the beginning of each
-   job.  If the This directive is particularly important if you have set
+   job.  This directive is particularly important if you have set
    {\bf Always Open = no} because it permits Bacula to attempt to read the
    device before asking the system operator to mount a tape.  However,
    please note that the tape must be mounted before the job begins.
 
 \end{description}
 
-\subsection*{Messages Resource}
+\section{Messages Resource}
 \label{MessagesResource1}
 \index[general]{Resource!Messages}
 \index[general]{Messages Resource}
-\addcontentsline{toc}{subsection}{Messages Resource}
 
 For a description of the Messages Resource, please see the 
-\ilink{Messages Resource}{_ChapterStart15} Chapter of this
+\ilink{Messages Resource}{MessagesChapter} Chapter of this
 manual. 
 
-\subsection*{Sample Storage Daemon Configuration File}
+\section{Sample Storage Daemon Configuration File}
 \label{SampleConfiguration}
 \index[general]{File!Sample Storage Daemon Configuration}
 \index[general]{Sample Storage Daemon Configuration File}
-\addcontentsline{toc}{subsection}{Sample Storage Daemon Configuration File}
 
 A example Storage Daemon configuration file might be the following: 
 
@@ -1184,8 +1346,8 @@ Device {
 #  MountCommand = "/bin/mount -t iso9660 -o ro %a %m";
 #  UnmountCommand = "/bin/umount %m";
 #  SpoolDirectory = /tmp/backup;
-#  WritePartCommand = "/etc/bacula/dvd-writepart %e %a %v"
-#  FreeSpaceCommand = "/etc/bacula/dvd-freespace %a"
+#  WritePartCommand = "/etc/bacula/dvd-handler %a write %e %v"
+#  FreeSpaceCommand = "/etc/bacula/dvd-handler %a free"
 #}
 #
 # A very old Exabyte with no end of media detection