%%
%%
-\section*{Testing Your Tape Drive With Bacula}
-\label{_ChapterStart27}
+\chapter{Testing Your Tape Drive With Bacula}
+\label{TapeTestingChapter}
\index[general]{Testing Your Tape Drive With Bacula}
-\addcontentsline{toc}{section}{Testing Your Tape Drive With Bacula}
This chapter is concerned with testing and configuring your tape drive to make
sure that it will work properly with Bacula using the {\bf btape} program.
\label{summary}
-\subsection*{Summary of Steps to Take to Get Your Tape Drive Working}
-\index[general]{Working!Summary of Steps to Take to Get Your Tape Drive}
-\index[general]{Summary of Steps to Take to Get Your Tape Drive Working}
-\addcontentsline{toc}{subsection}{Summary of Steps to Take to Get Your Tape
-Drive Working}
+\section{Get Your Tape Drive Working}
In general, you should follow the following steps to get your tape drive to
work with Bacula. Start with a tape mounted in your drive. If you have an
one.
\begin{enumerate}
+\item Make sure that Bacula (the Storage daemon) is not running
+ or that you have {\bf unmount}ed the drive you will use
+ for testing.
+
\item Use tar to write to, then read from your drive:
\footnotesize
\end{verbatim}
\normalsize
-\item Make sure you have a valid and correct Device resource corresponding to
- your drive. For Linux users, generally, the default one works. For FreeBSD
- users, there are two possible Device configurations (see below).
+\item Make sure you have a valid and correct Device resource corresponding
+ to your drive. For Linux users, generally, the default one works. For
+ FreeBSD users, there are two possible Device configurations (see below).
+ For other drives and/or OSes, you will need to first ensure that your
+ system tape modes are properly setup (see below), then possibly modify
+ you Device resource depending on the output from the btape program (next
+ item). When doing this, you should consult the \ilink{Storage Daemon
+ Configuration}{StoredConfChapter} of this manual.
+
+\item If you are using a Fibre Channel to connect your tape drive to
+ Bacula, please be sure to disable any caching in the NSR (network
+ storage router, which is a Fibre Channel to SCSI converter).
+
\item Run the btape {\bf test} command:
\footnotesize
\end{verbatim}
\normalsize
-It isn't necessary to run the autochanger part of the test at this time, but
-do not go past this point until the basic test succeeds. If you do have
-an autochanger, please be sure to read the
-\ilink{Autochanger chapter}{_ChapterStart18} of this manual.
+ It isn't necessary to run the autochanger part of the test at this time,
+ but do not go past this point until the basic test succeeds. If you do
+ have an autochanger, please be sure to read the \ilink{Autochanger
+ chapter}{AutochangersChapter} of this manual.
\item Run the btape {\bf fill} command, preferably with two volumes. This
can take a long time. If you have an autochanger and it is configured, Bacula
will automatically use it. If you do not have it configured, you can manually
- issue the appopriate {\bf mtx} command, or press the autochanger buttons to
+ issue the appropriate {\bf mtx} command, or press the autochanger buttons to
change the tape when requested to do so.
+
\item FreeBSD users, if you have a pre-5.0 system run the {\bf tapetest}
program, and make sure your system is patched if necessary. The tapetest
program can be found in the platform/freebsd directory. The instructions
for its use are at the top of the file.
-\item Run Bacula, and backup a reasonably small directory, say 60 Megabytes.
- Do three successive backups of this directory.
-\item Stop Bacula, then restart it. Do another full backup of the same
- directory. Then stop and restart Bacula.
+
+\item Run Bacula, and backup a reasonably small directory, say 60
+ Megabytes. Do three successive backups of this directory.
+
+\item Stop Bacula, then restart it. Do another full backup of the same
+ directory. Then stop and restart Bacula.
+
\item Do a restore of the directory backed up, by entering the following
restore command, being careful to restore it to an alternate location:
+
\footnotesize
\begin{verbatim}
restore select all done
\end{verbatim}
\normalsize
-Do a {\bf diff} on the restored directory to ensure it is identical to the
-original directory.
+ Do a {\bf diff} on the restored directory to ensure it is identical to the
+ original directory. If you are going to backup multiple different systems
+ (Linux, Windows, Mac, Solaris, FreeBSD, ...), be sure you test the restore
+ on each system type.
+
\item If you have an autochanger, you should now go back to the btape program
and run the autochanger test:
\end{verbatim}
\normalsize
-Adjust your autochanger as necessary to ensure that it works correctly. See
-the Autochanger chapter of this manual for a complete discussion of testing
-your autochanger.
+ Adjust your autochanger as necessary to ensure that it works correctly. See
+ the Autochanger chapter of this manual for a complete discussion of testing
+ your autochanger.
+
+\item We strongly recommend that you use a dedicated SCSI
+ controller for your tape drives. Scanners are known to induce
+ serious problems with the SCSI bus, causing it to reset. If the
+ SCSI bus is reset while Bacula has the tape drive open, it will
+ most likely be fatal to your tape since the drive will rewind.
+ These kinds of problems show up in the system log. For example,
+ the following was most likely caused by a scanner:
+
+\footnotesize
+\begin{verbatim}
+Feb 14 17:29:55 epohost kernel: (scsi0:A:2:0): No or incomplete CDB sent to device.
+Feb 14 17:29:55 epohost kernel: scsi0: Issued Channel A Bus Reset. 1 SCBs aborted
+\end{verbatim}
+\normalsize
+
\end{enumerate}
If you have reached this point, you stand a good chance of having everything
completed. In particular, you may want to look at the
\ilink{ Tips for Resolving Problems}{problems1} section below.
+
\label{NoTapeInDrive}
-\subsubsection*{Problems When no Tape in Drive}
+\subsection{Problems When no Tape in Drive}
\index[general]{Problems When no Tape in Drive}
-\addcontentsline{toc}{subsubsection}{Problems When no Tape in Drive}
When Bacula was first written the Linux 2.4 kernel permitted opening the
drive whether or not there was a tape in the drive. Thus the Bacula code is
based on the concept that if the drive cannot be opened, there is a serious
problem, and the job is failed.
With version 2.6 of the Linux kernel, if there is no tape in the drive, the
-OS will wait 2 minutes (default) then return a failure, and consequently,
+OS will wait two minutes (default) and then return a failure, and consequently,
Bacula version 1.36 and below will fail the job. This is important to keep
-in mind, because if you use and option such as {\bf Offline on Unmount =
+in mind, because if you use an option such as {\bf Offline on Unmount =
yes}, there will be a point when there is no tape in the drive, and if
another job starts or if Bacula asks the operator to mount a tape, when
Bacula attempts to open the drive (about a 20 minute delay), it will fail
which will give you more time to mount the next tape before the job is
failed.
-\subsubsection*{Specifying the Configuration File}
+\subsection{Specifying the Configuration File}
\index[general]{File!Specifying the Configuration}
\index[general]{Specifying the Configuration File}
-\addcontentsline{toc}{subsubsection}{Specifying the Configuration File}
Starting with version 1.27, each of the tape utility programs including the
{\bf btape} program requires a valid Storage daemon configuration file
in the current directory, but you may specify a different configuration file
using the {\bf -c} option.
-\subsubsection*{Specifying a Device Name For a Tape}
+\subsection{Specifying a Device Name For a Tape}
\index[general]{Tape!Specifying a Device Name For a}
\index[general]{Specifying a Device Name For a Tape}
-\addcontentsline{toc}{subsubsection}{Specifying a Device Name For a Tape}
{\bf btape} {\bf device-name} where the Volume can be found. In the case of a
tape, this is the physical device name such as {\bf /dev/nst0} or {\bf
/dev/rmt/0ubn} depending on your system that you specify on the Archive Device
directive. For the program to work, it must find the identical name in the
Device resource of the configuration file. If the name is not found in the
-list of phsical names, the utility program will compare the name you entered
+list of physical names, the utility program will compare the name you entered
to the Device names (rather than the Archive device names).
When specifying a tape device, it is preferable that the "non-rewind"
See below for specifying Volume names.
-\subsubsection*{Specifying a Device Name For a File}
+\subsection{Specifying a Device Name For a File}
\index[general]{File!Specifying a Device Name For a}
\index[general]{Specifying a Device Name For a File}
-\addcontentsline{toc}{subsubsection}{Specifying a Device Name For a File}
If you are attempting to read or write an archive file rather than a tape, the
{\bf device-name} should be the full path to the archive location including
to the archive device name, and the filename is equivalent to the volume name.
-\subsection*{btape}
+\section{btape}
\label{btape1}
\index[general]{Btape}
-\addcontentsline{toc}{subsection}{btape}
This program permits a number of elementary tape operations via a tty command
interface. The {\bf test} command, described below, can be very useful for
\end{verbatim}
\normalsize
-\subsubsection*{Using btape to Verify your Tape Drive}
+\subsection{Using btape to Verify your Tape Drive}
\index[general]{Using btape to Verify your Tape Drive}
\index[general]{Drive!Using btape to Verify your Tape}
-\addcontentsline{toc}{subsubsection}{Using btape to Verify your Tape Drive}
An important reason for this program is to ensure that a Storage daemon
configuration file is defined so that Bacula will correctly read and write
For FreeBSD users, please see the notes below for doing further testing of
your tape drive.
-\subsubsection*{Linux SCSI Tricks}
+\label{SCSITricks}
+\subsection{Linux SCSI Tricks}
\index[general]{Tricks!Linux SCSI}
\index[general]{Linux SCSI Tricks}
-\addcontentsline{toc}{subsubsection}{Linux SCSI Tricks}
You can find out what SCSI devices you have by doing:
+\footnotesize
+\begin{verbatim}
+lsscsi
+\end{verbatim}
+\normalsize
+
+Typical output is:
+
+\footnotesize
+\begin{verbatim}
+[0:0:0:0] disk ATA ST3160812AS 3.AD /dev/sda
+[2:0:4:0] tape HP Ultrium 2-SCSI F6CH /dev/st0
+[2:0:5:0] tape HP Ultrium 2-SCSI F6CH /dev/st1
+[2:0:6:0] mediumx OVERLAND LXB 0107 -
+[2:0:9:0] tape HP Ultrium 1-SCSI E50H /dev/st2
+[2:0:10:0] mediumx OVERLAND LXB 0107 -
+\end{verbatim}
+\normalsize
+
+There are two drives in one autochanger: /dev/st0 and /dev/st1
+and a third tape drive at /dev/st2. For using them with Bacula, one
+would normally reference them as /dev/nst0 ... /dev/nst2. Not also,
+there are two different autochangers identified as "mediumx OVERLAND LXB".
+They can be addressed via their /dev/sgN designation, which can be
+obtained by counting from the beginning as 0 to each changer. In the
+above case, the two changers are located on /dev/sg3 and /dev/sg5. The one
+at /dev/sg3, controls drives /dev/nst0 and /dev/nst1; and the one at
+/dev/sg5 controles drive /dev/nst2.
+
+If you do not have the {\bf lsscsi} command, you can obtain the same
+information as follows:
+
\footnotesize
\begin{verbatim}
cat /proc/scsi/scsi
\end{verbatim}
\normalsize
-For example, I get the following:
+For the above example with the three drives and two autochangers,
+I get:
+
+\footnotesize
+\begin{verbatim}
+Attached devices:
+Host: scsi0 Channel: 00 Id: 00 Lun: 00
+ Vendor: ATA Model: ST3160812AS Rev: 3.AD
+ Type: Direct-Access ANSI SCSI revision: 05
+Host: scsi2 Channel: 00 Id: 04 Lun: 00
+ Vendor: HP Model: Ultrium 2-SCSI Rev: F6CH
+ Type: Sequential-Access ANSI SCSI revision: 03
+Host: scsi2 Channel: 00 Id: 05 Lun: 00
+ Vendor: HP Model: Ultrium 2-SCSI Rev: F6CH
+ Type: Sequential-Access ANSI SCSI revision: 03
+Host: scsi2 Channel: 00 Id: 06 Lun: 00
+ Vendor: OVERLAND Model: LXB Rev: 0107
+ Type: Medium Changer ANSI SCSI revision: 02
+Host: scsi2 Channel: 00 Id: 09 Lun: 00
+ Vendor: HP Model: Ultrium 1-SCSI Rev: E50H
+ Type: Sequential-Access ANSI SCSI revision: 03
+Host: scsi2 Channel: 00 Id: 10 Lun: 00
+ Vendor: OVERLAND Model: LXB Rev: 0107
+ Type: Medium Changer ANSI SCSI revision: 02
+\end{verbatim}
+\normalsize
+
+
+As an additional example, I get the following (on a different machine from the
+above example):
\footnotesize
\begin{verbatim}
\label{problems1}
-\subsection*{Tips for Resolving Problems}
+\section{Tips for Resolving Problems}
\index[general]{Problems!Tips for Resolving}
\index[general]{Tips for Resolving Problems}
-\addcontentsline{toc}{subsection}{Tips for Resolving Problems}
\label{CannotRestore}
-\subsubsection*{Bacula Saves But Cannot Restore Files}
+\subsection{Bacula Saves But Cannot Restore Files}
\index[general]{Files!Bacula Saves But Cannot Restore}
\index[general]{Bacula Saves But Cannot Restore Files}
-\addcontentsline{toc}{subsubsection}{Bacula Saves But Cannot Restore Files}
If you are getting error messages such as:
\end{verbatim}
\normalsize
-or whatever is appropriate on your system.
+or whatever is appropriate on your system. Note, if you are running a Linux
+system, and the above command does not work, it is most likely because you
+have not loaded the appropriate {\bf mt} package, which is often called
+{\bf mt\_st}, but may differ according to your distribution.
+
\item The second possibility, especially, if Bacula wrote while the drive was
in fixed block mode, is to turn off block positioning in Bacula. This is done
by adding:
\label{opendevice}
-\subsubsection*{Bacula Cannot Open the Device}
+\subsection{Bacula Cannot Open the Device}
\index[general]{Device!Bacula Cannot Open the}
\index[general]{Bacula Cannot Open the Device}
-\addcontentsline{toc}{subsubsection}{Bacula Cannot Open the Device}
If you get an error message such as:
for this tip.
\label{IncorrectFiles}
-\subsubsection*{Incorrect File Number}
+\subsection{Incorrect File Number}
\index[general]{Number!Incorrect File}
\index[general]{Incorrect File Number}
-\addcontentsline{toc}{subsubsection}{Incorrect File Number}
When Bacula moves to the end of the medium, it normally uses the {\bf
ioctl(MTEOM)} function. Then Bacula uses the {\bf ioctl(MTIOCGET)} function to
\end{itemize}
\label{IncorrectBlocks}
-\subsubsection*{Incorrect Number of Blocks or Positioning Errors during btape
-Testing}
-\index[general]{Testing!Incorrect Number of Blocks or Positioning Errors
-during btape}
-\index[general]{Incorrect Number of Blocks or Positioning Errors during btape
-Testing}
-\addcontentsline{toc}{subsubsection}{Incorrect Number of Blocks or Positioning
-Errors during btape Testing}
+\subsection{Incorrect Number of Blocks or Positioning Errors}
+\index[general]{Testing!Incorrect Number of Blocks or Positioning Errors}
+\index[general]{Incorrect Number of Blocks or Positioning Errors}
{\bf Bacula's} preferred method of working with tape drives (sequential
devices) is to run in variable block mode, and this is what is set by default.
To recover files from tapes written in fixed block mode, see below.
\label{TapeModes}
-\subsubsection*{Ensuring that the Tape Modes Are Properly Set -- {\bf Linux
+\subsection{Ensuring that the Tape Modes Are Properly Set -- {\bf Linux
Only}}
\index[general]{Ensuring that the Tape Modes Are Properly Set -- Linux Only}
-\index[general]{Only!Ensuring that the Tape Modes Are Properly Set -- Linux}
-\addcontentsline{toc}{subsubsection}{Ensuring that the Tape Modes Are Properly
-Set -- Linux Only}
If you have a modern SCSI tape drive and you are having problems with the {\bf
test} command as noted above, it may be that some program has set one or more
\end{verbatim}
\normalsize
+If you are running a Linux
+system, and the above command does not work, it is most likely because you
+have not loaded the appropriate {\bf mt} package, which is often called
+{\bf mt\_st}, but may differ according to your distribution.
+
If you would like to know what options you have set before making any of the
changes noted above, you can now view them on Linux systems, thanks to a tip
provided by Willem Riede. Do the following:
the other modes that Bacula needs to function properly.
\label{compression}
-\subsubsection*{Checking and Setting Tape Hardware Compression and Blocking
-Size}
-\index[general]{Checking and Setting Tape Hardware Compression and Blocking
-Size}
-\index[general]{Size!Checking and Setting Tape Hardware Compression and
-Blocking}
-\addcontentsline{toc}{subsubsection}{Checking and Setting Tape Hardware
-Compression and Blocking Size}
+\subsection{Tape Hardware Compression and Blocking Size}
+\index[general]{Tape Hardware Compression and Blocking Size}
+\index[general]{Size!Tape Hardware Compression and Blocking Size}
As far as I can tell, there is no way with the {\bf mt} program to check if
your tape hardware compression is turned on or off. You can, however, turn it
To recover files from tapes written in fixed block mode, see below.
\label{FreeBSDTapes}
-\subsubsection*{Tape Modes on FreeBSD}
+\subsection{Tape Modes on FreeBSD}
\index[general]{FreeBSD!Tape Modes on}
\index[general]{Tape Modes on FreeBSD}
-\addcontentsline{toc}{subsubsection}{Tape Modes on FreeBSD}
On most FreeBSD systems such as 4.9 and most tape drives, Bacula should run
with:
Fast Forward Space File = no
TWO EOF = yes
}
+
+The following Device resource works fine with Dell PowerVault 110T and
+120T devices on both FreeBSD 5.3 and on NetBSD 3.0. It also works
+with Sony AIT-2 drives on FreeBSD.
+\footnotesize
+\begin{verbatim}
+Device {
+ ...
+ # FreeBSD/NetBSD Specific Settings
+ Hardware End of Medium = no
+ BSF at EOM = yes
+ Backward Space Record = no
+ Fast Forward Space File = yes
+ TWO EOF = yes
+}
\end{verbatim}
\normalsize
+On FreeBSD version 6.0, it is reported that you can even set
+Backward Space Record = yes.
-\subsubsection*{Finding your Tape Drives and Autochangers on FreeBSD}
-\index[general]{FreeBSD!Finding your Tape Drives and Autochangers}
-\index[general]{Finding your Tape Drives and Autochangers on FreeBSD}
-\addcontentsline{toc}{subsubsection}{Finding your Tape Drives and
-Autochangers on FreeBSD}
+
+
+\subsection{Finding your Tape Drives and Autochangers on FreeBSD}
+\index[general]{FreeBSD!Finding Tape Drives and Autochangers}
+\index[general]{Finding Tape Drives and Autochangers on FreeBSD}
On FreeBSD, you can do a {\bf camcontrol devlist} as root to determine what
drives and autochangers you have. For example,
\label{onstream}
-\subsubsection*{Using the OnStream driver on Linux Systems}
+\subsection{Using the OnStream driver on Linux Systems}
\index[general]{Using the OnStream driver on Linux Systems}
\index[general]{Systems!Using the OnStream driver on Linux}
-\addcontentsline{toc}{subsubsection}{Using the OnStream driver on Linux
-Systems}
Bacula version 1.33 (not 1.32x) is now working and ready for testing with the
OnStream kernel osst driver version 0.9.14 or above. Osst is available from:
\end{verbatim}
\normalsize
-\subsection*{Hardware Compresson on EXB-8900}
+\section{Hardware Compression on EXB-8900}
\index[general]{Hardware Compression on EXB-8900}
\index[general]{EXB-8900!Hardware Compression}
-\addcontentsline{to}{subsection}{Hardware Compression on EXB-8900}
+
To active, check, or disable the hardware compression feature
on an EXB-8900, use the exabyte MammothTool. You can get it here:
\elink{http://www.exabyte.com/support/online/downloads/index.cfm}
{http://www.exabyte.com/support/online/downloads/index.cfm}.
-There is a solaris version of this tool. With option -C 0 or 1 you
+There is a Solaris version of this tool. With option -C 0 or 1 you
can disable or activate compression. Start this tool without any
options for a small reference.
\label{fill}
-\subsubsection*{Using btape to Simulate Filling a Tape}
+\subsection{Using btape to Simulate Filling a Tape}
\index[general]{Using btape to Simulate Filling a Tape}
-\index[general]{Tape!Using btape to Simulate Filling a}
-\addcontentsline{toc}{subsubsection}{Using btape to Simulate Filling a
-Tape}
+\index[general]{Tape!Using btape to Simulate Filling}
Because there are often problems with certain tape drives or systems when end
of tape conditions occur, {\bf btape} has a special command {\bf fill} that
Bacula.
\label{RecoveringFiles}
-\subsection*{Recovering Files Written to Tape With Fixed Block Sizes}
-\index[general]{Recovering Files Written to Tape With Fixed Block Sizes}
-\index[general]{Sizes!Recovering Files Written to Tape With Fixed Block}
-\addcontentsline{toc}{subsection}{Recovering Files Written to Tape With Fixed
-Block Sizes}
+\section{Recovering Files Written With Fixed Block Sizes}
+\index[general]{Recovering Files Written With Fixed Block Sizes}
If you have been previously running your tape drive in fixed block mode
(default 512) and Bacula with variable blocks (default), then in version
your files.
\label{BlockModes}
-\subsection*{Tape Blocking Modes}
+\section{Tape Blocking Modes}
\index[general]{Modes!Tape Blocking}
\index[general]{Tape Blocking Modes}
-\addcontentsline{toc}{subsection}{Tape Blocking Modes}
SCSI tapes may either be written in {\bf variable} or {\bf fixed} block sizes.
Newer drives support both modes, but some drives such as the QIC devices
sequentially recover each of the blocks it has written by using the same
number of sequential reads as it had written.
-\subsection*{Details of Tape Modes}
+\section{Details of Tape Modes}
\index[general]{Modes!Details}
\index[general]{Details of Tape Modes}
-\addcontentsline{toc}{subsection}{Details of Tape Modes}
Rudolf Cejka has provided the following information concerning
certain tape modes and MTEOM.
skipped. File number is always tracked for MTEOM.
Linux does support both SCSI SPACE Filemarks and End-of-data: When MTEOM
- is called in MT_ST_FAST_MTEOM mode, SCSI SPACE End-of-data is used.
+ is called in MT\_ST\_FAST\_MTEOM mode, SCSI SPACE End-of-data is used.
In the other case, SCSI SPACE Filemarks with count =
8388607 is used.
There is no real slow mode like in Solaris - I just expect, that for
older tape drives Filemarks may be slower than End-of-data, but not so
much as in Solaris slow mode. File number is tracked for MTEOM just
- without MT_ST_FAST_MTEOM - when MT_ST_FAST_MTEOM is used, it is not.
+ without MT\_ST\_FAST\_MTEOM - when MT\_ST\_FAST\_MTEOM is used, it is not.
FreeBSD does support both SCSI SPACE Filemarks and End-of-data, but when
MTEOD (MTEOM) is called, SCSI SPACE End-of-data is always used. FreeBSD
When I set {\bf Hardware End of Medium = no}
and {\bf Fast Forward Space File = no}
file positioning was very slow
- on my LTO-3 (about 10 to 100 minutes), but
+ on my LTO-3 (about ten to 100 minutes), but
with {\bf Hardware End of Medium = no} and
-{\bf Fast Forward Space File = yes}, the time is 10 to
-100 times faster (about 1 to 2 minutes).
+{\bf Fast Forward Space File = yes}, the time is ten to
+100 times faster (about one to two minutes).
\end{description}
-\subsection*{Autochanger Errors}
+\section{Autochanger Errors}
\index[general]{Errors!Autochanger}
\index[general]{Autochanger Errors}
-\addcontentsline{toc}{subsection}{Autochanger Errors}
If you are getting errors such as:
SCSI disk drives (including SATA drives), you might want to change
the permissions on /dev/sg*.
-\subsection*{Syslog Errors}
+\section{Syslog Errors}
\index[general]{Errors!Syslog}
\index[general]{Syslog Errors}
-\addcontentsline{toc}{subsection}{Syslog Errors}
If you are getting errors such as:
described earlier in this manual. If you are running your Storage daemon
as root, you should not be getting these system log messages, and if
you are, something is probably wrong.
-