quite a large number of directives in the Device Resource definition that
allow you to define all the characteristics of your Storage device (normally a
tape drive). Fortunately, with modern storage devices, the defaults are
-sufficient, and very few directives are actually needed.
+sufficient, and very few directives are actually needed.
Examples of {\bf Device} resource directives that are known to work for a
number of common tape drives can be found in the {\bf
\lt{}bacula-src\gt{}/examples/devices} directory, and most will also be listed
-here.
+here.
For a general discussion of configuration file and resources including the
-data types recognized by {\bf Bacula}, please see the
+data types recognized by {\bf Bacula}, please see the
\ilink{Configuration}{ConfigureChapter} chapter of this manual. The
-following Storage Resource definitions must be defined:
+following Storage Resource definitions must be defined:
-\begin{itemize}
-\item
- \ilink{Storage}{StorageResource} -- to define the name of the
- Storage daemon.
-\item
+\begin{bsysitemize}
+\item
+ \ilink{Storage}{StorageResource2} -- to define the name of the
+ Storage daemon.
+\item
\ilink{Director}{DirectorResource1} -- to define the Director's
- name and his access password.
-\item
+ name and his access password.
+\item
\ilink{Device}{DeviceResource} -- to define the
- characteristics of your storage device (tape drive).
-\item
+ characteristics of your storage device (tape drive).
+\item
\ilink{Messages}{MessagesChapter} -- to define where error and
- information messages are to be sent.
-\end{itemize}
+ information messages are to be sent.
+\end{bsysitemize}
\section{Storage Resource}
-\label{StorageResource}
+\label{StorageResource2}
\index[general]{Resource!Storage}
\index[general]{Storage Resource}
In general, the properties specified under the Storage resource define global
properties of the Storage daemon. Each Storage daemon configuration file must
-have one and only one Storage resource definition.
+have one and only one Storage resource definition.
\begin{description}
+\label{Storage:Storage:Name}
\item [Name = \lt{}Storage-Daemon-Name\gt{}]
\index[sd]{Name}
\index[sd]{Directive!Name}
- Specifies the Name of the Storage daemon. This directive is required.
+ Specifies the Name of the Storage daemon. This directive is required.
+\label{Storage:Storage:WorkingDirectory}
\item [Working Directory = \lt{}Directory\gt{}]
\index[sd]{Working Directory}
\index[sd]{Directive!Working Directory}
daemon may put its status files. This directory should be used only by {\bf
Bacula}, but may be shared by other Bacula daemons provided the names
given to each daemon are unique. This directive is
- required
+ required
+\label{Storage:Storage:PidDirectory}
\item [Pid Directory = \lt{}Directory\gt{}]
\index[sd]{Pid Directory}
\index[sd]{Directive!Pid Directory}
- This directive is mandatory and specifies a directory in which the Director
+ This directive is mandatory and specifies a directory in which the Director
may put its process Id file files. The process Id file is used to shutdown
- Bacula and to prevent multiple copies of Bacula from running simultaneously.
- This directive is required. Standard shell expansion of the {\bf Directory}
+ Bacula and to prevent multiple copies of Bacula from running simultaneously.
+ This directive is required. Standard shell expansion of the {\bf Directory}
is done when the configuration file is read so that values such as {\bf
- \$HOME} will be properly expanded.
+ \$HOME} will be properly expanded.
Typically on Linux systems, you will set this to: {\bf /var/run}. If you are
not installing Bacula in the system directories, you can use the {\bf Working
- Directory} as defined above.
+ Directory} as defined above.
+\label{Storage:Storage:HeartbeatInterval}
\item [Heartbeat Interval = \lt{}time-interval\gt{}]
\index[sd]{Heartbeat Interval}
\index[sd]{Directive!Heartbeat Interval}
duration despite the fact that keepalive is set. This usually
results in a broken pipe error message.
+\label{Storage:Storage:ClientConnectWait}
\item [Client Connect Wait = \lt{}time-interval\gt{}]
\index[sd]{Connect Wait}
\index[sd]{Directive!Connect Wait}
longer the Storage daemon waits for a Client, the more
resources will be tied up.
+\label{Storage:Storage:MaximumConcurrentJobs}
\item [Maximum Concurrent Jobs = \lt{}number\gt{}]
\index[sd]{Maximum Concurrent Jobs}
\index[sd]{Directive!Maximum Concurrent Jobs}
the Storage resource in the Director's configuration file and possibly
those in the Job and Client resources.
+\label{Storage:Storage:SDAddresses}
\item [SDAddresses = \lt{}IP-address-specification\gt{}]
\index[sd]{SDAddresses}
\index[sd]{Directive!SDAddresses}
explain how this directive works is to show an example:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
SDAddresses = { ip = {
addr = 1.2.3.4; port = 1205; }
ipv4 = {
addr = bluedot.thun.net
}
}
-\end{verbatim}
+\end{lstlisting}
\normalsize
where ip, ip4, ip6, addr, and port are all keywords. Note, that the address
as a number or as the mnemonic value from the /etc/services file. If a port
is not specified, the default will be used. If an ip section is specified,
the resolution can be made either by IPv4 or IPv6. If ip4 is specified, then
-only IPv4 resolutions will be permitted, and likewise with ip6.
+only IPv4 resolutions will be permitted, and likewise with ip6.
-Using this directive, you can replace both the SDPort and SDAddress
-directives shown below.
+Using this directive, you can replace both the SDPort and SDAddress
+directives shown below.
+\label{Storage:Storage:SdPort}
\item [SDPort = \lt{}port-number\gt{}]
\index[sd]{SDPort}
\index[sd]{Directive!SDPort}
Specifies port number on which the Storage daemon listens for Director
- connections. The default is 9103.
-
+ connections. The default is 9103.
+
+\label{Storage:Storage:SdAddress}
\item [SDAddress = \lt{}IP-Address\gt{}]
\index[sd]{SDAddress}
\index[sd]{Directive!SDAddress}
specified, the Storage daemon will bind to any available address (the
default).
+\label{Storage:Storage:End}
\end{description}
-The following is a typical Storage daemon Storage definition.
+The following is a typical Storage daemon Storage definition.
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
#
# "Global" Storage daemon configuration specifications appear
# under the Storage resource.
WorkingDirectory = "~/bacula/working"
Pid Directory = "~/bacula/working"
}
-\end{verbatim}
+\end{lstlisting}
\normalsize
\section{Director Resource}
\begin{description}
+\label{Storage:Director:Name}
\item [Name = \lt{}Director-Name\gt{}]
\index[sd]{Name}
\index[sd]{Directive!Name}
Specifies the Name of the Director allowed to connect to the Storage daemon.
- This directive is required.
+ This directive is required.
+\label{Storage:Director:Password}
\item [Password = \lt{}Director-password\gt{}]
\index[sd]{Password}
\index[sd]{Directive!Password}
Specifies the password that must be supplied by the above named Director.
- This directive is required.
+ This directive is required.
+\label{Storage:Director:Monitor}
\item [Monitor = \lt{}yes\vb{}no\gt{}]
\index[sd]{Monitor}
\index[sd]{Directive!Monitor}
director will only be able to fetch the current status of this Storage
daemon.
- Please note that if this director is being used by a Monitor, we highly
- recommend to set this directive to {\bf yes} to avoid serious security
- problems.
+ Please note that if this director is being used by a Monitor, we highly
+ recommend to set this directive to {\bf yes} to avoid serious security
+ problems.
\end{description}
-The following is an example of a valid Director resource definition:
+The following is an example of a valid Director resource definition:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
Director {
Name = MainDirector
Password = my_secret_password
}
-\end{verbatim}
+\end{lstlisting}
\normalsize
\label{DeviceResource}
\begin{description}
+\label{Storage:Device:Name}
\item [Name = {\it Device-Name}]
\index[sd]{Name}
\index[sd]{Directive!Name}
make it correspond to the English name of the backup device. The physical
name of the device is specified on the {\bf Archive Device} directive
described below. The name you specify here is also used in your Director's
- conf file on the
+ conf file on the
\ilink{Device directive}{StorageResource2} in its Storage
- resource.
+ resource.
+\label{Storage:Device:ArchiveDevice}
\item [Archive Device = {\it name-string}]
\index[sd]{Archive Device}
\index[sd]{Directive!Archive Device}
The specified {\bf name-string} gives the system file name of the storage
device managed by this storage daemon. This will usually be the device file
name of a removable storage device (tape drive), for example "{\bf
- /dev/nst0}" or "{\bf /dev/rmt/0mbn}". For a DVD-writer, it will be for
- example {\bf /dev/hdc}. It may also be a directory name if you are archiving
- to disk storage. In this case, you must supply the full absolute path to the
- directory. When specifying a tape device, it is preferable that the
- "non-rewind" variant of the device file name be given. In addition, on
- systems such as Sun, which have multiple tape access methods, you must be
- sure to specify to use Berkeley I/O conventions with the device. The {\bf b}
- in the Solaris (Sun) archive specification {\bf /dev/rmt/0mbn} is what is
- needed in this case. Bacula does not support SysV tape drive behavior.
-
+ /dev/nst0}" or "{\bf /dev/rmt/0mbn}". It may also be a directory name
+ if you are archiving to disk storage. In this case, you must supply the
+ full absolute path to the directory. When specifying a tape device, it
+ is preferable that the "non-rewind" variant of the device file name be
+ given. In addition, on systems such as Sun, which have multiple tape
+ access methods, you must be sure to specify to use Berkeley I/O
+ conventions with the device. The {\bf b} in the Solaris (Sun) archive
+ specification {\bf /dev/rmt/0mbn} is what is needed in this case.
+ Bacula does not support SysV tape drive behavior.
+
As noted above, normally the Archive Device is the name of a tape drive, but
you may also specify an absolute path to an existing directory. If the
Device is a directory Bacula will write to file storage in the specified
kind of device, you never want to specify {\bf AlwaysOpen}, because you want
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
+ 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 the {\bf
label} command to avoid attempting to write a label.
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
Device {
Name = FifoStorage
Media Type = Fifo
MaximumOpenWait = 60
AlwaysOpen = no
}
-\end{verbatim}
+\end{lstlisting}
\normalsize
During a restore operation, if the Archive Device is a FIFO, Bacula will
writes into the FIFO. Bacula will wait {\bf MaximumOpenWait} seconds for the
program to begin writing and will then time it out and terminate the job. As
noted above, you may use the {\bf RunBeforeJob} to start the writer program
- at the beginning of the job.
-
- The Archive Device directive is required.
+ at the beginning of the job.
+
+ The Archive Device directive is required.
+\label{Storage:Device:DeviceType}
\item [Device Type = {\it type-specification}]
\index[sd]{Device Type}
\index[sd]{Directive!Device Type}
The device is a tape device and thus is sequential access. Tape devices
are controlled using ioctl() calls.
\item [Fifo]
- The device is a first-in-first out sequential access read-only
+ The device is a first-in-first out sequential access read-only
or write-only device.
- \item [DVD]
- The device is a DVD. DVDs are sequential access for writing, but
- random access for reading.
\end{description}
-
+
The Device Type directive is not required, and if not specified, Bacula
will attempt to guess what kind of device has been specified using the
Archive Device specification supplied. There are several advantages to
explicitly specifying the Device Type. First, on some systems, block and
- character devices have the same type, which means that on those systems,
- Bacula is unlikely to be able to correctly guess that a device is a DVD.
+ character devices have the same type.
Secondly, if you explicitly specify the Device Type, the mount point
need not be defined until the device is opened. This is the case with
most removable devices such as USB that are mounted by the HAL daemon.
This directive was implemented in Bacula version 1.38.6.
+\label{Storage:Device:MediaType}
\item [Media Type = {\it name-string}]
\index[sd]{Media Type}
\index[sd]{Directive!Media Type}
associated with it. The same {\bf name-string} must appear in the
appropriate Storage resource definition in the Director's configuration
file.
-
+
Even though the names you assign are arbitrary (i.e. you choose the name
you want), you should take care in specifying them because the Media Type
is used to determine which storage device Bacula will select during
for all drives where the Media can be freely interchanged. This is not
generally an issue if you have a single Storage daemon, but it is with
multiple Storage daemons, especially if they have incompatible media.
-
+
For example, if you specify a Media Type of "DDS-4" then during the
restore, Bacula will be able to choose any Storage Daemon that handles
"DDS-4". If you have an autochanger, you might want to name the Media Type
Bacula to select the correct Device resource, each one must have a
unique Media Type.
+
+\label{Storage:Device:Autochanger}
\label{Autochanger}
\item [Autochanger = {\it yes\vb{}no}]
\index[sd]{Autochanger}
\index[sd]{Directive!Autochanger}
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
+ 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
+ have an identical directive to the
\ilink{Storage resource}{Autochanger1} in the Director's
configuration file so that when labeling tapes you are prompted for the slot.
+\label{Storage:Device:ChangerDevice}
\item [Changer Device = {\it name-string}]
\index[sd]{Changer Device}
\index[sd]{Directive!Changer 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
- generic 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
+ {\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
of this manual for more details of using this and the following
autochanger directives.
+\label{Storage:Device:ChangerCommand}
\item [Changer Command = {\it name-string}]
\index[sd]{Changer Command}
\index[sd]{Directive!Changer Command}
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:
+ you will specify the Bacula supplied {\bf mtx-changer} script as follows:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
Changer Command = "/path/mtx-changer %c %o %S %a %d"
-\end{verbatim}
+\end{lstlisting}
\normalsize
and you will install the {\bf mtx} on your system (found in the {\bf depkgs}
- release). An example of this command is in the default bacula-sd.conf file.
+ 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
+ configure your autochanger please see the
\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}.
+ scripts in {\bf examples/autochangers}.
+\label{Storage:Device:AlertCommand}
\item [Alert Command = {\it name-string}]
\index[sd]{Alert Command}
The {\bf name-string} specifies an external program to be called at the
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}{AutochangersChapter} chapter of this manual.
-
-
+
+
Note, it is not necessary to have an autochanger to use this command. The
example below uses the {\bf tapeinfo} program that comes with the {\bf mtx}
package, but it can be used on any tape drive. However, you will need to
specify a {\bf Changer Device} directive in your Device resource (see above)
so that the generic SCSI device name can be edited into the command (with
the \%c).
-
+
An example of the use of this command to print Tape Alerts in the Job report
- is:
+ is:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
Alert Command = "sh -c 'tapeinfo -f %c | grep TapeAlert'"
-
-\end{verbatim}
+
+\end{lstlisting}
\normalsize
-and an example output when there is a problem could be:
+and an example output when there is a problem could be:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
bacula-sd Alert: TapeAlert[32]: Interface: Problem with SCSI interface
between tape drive and initiator.
-
-\end{verbatim}
+
+\end{lstlisting}
\normalsize
+\label{Storage:Device:DriveIndex}
\item [Drive Index = {\it number}]
\index[sd]{Drive Index}
\index[sd]{Directive!Drive Index}
the past -- the default mtx-changer script works for any number of
drives.
+\label{Storage:Device:Autoselect}
\item [Autoselect = {\it yes\vb{}no}]
\index[sd]{Autoselect}
\index[sd]{Directive!Autoselect}
for reserving a drive for something special such as a high priority
backup or restore operations.
+\item[Maximum Concurrent Jobs = {\it num}]
+\index[sd]{MaximumConcurrentJobs}
+
+{\bf Maximum Concurrent Jobs} is a directive that permits setting the maximum
+number of Jobs that can run concurrently on a specified Device. Using this
+directive, it is possible to have different Jobs using multiple drives, because
+when the Maximum Concurrent Jobs limit is reached, the Storage Daemon will
+start new Jobs on any other available compatible drive. This facilitates
+writing to multiple drives with multiple Jobs that all use the same Pool.
+
+\label{Storage:Device:MaximumChangerWait}
\item [Maximum Changer Wait = {\it time}]
\index[sd]{Maximum Changer Wait}
\index[sd]{Directive!Maximum Changer Wait}
for an autochanger to change the volume. If this time is exceeded,
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.
+ 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.
+\label{Storage:Device:MaximumRewindWait}
\item [Maximum Rewind Wait = {\it time}]
\index[sd]{Maximum Rewind Wait}
\index[sd]{Directive!Maximum Rewind Wait}
for a rewind before timing out. If this time is exceeded,
Bacula will cancel the job. The default is 5 minutes.
+\label{Storage:Device:MaximumOpenWait}
\item [Maximum Open Wait = {\it time}]
\index[sd]{Maximum Open Wait}
\index[sd]{Directive!Maximum Open Wait}
for a open before timing out. If this time is exceeded,
Bacula will cancel the job. The default is 5 minutes.
+\label{Storage:Device:AlwaysOpen}
\item [Always Open = {\it yes\vb{}no}]
\index[sd]{Always Open}
\index[sd]{Directive!Always Open}
- If {\bf Yes} (default), Bacula will always keep the device open unless
+ If {\bf Yes}, 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, 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 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
- Bacula needs it.
-
+ {\bf AlwaysOpen} to {\bf no} (default) {\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 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 Bacula needs it.
+
If you have {\bf Always Open = yes} (recommended) and you want to use the
drive for something else, simply use the {\bf unmount} command in the
Console program to release the drive. However, don't forget to remount the
drive with {\bf mount} when the drive is available or the next Bacula job
will block.
-
+
For File storage, this directive is ignored. For a FIFO storage device, you
- must set this to {\bf No}.
-
+ must set this to {\bf No}.
+
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
drive autochanger operations will fail. We strongly recommend to keep
{\bf Always Open} set to {\bf Yes}
+\label{Storage:Device:VolumePollInterval}
\item [Volume Poll Interval = {\it time}]
\index[sd]{Volume Poll Interval}
\index[sd]{Directive!Volume Poll Interval}
and continue. Please be aware that if you set this interval too small, you
may excessively wear your tape drive if the old tape remains in the drive,
since Bacula will read it on each poll. This can be avoided by ejecting the
- tape using the {\bf Offline On Unmount} and the {\bf Close on Poll}
- directives.
+ tape using the {\bf Offline On Unmount} and the {\bf Close on Poll}
+ directives.
However, if you are using a Linux 2.6 kernel or other OSes
such as FreeBSD or Solaris, the Offline On Unmount will leave the drive
with no tape, and Bacula will not be able to properly open the drive and
may fail the job. For more information on this problem, please see the
- \ilink{description of Offline On Unmount}{NoTapeInDrive} in the Tape
- Testing chapter.
+ \bsysxrlink{description of Offline On Unmount}{NoTapeInDrive}{problems}{subsection}
+ in the \bsysxrlink{Tape Testing}{TapeTestingChapter}{problems}{chapter} of the \problemsman{}.
-\item [Close on Poll= {\it yes\vb{}no}]
+\label{Storage:Device:CloseOnPoll}
+\item [Close on Poll = {\it yes\vb{}no}]
\index[sd]{Close on Poll}
\index[sd]{Directive!Close on Poll}
If {\bf Yes}, Bacula close the device (equivalent to an unmount except no
useful unless you have the {\bf Offline on Unmount} directive set, in which
case the drive will be taken offline preventing wear on the tape during any
future polling. Once the operator inserts a new tape, Bacula will recognize
- the drive on the next poll and automatically continue with the backup.
+ the drive on the next poll and automatically continue with the backup.
Please see above more more details.
+\label{Storage:Device:MaximumOpenWait}
\item [Maximum Open Wait = {\it time}]
\index[sd]{Maximum Open Wait}
\index[sd]{Directive!Maximum Open Wait}
error. Bacula will re-attempt to open the drive the next time a Job
starts that needs the the drive.
+
+\label{Storage:Device:RemovableMedia}
\label{removablemedia}
-\item [Removable media = {\it yes\vb{}no}]
+\item [Removable Media = {\it yes\vb{}no}]
\index[sd]{Removable media}
\index[sd]{Directive!Removable media}
If {\bf Yes}, this device supports removable media (for example, tapes
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
+ 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,
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}.
+ {\bf Removable Media}.
-\item [Random access = {\it yes\vb{}no}]
+\label{Storage:Device:RandomAccess}
+\item [Random Access = {\it yes\vb{}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. This should be set to {\bf Yes} for all
- file systems such as DVD, USB, and fixed files. It should be set to
+ file systems such as USB, and fixed files. It should be set to
{\bf No} for non-random access devices such as tapes and named pipes.
+\label{Storage:Device:RequiresMount}
\item [Requires Mount = {\it yes\vb{}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
+ You must set this directive to {\bf yes} for 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
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}.
+ Command}. To be able to write devices need a mount, the following
+ directives must also be defined: {\bf Mount Point}, {\bf Mount Command},
+ and {\bf Unmount Command}.
+\label{Storage:Device:MountPoint}
\item [Mount Point = {\it directory}]
\index[sd]{Mount Point}
- Directory where the device can be mounted.
+ Directory where the device can be mounted.
This directive is used only
- for devices that have {\bf Requires Mount} enabled such as DVD or
+ for devices that have {\bf Requires Mount} enabled such as
USB file devices.
+\label{Storage:Device:MountCommand}
\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
+ This directive specifies the command that must be executed to mount
+ devices such as many USB devices. 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.
If you need to specify multiple commands, create a shell script.
+\label{Storage:Device:UnmountCommand}
\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
+ This directive specifies the command that must be executed to unmount
+ devices such as 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:
+ Most frequently, you will define it as follows:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
Unmount Command = "/bin/umount %m"
-\end{verbatim}
+\end{lstlisting}
\normalsize
See the \ilink {Edit Codes}{mountcodes} section below for more details of
If you need to specify multiple commands, create a shell script.
+\item[Block Checksum = {\it yes/no}]
+
+ You may turn off the Block Checksum (CRC32) code that Bacula uses when
+ writing blocks to a Volume. Doing so can reduce the Storage daemon CPU usage
+ slightly. It will also permit Bacula to read a Volume that has corrupted
+ data.
+
+ The default is {\bf yes} -- i.e. the checksum is computed on write and
+ checked on read.
+
+ \textbf{We do not recommend to turn this off} particularly on older tape
+ drives or for disk Volumes where doing so may allow corrupted data to go
+ undetected.
+
+\label{Storage:Device:MinimumBlockSize}
\item [Minimum block size = {\it size-in-bytes}]
\index[sd]{Minimum block size}
\index[sd]{Directive!Minimum block size}
The Storage daemon will attempt to efficiently fill blocks with data
received from active sessions but will, if necessary, add padding to a
block to achieve the required minimum size.
-
+
To force the block size to be fixed, as is the case for some non-random
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.
-
- For example, suppose you want a fixed block size of 100K bytes, then you
- would specify:
+ block size is 64,512 bytes.
+
+ For example, suppose you want a fixed block size of 100K bytes, then you
+ would specify:
\footnotesize
-\begin{verbatim}
-
+\begin{lstlisting}
+
Minimum block size = 100K
Maximum block size = 100K
-
-\end{verbatim}
+
+\end{lstlisting}
\normalsize
Please note that if you specify a fixed block size as shown above, the tape
drive must either be in variable block size mode, or if it is in fixed block
size mode, the block size (generally defined by {\bf mt}) {\bf must} be
identical to the size specified in Bacula -- otherwise when you attempt to
- re-read your Volumes, you will get an error.
-
+ re-read your Volumes, you will get an error.
+
If you want the block size to be variable but with a 64K minimum and 200K
- maximum (and default as well), you would specify:
+ maximum (and default as well), you would specify:
\footnotesize
-\begin{verbatim}
-
+\begin{lstlisting}
+
Minimum block size = 64K
Maximum blocksize = 200K
-
-\end{verbatim}
+
+\end{lstlisting}
\normalsize
+\label{Storage:Device:MaximumBlockSize}
\item [Maximum block size = {\it size-in-bytes}]
\index[sd]{Maximum block size}
\index[sd]{Directive!Maximum block size}
{\bf size-in-bytes}. If adding data to a block would cause it to exceed
the given maximum size, the block will be written to the archive device,
and the new data will begin a new block.
-
+
If no value is specified or zero is specified, the Storage daemon will
use a default block size of 64,512 bytes (126 * 512).
The maximum {\bf size-in-bytes} possible is 2,000,000.
+\label{Storage:Device:HardwareEndOfMedium}
\item [Hardware End of Medium = {\it yes\vb{}no}]
\index[sd]{Hardware End of Medium}
\index[sd]{Directive!Hardware End of Medium}
option, which if set will cause the driver to lose track of the file
number. You should ensure that this option is always turned off using the
{\bf mt} program.
-
+
Default setting for Hardware End of Medium is {\bf Yes}. This function is
used before appending to a tape to ensure that no previously written data is
lost. We recommend if you have a non-standard or unusual tape drive that you
use the {\bf btape} program to test your drive to see whether or not it
supports this function. All modern (after 1998) tape drives support this
- feature.
-
+ feature.
+
+\label{Storage:Device:FastForwardSpaceFile}
\item [Fast Forward Space File = {\it yes\vb{}no}]
\index[sd]{Fast Forward Space File}
\index[sd]{Directive!Fast Forward Space File}
the file number ({\bf MTIOCGET} ioctl) during forward space file. If {\bf
Yes}, the archive device must support the {\tt ioctl} {\tt MTFSF} call, which
virtually all drivers support, but in addition, your SCSI driver must keep
- track of the file number on the tape and report it back correctly by the
+ 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 medium.
-
+ report end of medium.
+
Default setting for Fast Forward Space File is {\bf Yes}.
-
+
+\label{Storage:Device:UseMtiocget}
\item [Use MTIOCGET = {\it yes\vb{}no}]
\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
- position determination, but it is very unfortunate because it means that
+ position determination, but it is very unfortunate because it means that
tape movement is very inefficient.
Fortunately, this operation system deficiency seems to be the case only
on a few *BSD systems. Operating systems known to work correctly are
Solaris, Linux and FreeBSD.
+\label{Storage:Device:BsfAtEom}
\item [BSF at EOM = {\it yes\vb{}no}]
\index[sd]{BSF at EOM}
\index[sd]{Directive!BSF at EOM}
the second EOF mark. Determination of whether or not you need this directive
is done using the {\bf test} command in the {\bf btape} program.
+
+\label{Storage:Device:TwoEof}
\item [TWO EOF = {\it yes\vb{}no}]
\index[sd]{TWO EOF}
\index[sd]{Directive!TWO EOF}
tape -- i.e. after the last job or at the end of the medium. If {\bf No},
the default, Bacula will only write one end of file to terminate the tape.
+\label{Storage:Device:BackwardSpaceRecord}
\item [Backward Space Record = {\it yes\vb{}no}]
\index[sd]{Backward Space Record}
\index[sd]{Directive!Backward Space Record}
function off, the test will not be done. This causes no harm as the re-read
process is precautionary rather than required.
+\label{Storage:Device:BackwardSpaceFile}
\item [Backward Space File = {\it yes\vb{}no}]
\index[sd]{Backward Space File}
\index[sd]{Directive!Backward Space File}
ioctl}s to backspace over an end of file mark and to the start of a file. If
{\it No}, these calls are not used and the device must be rewound and
advanced forward to the desired position. Default is {\bf Yes} for non
- random-access devices.
+ random-access devices.
+\label{Storage:Device:ForwardSpaceRecord}
\item [Forward Space Record = {\it yes\vb{}no}]
\index[sd]{Forward Space Record}
\index[sd]{Directive!Forward Space Record}
If {\it Yes}, the archive device must support the {\bf MTFSR ioctl} to
forward space over records. If {\bf No}, data must be read in order to
advance the position on the device. Default is {\bf Yes} for non
- random-access devices.
+ random-access devices.
+\label{Storage:Device:ForwardSpaceFile}
\item [Forward Space File = {\it yes\vb{}no}]
\index[sd]{Forward Space File}
\index[sd]{Directive!Forward Space File}
If {\bf Yes}, the archive device must support the {\tt MTFSF ioctl} to
forward space by file marks. If {\it No}, data must be read to advance the
- position on the device. Default is {\bf Yes} for non random-access devices.
+ position on the device. Default is {\bf Yes} for non random-access devices.
+\label{Storage:Device:OfflineOnUnmount}
\item [Offline On Unmount = {\it yes\vb{}no}]
\index[sd]{Offline On Unmount}
\index[sd]{Directive!Offline On Unmount}
({\bf mt -f /dev/xxx load}) before the system will recognize the tape. If you
are using an autochanger, some devices require an offline to be issued prior
to changing the volume. However, most devices do not and may get very
- confused.
+ confused.
If you are using a Linux 2.6 kernel or other OSes
such as FreeBSD or Solaris, the Offline On Unmount will leave the drive
with no tape, and Bacula will not be able to properly open the drive and
may fail the job. For more information on this problem, please see the
- \ilink{description of Offline On Unmount}{NoTapeInDrive} in the Tape
- Testing chapter.
+ \bsysxrlink{description of Offline On Unmount}{NoTapeInDrive}{problems}{subsection}
+ in the \bsysxrlink{Tape Testing}{TapeTestingChapter}{problems}{chapter} of the \problemsman{}.
+
+\label{Storage:Device:MaximumConcurrentJobs}
\item [Maximum Concurrent Jobs = \lt{}number\gt{}]
\index[sd]{Device Maximum Concurrent Jobs}
\index[sd]{Directive!Device Maximum Concurrent Jobs}
\index[sd]{Directive!New in 3.0.3}
where \lt{}number\gt{} is the maximum number of Jobs that can run
concurrently on a specified Device. Using this directive, it is possible
- to have different Jobs using multiple drives, because when
+ to have different Jobs using multiple drives, because when
the Maximum Concurrent Jobs limit is
reached, the Storage Daemon will start new Jobs on any other available
compatible drive. This facilitates writing to multiple drives with
multiple Jobs that all use the same Pool.
+\label{Storage:Device:MaximumVolumeSize}
\item [Maximum Volume Size = {\it size}]
\index[sd]{Maximum Volume Size}
\index[sd]{Directive!Maximum Volume Size}
directive is deprecated (being phased out) in favor of the {\bf Maximum
Volume Bytes} defined in the Director's configuration file.
+\label{Storage:Device:MaximumFileSize}
\item [Maximum File Size = {\it size}]
\index[sd]{Maximum File Size}
\index[sd]{Directive!Maximum File Size}
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. This directive creates EOF marks only on tape media.
- However, regardless of the medium type (tape, disk, DVD, ...) each time
+ However, regardless of the medium type (tape, disk, USB ...) 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),
{\bf Maximum Volume Bytes} directive in the Director's Pool resource,
which does the same thing but on a Pool (Volume) basis.
+\label{Storage:Device:BlockPositioning}
\item [Block Positioning = {\it yes\vb{}no}]
\index[sd]{Block Positioning}
\index[sd]{Directive!Block Positioning}
tapes with Bacula in variable block mode (the default), but your drive
was in fixed block mode. The default is {\bf yes}.
+\label{Storage:Device:MaximumNetworkBufferSize}
\item [Maximum Network Buffer Size = {\it bytes}]
\index[sd]{Maximum Network Buffer Size}
\index[sd]{Directive!Maximum Network Buffer Size}
in each of your File daemons conf files.
+\label{Storage:Device:MaximumSpoolSize}
\item [Maximum Spool Size = {\it bytes}]
\index[sd]{Maximum Spool Size}
\index[sd]{Directive!Maximum Spool Size}
where the bytes specify the maximum spool size for all jobs that are
running. The default is no limit.
+\label{Storage:Device:MaximumJobSpoolSize}
\item [Maximum Job Spool Size = {\it bytes}]
\index[sd]{Maximum Job Spool Size}
\index[sd]{Directive!Maximum Job Spool Size}
where the bytes specify the maximum spool size for any one job that is
- running. The default is no limit.
+ running. The default is no limit.
This directive is implemented only in version 1.37 and later.
+\label{Storage:Device:SpoolDirectory}
\item [Spool Directory = {\it directory}]
\index[sd]{Spool Directory}
\index[sd]{Directive!Spool Directory}
specifies the name of the directory to be used to store the spool files for
this device. This directory is also used to store temporary part files when
- writing to a device that requires mount (DVD). The default is to use the
- working directory.
+ writing to a device that requires mount (USB). The default is to use the
+ working directory.
+\label{Storage:Device:MaximumPartSize}
\item [Maximum Part Size = {\it bytes}]
\index[sd]{Maximum Part Size}
\index[sd]{Directive!Maximum Part 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.
+ in the spool directory.
- Otherwise, it is left on the hard disk.
+ Otherwise, it is left on the hard disk.
- It is ignored for tape and FIFO devices.
+ It is ignored for tape and FIFO devices.
\end{description}
\label{mountcodes}
-\section{Edit Codes for Mount and Unmount Directives}
+\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
+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}
+\begin{lstlisting}
%% = %
%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}
+\end{lstlisting}
\normalsize
-\section{Devices that require a mount (DVD)}
-\index[general]{Devices that require a mount (DVD)}
-\index[general]{DVD!Devices that require a mount}
+\section{Devices that require a mount (USB)}
+\index[general]{Devices that require a mount (USB)}
All the directives in this section are implemented only in
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.
+apply to removable filesystems such as USB.
\begin{description}
+\label{Storage:Device:RequiresMount}
\item [Requires Mount = {\it yes\vb{}no}]
\index[sd]{Requires Mount}
\index[sd]{Directive!Requires Mount}
- You must set this directive to {\bf yes} for DVD-writers, and to {\bf no} for
- all other devices (tapes/files). This directive indicates if the device
- requires to be mounted to be read, and if it must be written in a special way.
- If it set, {\bf Mount Point}, {\bf Mount Command}, {\bf Unmount Command} and
- {\bf Write Part Command} directives must also be defined.
-
+ You must set this directive to {\bf yes} for removable devices such as
+ USB unless they are automounted, and to {\bf no} for all other devices
+ (tapes/files). This directive indicates if the device requires to be
+ mounted to be read, and if it must be written in a special way. If it
+ set, {\bf Mount Point}, {\bf Mount Command}, {\bf Unmount Command} and
+ {\bf Write Part Command} directives must also be defined.
+
+\label{Storage:Device:MountPoint}
\item [Mount Point = {\it directory}]
\index[sd]{Mount Point}
\index[sd]{Directive!Mount Point}
- Directory where the device can be mounted.
+ Directory where the device can be mounted.
+\label{Storage:Device:MountCommand}
\item [Mount Command = {\it name-string}]
\index[sd]{Mount Command}
\index[sd]{Directive!Mount Command}
- Command that must be executed to mount the device. Before the command is
- executed, \%a is replaced with the Archive Device, and \%m with the Mount
+ Command that must be executed to mount the device. 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:
+ Most frequently, you will define it as follows:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
Mount Command = "/bin/mount -t iso9660 -o ro %a %m"
-\end{verbatim}
+\end{lstlisting}
\normalsize
For some media, you may need multiple commands. If so, it is recommended
Command. For example, instead of this:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
Mount Command = "/usr/local/bin/mymount"
-\end{verbatim}
+\end{lstlisting}
\normalsize
Where that script contains:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
#!/bin/sh
ndasadmin enable -s 1 -o w
sleep 2
mount /dev/ndas-00323794-0p1 /backup
-\end{verbatim}
+\end{lstlisting}
\normalsize
Similar consideration should be given to all other Command parameters.
+\label{Storage:Device:UnmountCommand}
\item [Unmount Command = {\it name-string}]
\index[sd]{Unmount Command}
\index[sd]{Directive!Unmount Command}
executed, \%a is replaced with the Archive Device, and \%m with the Mount
Point.
- Most frequently, you will define it as follows:
+ Most frequently, you will define it as follows:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
Unmount Command = "/bin/umount %m"
-\end{verbatim}
+\end{lstlisting}
\normalsize
If you need to specify multiple commands, create a shell script.
-\item [Write Part Command = {\it name-string}]
- \index[sd]{Write Part Command}
- \index[sd]{Directive!Write Part Command}
- Command that must be executed to write a part to the device. Before the
- command is executed, \%a is replaced with the Archive Device, \%m with the
- Mount Point, \%e is replaced with 1 if we are writing 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-handler} script as follows:
-
-\footnotesize
-\begin{verbatim}
- 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-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.
-
- If you need to specify multiple commands, create a shell script.
-
-
-\item [Free Space Command = {\it name-string}]
- \index[sd]{Free Space Command}
- \index[sd]{Directive!Free Space Command}
- Command that must be executed to check how much free space is left on the
- device. Before the command is executed,\%a is replaced with the Archive
- Device, \%m with the Mount Point, \%e is replaced with 1 if we are writing
- 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-handler} script as follows:
-
-\footnotesize
-\begin{verbatim}
- Free Space Command = "/path/dvd-handler %a free"
-\end{verbatim}
-\normalsize
-
- Where {\bf /path} is the path to your scripts install directory, and
- dvd-handler is the Bacula supplied script file.
- If you want to specify your own command, please look at the code of
- 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.
-
- If you do not set it, Bacula will expect there is always free space on the
- device.
-
- If you need to specify multiple commands, create a shell script.
-
\end{description}
%% This pulls in the Autochanger resource from another file.
\label{AutochangerResource1}
\input{autochangerres}
-
-
-
\section{Capabilities}
\index[general]{Capabilities}
\begin{description}
-\item [Label media = {\it yes\vb{}no}]
- \index[sd]{Label media}
- \index[sd]{Directive!Label media}
+\label{Storage:Device:LabelMedia}
+\item [Label Media = {\it yes\vb{}no}]
+ \index[general]{Label Media}
+ \index[sd]{Label Media}
+ \index[sd]{Directive!Label Media}
If {\bf Yes}, permits this device to automatically label blank media
without an explicit operator command. It does so by using an internal
algorithm as defined on the \ilink{Label Format}{Label} record in each
when the tape has been recycled. The automatic labeling feature is most
useful when writing to disk rather than tape volumes.
+\label{Storage:Device:AutomaticMount}
\item [Automatic mount = {\it yes\vb{}no}]
\index[sd]{Automatic mount}
\index[sd]{Directive!Automatic mount}
\index[general]{Resource!Messages}
\index[general]{Messages Resource}
-For a description of the Messages Resource, please see the
+For a description of the Messages Resource, please see the
\ilink{Messages Resource}{MessagesChapter} Chapter of this
-manual.
+manual.
\section{Sample Storage Daemon Configuration File}
\label{SampleConfiguration}
\index[general]{File!Sample Storage Daemon Configuration}
\index[general]{Sample Storage Daemon Configuration File}
-A example Storage Daemon configuration file might be the following:
+A example Storage Daemon configuration file might be the following:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
#
# Default Bacula Storage Daemon Configuration file
#
Device {
Name = Drive-1 #
- Drive Index = 0
+ Drive Index = 0
Media Type = DLT-8000
Archive Device = /dev/nst0
AutomaticMount = yes; # when device opened, read it
# RemovableMedia = no;
# AlwaysOpen = no;
#}
-#Device {
-# Name = "NEC ND-1300A"
-# Media Type = DVD
-# Archive Device = /dev/hda
-# LabelMedia = yes; # lets Bacula label unlabeled media
-# Random Access = Yes;
-# AutomaticMount = yes; # when device opened, read it
-# RemovableMedia = yes;
-# AlwaysOpen = no;
-# MaximumPartSize = 800M;
-# RequiresMount = yes;
-# MountPoint = /mnt/cdrom;
-# MountCommand = "/bin/mount -t iso9660 -o ro %a %m";
-# UnmountCommand = "/bin/umount %m";
-# SpoolDirectory = /tmp/backup;
-# 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
#
director = rufus-dir = all
operator = root = mount
}
-\end{verbatim}
+\end{lstlisting}
\normalsize