]> git.sur5r.net Git - bacula/docs/blobdiff - docs/manual/storedconf.tex
Update
[bacula/docs] / docs / manual / storedconf.tex
index 9333a539dd0026786e14d735bb54438acafbc7fb..3cc54c2de001a2f3e3241f04cd454bf6310d9f14 100644 (file)
@@ -602,19 +602,114 @@ 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}
@@ -901,6 +996,29 @@ default, Bacula will only write  one end of file to terminate the tape.
 
 \end{description}
 
+\label{mountcodes}
+\subsection*{Edit Codes for Mount and Unmount Directives} 
+\index[general]{Directives!Edit Codes}
+\index[general]{Edit Codes for Mount and Unmount Directives }
+\addcontentsline{toc}{subsection}{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
+
+
 \subsection*{Devices that require a mount (DVD)}
 \index[general]{Devices that require a mount (DVD)}
 \index[general]{DVD!Devices that require a mount}