]> git.sur5r.net Git - bacula/docs/blobdiff - docs/manual/tapetesting.tex
work in progress
[bacula/docs] / docs / manual / tapetesting.tex
index 1c859b9bb73365234c28b1d2024abddb7b8a0529..7281f34e2f098a191264df9b50cf1129c0ceab1f 100644 (file)
@@ -20,6 +20,10 @@ Do not proceed to the next item until you have succeeded with the previous
 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
@@ -32,9 +36,18 @@ one.
 \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:  
 
@@ -46,10 +59,10 @@ one.
 \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}{AutochangersChapter} 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
@@ -62,15 +75,16 @@ an autochanger, please be sure to read the
    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 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 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
@@ -79,10 +93,10 @@ an autochanger, please be sure to read the
 \end{verbatim}
 \normalsize
 
-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.
+   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:  
@@ -95,9 +109,25 @@ on each system type.
 \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
@@ -107,6 +137,7 @@ bacula-users} email list, but specify which of the steps you have successfully
 completed. In particular, you may want to look at the 
 \ilink{ Tips for Resolving Problems}{problems1} section below. 
 
+
 \label{NoTapeInDrive}
 \subsection{Problems When no Tape in Drive}
 \index[general]{Problems When no Tape in Drive}
@@ -322,19 +353,81 @@ See the section above on setting your {\bf Archive device} correctly.
 For FreeBSD users, please see the notes below for doing further testing of
 your tape drive. 
 
+\label{SCSITricks}
 \subsection{Linux SCSI Tricks}
 \index[general]{Tricks!Linux SCSI}
 \index[general]{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}