From c0c5e6425857039416cee95e540d3061d3408254 Mon Sep 17 00:00:00 2001 From: Thomas Glatthor Date: Tue, 14 Aug 2007 20:19:58 +0000 Subject: [PATCH] work in progress --- docs/manual-de/autochangers.tex | 250 +++++++++++++++++--------------- 1 file changed, 137 insertions(+), 113 deletions(-) diff --git a/docs/manual-de/autochangers.tex b/docs/manual-de/autochangers.tex index e05fb068..d76dafa6 100644 --- a/docs/manual-de/autochangers.tex +++ b/docs/manual-de/autochangers.tex @@ -1,52 +1,54 @@ %% %% -\section*{Autochanger Support} -\label{_ChapterStart18} -\index[general]{Support!Autochanger } -\index[general]{Autochanger Support } -\addcontentsline{toc}{section}{Autochanger Support} +\chapter{Autochanger Unterst\"{u}tzung} +\label{AutochangersChapter} +\index[general]{Unterst\"{u}tzung!Autochanger } +\index[general]{Autochanger Unterst\"{u}tzung } -\subsection*{Autochangers -- General} -\index[general]{General!Autochangers -- } -\index[general]{Autochangers -- General } -\addcontentsline{toc}{subsection}{Autochangers -- General} - -Bacula provides autochanger support for reading and writing tapes. In -order to work with an autochanger, Bacula requires three things, each of -which is explained in more detail after this list: +Bacula unterst\"{u}tzt Autochanger zum Lesen und Schreiben von Tapes. +Damit Bacula mit einem Autochanger arbeiten kann, muss eine Nummer von +Voraussetzungen erf\"{u}llt sein, die Details werden im folgenden gekl\"{a}rt. \begin{itemize} -\item A script that actually controls the autochanger according to commands - sent by Bacula. We furnish such a script that works with {\bf mtx} found in - the {\bf depkgs} distribution. This script works only with single drive - autochangers. -\item That each Volume (tape) to be used must be defined in the Catalog and - have a Slot number assigned to it so that Bacula knows where the Volume is in - the autochanger. This is generally done with the {\bf label} command. See - below for more details. You must pre-label the tapes manually before - using them. -\item Modifications to your Storage daemon's Device configuration resource to - identify that the device is a changer, as well as a few other parameters. -\item You should also modify your Storage resource definition in the - Director's configuration file so that you are automatically prompted for the - Slot when labeling a Volume. -\item You need to ensure that your Storage daemon (if not running as root) - has access permissions to both the tape drive and the control device. -\item You need to have {\bf Autochanger = yes} in your Storage resource - in your bacula-dir.conf file so that you will be prompted for the - slot number when you label Volumes. +\item Ein Script das den Autochanger, gem\"{a}{\ss} den von Bacula gesendeten Kommandos, steuert. + Bacula stellt solch ein Script in der {\bf depkgs} Distribution zur Verf\"{u}gung. + ==obsolete== This script works only with single drive autochangers. + +\item Jedes Volume (Tape) das benutzt wird, muss sowohl im Katalog definiert sein, + als auch eine Slotnummer zugeteilt sein, nur so kann Bacula wissen, welches Volume + aktuell im Autochanger verf\"{u}gbar ist. + Normalerweise wird das mittels des {\bf label} Kommandos erreicht, + weiter unten wird genauer darauf eingegangen. + Volumes m\"{u}ssen manuell gelabelt werden, bevor sie benutzt werden k\"{o}nnen. + +\item Die Konfigurationsdateien des Storage-Dienstes m\"{u}ssen angepasst werden, + damit Device-Eintr\"{a}ge Autochangern zugeordnet werden k\"{o}nnen, + sowie einige Parameter mehr. + +\item Sie sollten auch die Storage-Definitionen in der Director-Dienst-Konfiguration anpassen, + so dass automatisch nachgefragt wird, welcher Slot genutzt werden soll, wenn ein Volume gelabelt wird. + +\item Sie m\"{u}ssen sicherstellen, dass der Storage-Dienst (wenn er nicht als root ausgef\"{u}hrt wird) + Zugriffsrechte auf die Laufwerks- und auf das Autochanger-Kontroll-Device hat. + +\item Sie m\"{u}ssen {\bf Autochanger = yes} in der Storage-Definitionen des Director-Dienstes setzen, + damit nach dem Slot gefragt wird wenn Sie Volumes labeln. \end{itemize} -In version 1.37, there is a new \ilink{Autochanger +In version 1.37 und sp\"{a}ter, gibt es eine neue \ilink{Autochanger-Konfiguration}{AutochangerRes} +die erlaubt, bestimmte Device-Eintr\"{a}ge zu gruppieren um einen Autochanger mit mehrfachen Laufwerken +zu konfigurieren. + +In version 1.37 and later, there is a new \ilink{Autochanger resource}{AutochangerRes} that permits you to group Device resources thus -creating a multi-drive autochanger. If you have a multi-drive autochanger, -you must use this new resource. If you have a single drive autochanger, -it is recommended, but not required. +creating a multi-drive autochanger. If you have an autochanger, +you must use this new resource. Bacula uses its own {\bf mtx-changer} script to interface with a program that actually does the tape changing. Thus in principle, {\bf mtx-changer} -can be adapted to function with any autochanger program. The current +can be adapted to function with any autochanger program, or you can +call any other script or program. The current version of {\bf mtx-changer} works with the {\bf mtx} program. However, FreeBSD users have provided a script in the {\bf examples/autochangers} directory that allows Bacula to use the {\bf chio} program. @@ -67,10 +69,10 @@ In principle, if {\bf mtx} will operate your changer correctly, then it is just a question of adapting the {\bf mtx-changer} script (or selecting one already adapted) for proper interfacing. You can find a list of autochangers supported by {\bf mtx} at the following link: -\elink{http://mtx.badtux.net/compatibility.php} -{http://mtx.badtux.net/compatibility.php}. +\elink{http://mtx.opensource-sw.net/compatibility.php} +{http://mtx.opensource-sw.net/compatibility.php}. The home page for the {\bf mtx} project can be found at: -\elink{http://mtx.badtux.net/}{http://mtx.badtux.net/}. +\elink{http://mtx.opensource-sw.net/}{http://mtx.opensource-sw.net/}. If you are having troubles, please use the {\bf auto} command in the {\bf btape} program to test the functioning of your autochanger with Bacula. When @@ -80,12 +82,11 @@ root.root}, so you will need to ensure that the Storage daemon has sufficient permissions to access the autochanger. \label{SCSI devices} -\subsection*{Knowing What SCSI Devices You Have} +\section{Knowing What SCSI Devices You Have} \index[general]{Have!Knowing What SCSI Devices You } \index[general]{Knowing What SCSI Devices You Have } \index[general]{SCSI devices} \index[general]{devices!SCSI} -\addcontentsline{toc}{subsection}{Knowing What SCSI Devices You Have} Under Linux, you can @@ -107,6 +108,10 @@ to find out how to specify their control address ({\bf /dev/sg0} for the first, {\bf /dev/sg1} for the second, ...) on the {\bf Changer Device = } Bacula directive. +For more detailed information on what SCSI devices you have please see +the \ilink{Linux SCSI Tricks}{SCSITricks} section of the Tape Testing +chapter of this manual. + Under FreeBSD, you can use: \footnotesize @@ -122,10 +127,10 @@ Please check that your Storage daemon has permission to access this device. The following tip for FreeBSD users comes from Danny Butroyd: -n reboot bacula will NOT have permissions to +on reboot Bacula will NOT have permission to control the device /dev/pass0 (assuming this is your changer device). To get around this just edit the /etc/devfs.conf file and add the -following to the bottom of the config file: +following to the bottom: \footnotesize \begin{verbatim} own pass0 root:bacula @@ -134,21 +139,20 @@ own nsa0.0 root:bacula perm nsa0.0 0666 \end{verbatim} \normalsize -I have given the bacula group permission to write to the nsa0.0 device + +This gives the bacula group permission to write to the nsa0.0 device too just to be on the safe side. To bring these changes into effect just run:- /etc/rc.d/devfs restart -Basically this will stop you having to change permissions on these -devices to make bacula work when operating the AutoChanger after a reboot. +Basically this will stop you having to manually change permissions on these +devices to make Bacula work when operating the AutoChanger after a reboot. \label{scripts} - -\subsection*{Example Scripts} +\section{Example Scripts} \index[general]{Scripts!Example } \index[general]{Example Scripts } -\addcontentsline{toc}{subsection}{Example Scripts} Please read the sections below so that you understand how autochangers work with Bacula. Although we supply a default {\bf mtx-changer} script, your @@ -161,9 +165,8 @@ autochangers. \label{Slots} -\subsection*{Slots} +\section{Slots} \index[general]{Slots } -\addcontentsline{toc}{subsection}{Slots} To properly address autochangers, Bacula must know which Volume is in each {\bf slot} of the autochanger. Slots are where the changer cartridges reside @@ -189,14 +192,12 @@ list Volumes in the Console program. \label{mult} -\subsection*{Multiple Devices} -\index[general]{Devices!Multiple } -\index[general]{Multiple Devices } -\addcontentsline{toc}{subsection}{Multiple Devices} +\section{Multiple Devices} +\index[general]{Devices!Multiple} +\index[general]{Multiple Devices} Some autochangers have more than one read/write device (drive). The -new -\ilink{Autochanger resource}{AutochangerRes} introduced in version +new \ilink{Autochanger resource}{AutochangerRes} introduced in version 1.37 permits you to group Device resources, where each device represents a drive. The Director may still reference the Devices (drives) directly, but doing so, bypasses the proper functioning of the @@ -215,11 +216,18 @@ that device. In general, the second device will have the same {\bf Changer Device} (control channel) as the first drive, but a different {\bf Archive Device}. +As a default, Bacula jobs will prefer to write to a Volume that is +already mounted. If you have a multiple drive autochanger and you want +Bacula to write to more than one Volume in the same Pool at the same +time, you will need to set \ilink{Prefer Mounted Volumes} {PreferMountedVolumes} +in the Directors Job resource to {\bf no}. This will cause +the Storage daemon to maximize the use of drives. + + \label{ConfigRecords} -\subsection*{Device Configuration Records} +\section{Device Configuration Records} \index[general]{Records!Device Configuration } \index[general]{Device Configuration Records } -\addcontentsline{toc}{subsection}{Device Configuration Records} Configuration of autochangers within Bacula is done in the Device resource of the Storage daemon. Four records: {\bf Autochanger}, {\bf Changer Device}, @@ -331,10 +339,9 @@ define an Autochanger resource. \input{autochangerres} \label{example} -\subsection*{An Example Configuration File} +\section{An Example Configuration File} \index[general]{Example Configuration File } \index[general]{File!Example Configuration } -\addcontentsline{toc}{subsection}{Example Configuration File} The following two resources implement an autochanger: @@ -355,7 +362,6 @@ Device { LabelMedia = no; AutomaticMount = yes; AlwaysOpen = yes; - Mount Anonymous Volumes = no; } \end{verbatim} \normalsize @@ -364,9 +370,8 @@ where you will adapt the {\bf Archive Device}, the {\bf Changer Device}, and the path to the {\bf Changer Command} to correspond to the values used on your system. -\subsection*{A Multi-drive Example Configuration File} +\section{A Multi-drive Example Configuration File} \index[general]{Multi-drive Example Configuration File } -\addcontentsline{toc}{subsection}{A Multi-drive Example Configuration File} The following resources implement a multi-drive autochanger: @@ -388,7 +393,6 @@ Device { LabelMedia = no; AutomaticMount = yes; AlwaysOpen = yes; - Mount Anonymous Volumes = no; } Device { @@ -400,7 +404,6 @@ Device { LabelMedia = no; AutomaticMount = yes; AlwaysOpen = yes; - Mount Anonymous Volumes = no; } \end{verbatim} @@ -411,10 +414,9 @@ the path to the {\bf Changer Command} to correspond to the values used on your system. \label{SpecifyingSlots} -\subsection*{Specifying Slots When Labeling} +\section{Specifying Slots When Labeling} \index[general]{Specifying Slots When Labeling } \index[general]{Labeling!Specifying Slots When } -\addcontentsline{toc}{subsection}{Specifying Slots When Labeling} If you add an {\bf Autochanger = yes} record to the Storage resource in your Director's configuration file, the Bacula Console will automatically prompt @@ -464,12 +466,30 @@ Pool { Any slot containing a barcode of CLNxxxx will be treated as a cleaning tape and will not be mounted. -\label{Magazines} +\section{Changing Cartridges} +\index[general]{Changing Cartridges } +If you wish to insert or remove cartridges in your autochanger or +you manually run the {\bf mtx} program, you must first tell Bacula +to release the autochanger by doing: + +\footnotesize +\begin{verbatim} +unmount +(change cartridges and/or run mtx) +mount +\end{verbatim} +\normalsize + +If you do not do the unmount before making such a change, Bacula +will become completely confused about what is in the autochanger +and may stop function because it expects to have exclusive use +of the autochanger while it has the drive mounted. + -\subsection*{Dealing with Multiple Magazines} +\label{Magazines} +\section{Dealing with Multiple Magazines} \index[general]{Dealing with Multiple Magazines } \index[general]{Magazines!Dealing with Multiple } -\addcontentsline{toc}{subsection}{Dealing with Multiple Magazines} If you have several magazines or if you insert or remove cartridges from a magazine, you should notify Bacula of this. By doing so, Bacula will as @@ -483,7 +503,11 @@ remove a cartridge from the magazine, simply do \footnotesize \begin{verbatim} +unmount +(remove magazine) +(insert new magazine) update slots +mount \end{verbatim} \normalsize @@ -502,9 +526,10 @@ alternatives. \begin{enumerate} \item You can manually set the Slot and InChanger flag using the {\bf update volume} command in the Console (quite painful). + \item You can issue a - \footnotesize +\footnotesize \begin{verbatim} update slots scan \end{verbatim} @@ -514,16 +539,15 @@ update slots scan the magazine in turn and update the information (Slot, InChanger flag) in the catalog. This is quite effective but does take time to load each cartridge into the drive in turn and read the Volume label. + \item You can modify the mtx-changer script so that it simulates an autochanger with barcodes. See below for more details. - \end{enumerate} +\end{enumerate} \label{simulating} - -\subsection*{Simulating Barcodes in your Autochanger} +\section{Simulating Barcodes in your Autochanger} \index[general]{Autochanger!Simulating Barcodes in your } \index[general]{Simulating Barcodes in your Autochanger } -\addcontentsline{toc}{subsection}{Simulating Barcodes in your Autochanger} You can simulate barcodes in your autochanger by making the {\bf mtx-changer} script return the same information that an autochanger with barcodes would do. @@ -567,10 +591,9 @@ put the correct data in the file, then run the {\bf update slots} command, and your autochanger will appear to Bacula to be an autochanger with barcodes. \label{updateslots} -\subsection*{The Full Form of the Update Slots Command} +\section{The Full Form of the Update Slots Command} \index[general]{Full Form of the Update Slots Command } \index[general]{Command!Full Form of the Update Slots } -\addcontentsline{toc}{subsection}{Full Form of the Update Slots Command} If you change only one cartridge in the magazine, you may not want to scan all Volumes, so the {\bf update slots} command (as well as the {\bf update slots @@ -613,10 +636,9 @@ not modified the mtx-changer script as described above, the above command will not find any Volume names so will do nothing. \label{FreeBSD} -\subsection*{FreeBSD Issues} +\section{FreeBSD Issues} \index[general]{Issues!FreeBSD } \index[general]{FreeBSD Issues } -\addcontentsline{toc}{subsection}{FreeBSD Issues} If you are having problems on FreeBSD when Bacula tries to select a tape, and the message is {\bf Device not configured}, this is because FreeBSD has made @@ -632,11 +654,10 @@ Please see the autochanger testing. \label{AutochangerTesting} -\subsection*{Testing the Autochanger and Adapting Your mtx-changer Script} -\index[general]{Testing the Autochanger and Adapting Your mtx-changer Script } -\index[general]{Script!Testing the Autochanger and Adapting Your mtx-changer } -\addcontentsline{toc}{subsection}{Testing the Autochanger and Adapting Your -mtx-changer Script} +\section{Testing Autochanger and Adapting mtx-changer script} +\index[general]{Testing the Autochanger } +\index[general]{Adapting Your mtx-changer script} + Before attempting to use the autochanger with Bacula, it is preferable to "hand-test" that the changer works. To do so, we suggest you do the @@ -646,11 +667,10 @@ following commands (assuming that the {\bf mtx-changer} script is installed in \begin{description} \item [Make sure Bacula is not running.] - \index[sd]{Make sure Bacula is not running. } \item [/etc/bacula/mtx-changer \ /dev/sg0 \ list \ 0 \ /dev/nst0 \ 0] - \index[sd]{/etc/bacula/mtx-changer \ /dev/sg0 \ list \ 0 \ /dev/nst0 \ 0 - } +\index[sd]{mtx-changer list} + This command should print: \footnotesize @@ -670,29 +690,36 @@ you must resolve the problem (e.g. try a different SCSI control device name if {\bf /dev/sg0} is incorrect. For example, on FreeBSD systems, the autochanger SCSI control device is generally {\bf /dev/pass2}. -\item [/etc/bacula/mtx-changer \ /dev/sg0 \ slots \ 0 \ /dev/nst0 \ 0] - \index[sd]{/etc/bacula/mtx-changer \ /dev/sg0 \ slots \ 0 \ /dev/nst0 \ 0 - } +\item [/etc/bacula/mtx-changer \ /dev/sg0 \ slots ] +\index[sd]{mtx-changer slots} + This command should return the number of slots in your autochanger. -\item [/etc/bacula/mtx-changer \ /dev/sg0 \ unload \ ] - \index[sd]{/etc/bacula/mtx-changer \ /dev/sg0 \ unload \ } - If a tape is loaded, this should cause it to be unloaded. +\item [/etc/bacula/mtx-changer \ /dev/sg0 \ unload \ 1 \ /dev/nst0 \ 0 ] +\index[sd]{mtx-changer unload} + + If a tape is loaded from slot 1, this should cause it to be unloaded. \item [/etc/bacula/mtx-changer \ /dev/sg0 \ load \ 3 \ /dev/nst0 \ 0 ] - \index[sd]{/etc/bacula/mtx-changer \ /dev/sg0 \ load \ 3 \ /dev/nst0 \ 0 - } -Assuming you have a tape in slot 3, it will be loaded into the read slot (0). +\index[sd]{mtx-changer load} + +Assuming you have a tape in slot 3, it will be loaded into drive (0). \item [/etc/bacula/mtx-changer \ /dev/sg0 \ loaded \ 0 \ /dev/nst0 \ 0] - \index[sd]{/etc/bacula/mtx-changer \ /dev/sg0 \ loaded \ 0 \ /dev/nst0 \ - 0 } +\index[sd]{mtx-changer loaded} + It should print "3" +Note, we have used an "illegal" slot number 0. In this case, it is simply +ignored because the slot number is not used. However, it must be specified +because the drive parameter at the end of the command is needed to select +the correct drive. + +\item [/etc/bacula/mtx-changer \ /dev/sg0 \ unload \ 3 /dev/nst0 \ 0] -\item [/etc/bacula/mtx-changer \ /dev/sg0 \ unload] - \index[sd]{/etc/bacula/mtx-changer \ /dev/sg0 \ unload } - \end{description} +will unload the tape into slot 3. + +\end{description} Once all the above commands work correctly, assuming that you have the right {\bf Changer Command} in your configuration, Bacula should be able to operate @@ -711,8 +738,8 @@ commands into a file and running it as a script: \footnotesize \begin{verbatim} #!/bin/sh -/etc/bacula/mtx-changer /dev/sg0 unload -/etc/bacula/mtx-changer /dev/sg0 load 3 +/etc/bacula/mtx-changer /dev/sg0 unload 1 /dev/nst0 0 +/etc/bacula/mtx-changer /dev/sg0 load 3 /dev/nst0 0 mt -f /dev/st0 rewind mt -f /dev/st0 weof \end{verbatim} @@ -733,9 +760,9 @@ unload so that the script looks like: \footnotesize \begin{verbatim} #!/bin/sh -/etc/bacula/mtx-changer /dev/sg0 unload +/etc/bacula/mtx-changer /dev/sg0 unload 1 /dev/nst0 0 mt -f /dev/st0 offline -/etc/bacula/mtx-changer /dev/sg0 load 3 +/etc/bacula/mtx-changer /dev/sg0 load 3 /dev/nst0 0 mt -f /dev/st0 rewind mt -f /dev/st0 weof \end{verbatim} @@ -756,10 +783,9 @@ Bacula after a load command has been completed. \label{using} -\subsection*{Using the Autochanger} +\section{Using the Autochanger} \index[general]{Using the Autochanger } \index[general]{Autochanger!Using the } -\addcontentsline{toc}{subsection}{Using the Autochanger} Let's assume that you have properly defined the necessary Storage daemon Device records, and you have added the {\bf Autochanger = yes} record to the @@ -865,10 +891,9 @@ Select the Pool (1-2): 1 \label{Barcodes} -\subsection*{Barcode Support} +\section{Barcode Support} \index[general]{Support!Barcode } \index[general]{Barcode Support } -\addcontentsline{toc}{subsection}{Barcode Support} Bacula provides barcode support with two Console commands, {\bf label barcodes} and {\bf update slots}. @@ -893,10 +918,9 @@ prevent Bacula from attempting to write on the Volume. \label{interface} -\subsection*{Bacula Autochanger Interface} +\section{Bacula Autochanger Interface} \index[general]{Interface!Bacula Autochanger } \index[general]{Bacula Autochanger Interface } -\addcontentsline{toc}{subsection}{Bacula Autochanger Interface} Bacula calls the autochanger script that you specify on the {\bf Changer Device} statement. Normally this script will be the {\bf mtx-changer} script -- 2.39.5