]> git.sur5r.net Git - bacula/docs/blob - docs/manual-fr/storedconf.tex
Mises a jour.
[bacula/docs] / docs / manual-fr / storedconf.tex
1 %%
2 %%
3
4 \section*{Configuration du Storage Daemon}
5 \label{_ChapterStart31}
6 \index[general]{Configuration du Storage Daemon}
7 \index[general]{Configuration!Storage Daemon}
8 \addcontentsline{toc}{section}{Configuration du Storage Daemon}
9
10 \subsection*{General}
11 \index[general]{General}
12 \addcontentsline{toc}{subsection}{General}
13 Le fichier de configuration du Storage Daemon a relativement peu de d\'efinitions 
14 de resources. Cependant, en raison du nombre pl\'ethorique de media et de syst\`emes, 
15 il doit \^etre hautement param\'etrable. Par cons\'equent, il existe un nombre assez important 
16 de directives dans la d\'eficnition de ressource Devices qui vous permet de d\'efinir 
17 toutes les caract\'eristiques de votre p\'eriph\'erique de stockage. Heureusement, avec les 
18 mat\'eriels modernes, les valeurs par d\'efaut sont g\'en\'eralement suffisantes, et tr\`es 
19 peu de directives sont r\'eellement indispensables.
20
21 Des exemples de directives de ressources device connues pour fonctionner pour 
22 beaucoup de lecteurs de bandes communs peuvent \^etre trouv\'es dans le r\'epertoire : 
23 \lt{}bacula-src\gt{}/examples/devices}. La plupart seront \'enum\'er\'es ici.
24
25 Pour une discussion g\'en\'erale concernant les fichiers de configuration de Bacula, 
26 les ressources et les types de donn\'ees reconnus, veuillez consulter le 
27 chapitre \ilink{Configuration}{_ChapterStart16} de ce manuel. Les d\'efinitions de 
28 ressources Storage suivantes doivent \^etre d\'efinies :
29
30 \begin{itemize}
31 \item 
32    \ilink{Storage}{StorageResource} -- Pour d\'efinir le nom du Storage Daemon.
33 \item 
34    \ilink{Director}{DirectorResource1} -- Pour d\'efinir le nom du Director et le mot 
35    de passe permettant d'y acc\'eder.
36 \item 
37    \ilink{Device}{DeviceResource} -- Pour d\'efinir les caract\'eristiques de votre 
38    p\'eriph\'erique de stockage.
39 \item 
40    \ilink{Messages}{_ChapterStart15} -- Pour d\'efinir o\`u les messages d'erreurs 
41    et d'information doivent \^etre exp\'edi\'es.
42 \end{itemize}
43
44 \subsection*{Ressource Storage}
45 \label{StorageResource}
46 \index[general]{Ressource!Storage}
47 \index[general]{Ressource Sorage}
48 \addcontentsline{toc}{subsection}{Ressource Storage}
49
50 En g\'en\'eral, les propri\'et\'es sp\'ecifi\'ees au niveau de la ressource Storage d\'efinissent 
51 des propri\'et\'es globales du Storage Daemon. Chaque fichier de configuration de 
52 Storage Daemon doit avoir sa propre d\'efinition de ressource Storage.
53
54 \begin{description}
55
56 \item [Name = \lt{}Storage-Daemon-Name\gt{}]
57    \index[sd]{Name}
58    \index[sd]{Directive!Name}
59    Sp\'ecifie le nom du Storage Daemon. Cette directive est requise.
60 \item [Working Directory = \lt{}R\'epertoire\gt{}]
61    \index[sd]{Working Directory}
62    \index[sd]{Directive!Working Directory}
63    Cette directive sp\'ecifie un r\'epertoire o\`u le Storage Daemon peut placer ses fichiers 
64    d'\'etat. Ce r\'epertoire ne devrait \^etre utilis\'e que par Bacula, mais peut \^etre 
65    partag\'e par d'autres daemons Bacula, pourvu que les noms donn\'es \`a chaque daemon 
66    soient uniques. Cette directive est requise.
67
68 \item [Pid Directory = \lt{}R\'epertoire\gt{}]
69    \index[sd]{Pid Directory}
70    \index[sd]{Directive!Pid Directory}
71       Cette directive sp\'ecifie un r\'epertoire o\`u le Storage Daemon peut d\'eposer son fichier
72 d'Id de processus. Ce fichier est utilis\'e pour stopper Bacula et pr\'evenir l'ex\'ecution
73 simultan\'ee de plusieurs copies de Bacula. Les substitutions shell standard sont
74 effectu\'ees \`a la lecture du fichier de configuration, de sorte que des valeurs
75 telles que {\bf \$HOME} seront correctement substitu\'ees. 
76    
77 Typiquement, sur les syst\`emes Linux, vous utiliserez ici {\bf /var/run}. Si vous
78 n'installez pas Bacula dans les r\'epertoires syst\`eme, vous pouvez utiliser le
79 r\'epertoire de travail {\bf Working Directory} d\'efini plus haut.
80 Cette directive est requise.
81
82 \item [Heartbeat Interval = \lt{}P\'eriode\gt{}]
83    \index[sd]{Heartbeat Interval}
84    \index[sd]{Directive!Heartbeat Interval}
85    \index[general]{Heartbeat Interval}
86    \index[general]{Broken pipe}
87    Cette directive d\'efinit la p\'eriode des pulsations \'emises par le Storage Daemon 
88    vers le File Daemon lorqu'il (le SD) se trouve en situation d'attente du montage 
89    d'une cartouche par l'op\'erateur. La valeur par d\'efaut est z\'ero, ce qui d\'esactive 
90    les pulsations. Cette fonctionnalit\'e est particuli\`erement utile si vous avez un 
91    routeur (tel que les 3Com) qui ne suit pas les standards Internet et expire une 
92    connection valide apr\`es une courte dur\'ee, bien que {\it keepalive} soit activ\'e. 
93    Ceci produit habituellement un message d'erreur du type {\it broken pipe}.
94
95 \item [Maximum Concurrent Jobs = \lt{}nombre\gt{}]
96    \index[sd]{Maximum Concurrent Jobs}
97    \index[sd]{Directive!Maximum Concurrent Jobs}
98    O\`u \lt{}nombre\gt{} est nombre maximal de jobs qui peuvent \^etre ex\'ecut\'es 
99    simultan\'ement. La valeur par d\'efaut est fix\'ee \`a 10, mais vous pouvez d\'efinir 
100    une valeur plus grande. Chaque connexion depuis le Director (par exemple 
101    une requ\^ete de statut, le lancement d'un job...) est consid\'er\'ee comme un job, 
102    aussi, si vous voulez conserver la possibilit\'e d'utiliser la commande 
103    {\bf status} dans la console alors qu'un job est en cours d'ex\'ecution, vous 
104    devez utiliser une valeur strictement sup\'erieure \`a 1. Pour ex\'ecuter plusieurs 
105    jobs simultan\'ement, vous devez param\'etrer plusieurs autres directives dans le 
106    fichier de configuration du Director. Selon ce que vous voulez faire, il faudra 
107    intervenir sur l'un ou l'autre param\`etre, mais vous devrez presque surement 
108    r\'egler le param\`etre {\bf Maximum Concurrent Jobs} de la ressource Storage du 
109    fichier de configuration du Director, et peut-\^etre aussi ceux des ressources 
110    Job et Client.
111    
112 \item [SDAddresses = \lt{}Adresse IP\gt{}]
113    \index[sd]{SDAddresses}
114    \index[sd]{Directive!SDAddresses}
115    Pr\'ecise les ports et adresses sur lesquels le Storage Daemon est \`a 
116    l'\'ecoute de connections du Director. En principe, les valeurs par d\'efaut sont 
117    suffisantes, et vous n'avez pas besoin d'utiliser cette directive. La meilleure 
118    explication du fonctionnement de cette directive est certainement un exemple :
119    
120 \footnotesize
121 \begin{verbatim}
122  SDAddresses  = { ip = {
123         addr = 1.2.3.4; port = 1205; }
124     ipv4 = {
125         addr = 1.2.3.4; port = http; }
126     ipv6 = {
127         addr = 1.2.3.4;
128         port = 1205;
129     }
130     ip = {
131         addr = 1.2.3.4
132         port = 1205
133     }
134     ip = {
135         addr = 1.2.3.4
136     }
137     ip = {
138         addr = 201:220:222::2
139     }
140     ip = {
141         addr = bluedot.thun.net
142     }
143 }
144 \end{verbatim}
145 \normalsize
146
147 o\`u "ip", "ip4", "ip6", "addr", et "port" sont des mots-clef. Notez que les adresses 
148 peuvent \^etre sp\'ecifi\'ees sous forme de quadruplets point\'es, de nom symboliques 
149 (uniquement dans la sp\'ecification "ip") ou en notation IPv6 \`a double points. Le port 
150 peut quand \`a lui \^etre sp\'ecifi\'e par son num\'ero, ou par sa valeur mn\'emonique du 
151 fichier /etc/services. Si un port n'est pas sp\'ecifi\'e, la valeur par d\'efaut est 
152 utilis\'ee. Si une section ip est sp\'ecifi\'ee, la r\'esolution peut \^etre r\'ealis\'ee 
153 par ipv4 ou ipv6. En revanche, si ip4 ou ip6 est sp\'ecifi\'ee, seule la r\'esolution 
154 correspondante fonctionne.
155
156 Vous pouvez, avec ces directives, remplacer les valeurs des directives  SDPort et 
157 SDAddress montr\'ees ci-dessous.
158
159 \item [SDPort = \lt{}Num\'ero de port\gt{}]
160    \index[sd]{SDPort}
161    \index[sd]{Directive!SDPort}
162    Sp\'ecifie le num\'ero de port sur lequel le Storage Daemon \'ecoute les connexions 
163    en provenance du Director. La valeur par d\'efaut est 9103.
164    
165 \item [SDAddress = \lt{}Adresse IP\gt{}]
166    \index[sd]{SDAddress}
167    \index[sd]{Directive!SDAddress}
168     Cette directive est optionnelle. Lorsqu'elle est sp\'ecifi\'ee, le Storage Daemon n'accepte
169     de connections (de Director(s) ou de File(s) Daemon(s)) que de l'adresse sp\'ecifi\'ee 
170     {\bf Adresse-IP}, qui peut \^etre
171     soit un nom de domaine, soit une adresse IP au format quadruplet point\'e.
172     Si cette directive n'est pas sp\'ecifi\'ee, le Storage Daemon acceptera des connections de 
173     de toute adresse valide. 
174
175 \end{description}
176
177 Voici une d\'efinition typique d'une ressource Storage du Storage Daemon :
178
179
180 \footnotesize
181 \begin{verbatim}
182 #
183 # "Global" Storage daemon configuration specifications appear
184 # under the Storage resource.
185 #
186 Storage {
187   Name = "Storage daemon"
188   Address = localhost
189   WorkingDirectory = "~/bacula/working"
190   Pid    Directory = "~/bacula/working"
191 }
192 \end{verbatim}
193 \normalsize
194
195 \subsection*{La ressource Director}
196 \label{DirectorResource1}
197 \index[general]{Ressource Director}
198 \index[general]{Resource!Director}
199 \addcontentsline{toc}{subsection}{La ressource Director}
200
201 La ressource Director sp\'ecifie le nom du Director qui est autoris\'e 
202 \`a utiliser les services du Storage Daemon. Il peut exister plusieurs 
203 ressources Director. Le nom et le mot de passe du Director doivent 
204 s'accorder avec leurs homologues dans le fichier de configuration 
205 du Storage Daemon.
206
207 \begin{description}
208
209 \item [Name = \lt{}Nom-du-Director\gt{}]
210    \index[sd]{Name}
211    \index[sd]{Directive!Name}
212    Sp\'ecifie le nom du Director autoris\'e \`a se connecter au Storage Daemon.
213    Cette directive est requise.
214
215 \item [Password = \lt{}Mot-de-passe-du-Director\gt{}]
216    \index[sd]{Password}
217    \index[sd]{Directive!Password}
218    Sp\'ecifie le mot de passe qui doit \^etre soumis par le Director susnomm\'e.
219    Cette directive est requise.
220
221 \item [Monitor = \lt{}yes|no\gt{}]
222    \index[sd]{Monitor}
223    \index[sd]{Directive!Monitor}
224    Si cette directive est d\'esactiv\'ee ({\bf no}), ce qui est le cas par d\'efaut, 
225    ce Director dispose d'un acc\`es illimit\'e \`a ce Storage Daemon. Dans le cas 
226    contraire, ce Director est brid\'e de fa\\ 3on \`a pouvoir seulement r\'ecup\'erer le 
227    statut courant de ce Storage Daemon.
228
229    Si ce Director est utilis\'e par un superviseur, nous vous recommandons 
230    fortement d'activer cette directive pour \'eviter de s\'erieux probl\`emes de 
231    s\'ecurit\'e.
232
233 \end{description}
234
235 Voici un exemple d'une d\'efinition de ressource Director valide :
236
237 \footnotesize
238 \begin{verbatim}
239 Director {
240   Name = MainDirector
241   Password = my_secret_password
242 }
243 \end{verbatim}
244 \normalsize
245
246 \label{DeviceResource}
247 \subsection*{La Ressource Device}
248 \index[general]{Resource!Device}
249 \index[general]{Ressource Device}
250 \addcontentsline{toc}{subsection}{Ressource Device}
251
252 La ressource Device sp\'ecifie les d\'etails de chaque p\'eriph\'erique (en g\'en\'eral, 
253 un lecteur de bandes) qui peut \^etre utilis\'e par le Storage Daemon. Un 
254 Storage Daemon peut disposer de plusieurs ressources Device. En g\'en\'eral, 
255 les propri\'et\'es sp\'ecifi\'ees dans la ressource Device sont sp\'ecifiques 
256 au p\'eriph\'erique.
257
258 \begin{description}
259
260 \item [Name = {\it Nom-de-p\'eriph\'erique}]
261    \index[sd]{Name}
262    \index[sd]{Directive!Name}
263    Sp\'ecifie le nom que le Director devra utiliser pour d\'esigner ce p\'eriph\'erique. 
264    Il s'agit d'un nom logique, c'est une cha\^ine qui peut comporter jusqu'\`a 127 
265    caract\`eres. C'est en g\'en\'eral une bonne id\'ee d'utiliser un nom qui corresponde 
266    au nom "humain" du p\'eriph\'erique (NDT: la vo dit "the english name"). Le nom 
267    physique du p\'eriph\'erique est sp\'ecifi\'e au niveau de la directive {\bf Archive Device} 
268    d\'ecrite ci-dessous. Le nom que vous sp\'ecifiez ici est aussi utilis\'e dans le 
269    fichier de configuration de votre Director au niveau de la 
270    \ilink{directive Device}{StorageResource2} de sa ressource Storage.   
271
272 \item [Archive Device = {\it cha\^ine-nom}]
273    \index[sd]{Archive Device}
274    \index[sd]{Directive!Archive Device}
275    La {\bf cha\^ine-nom} (NDT : name-string dans la vo) sp\'ecifie le nom de fichier syst\`eme 
276    du p\'eriph\'erique de stockage g\'er\'e par ce daemon. Il s'agit en g\'en\'eral d'un nom 
277    de p\'eriph\'erique amovible, par exemple un lecteur de bande d\'esign\'e par "{\bf /dev/nst0}" 
278    ou "{\bf /dev/rmt/0mbn}". Dans le cas d'un graveur de DVD, ce sera par exemple 
279    {\bf /dev/hdc}. Ce peut \^etre aussi un un nom de r\'epertoire si vous sauvegardez 
280    sur disque. Dans ce cas, vous devez soumettre le chemin absolu vers ce 
281    r\'epertoire. Lorsque vous utilisez un lecteur de bandes, il est pr\'ef\'erable 
282    d'utiliser la variante "non-rewind" du fichier de p\'eriph\'erique. De plus, sur les 
283    syst\`emes tels que Sun, qui disposent de plusieurs m\'ethodes d'acc\`es aux cartouches, 
284    prenez soin de sp\'ecifier l'usage de la convention I/O Berkeley avec les p\'eriph\'eriques. 
285    le {\bf b} de la sp\'ecification {\bf /dev/rmt/0mbn} Solaris (Sun) est ce qui est 
286    requis dans ce cas. Bacula ne supporte pas le comportement SysV des lecteurs de bandes. 
287
288    Comme mentionn\'e plus haut,Archive Device est, en principe, le nom d'un lecteur de bandes, 
289    mais vous pouvez tout aussi bien sp\'ecifier le chemin absolu vers un r\'epertoire 
290    existant. Dans ce cas, Bacula utilisera un fichier pour stocker les donn\'ees dans 
291    le r\'epertoire sp\'ecifi\'e, le nom de fichier utilis\'e sera celui du volume tel que 
292    sp\'ecifi\'e dans le catalogue. Si vous souhaitez \'ecrire dans plusieurs r\'epertoires 
293    (dans le but de r\'epartir la charge sur plusieurs disques), vous devez d\'efinir deux ressources 
294    Device, chacune comportant une Archive Device avec un r\'epertoire diff\'erent.
295    
296    Une troisi\`eme possibilit\'e consiste \`a sp\'ecifier le nom d'un FIFO. Un FIFO est un 
297    fichier sp\'ecial qui connecte deux programmes via la m\'emoire du noyau. Si vous 
298    sp\'ecifiez un FIFO en guise d'Archive Device, vous devez avoir un programme qui 
299    lit ce que Bacula \'ecrit dans le FIFO. Lorsque le Storage Daemon d\'emarre le job, 
300    il attend que le programme lecteur commence \`a lire pendant un d\'elai maximal de
301    de {\bf MaximumOpenWait} secondes, au del\`a duquel le job est termin\'e. Par cons\'equent, 
302    il est pr\'ef\'erable de lancer le programme lecteur au d\'ebut du job, par exemple 
303    grâce \`a la directive {\bf RunBeforeJob}. Pour ce type de p\'eriph\'erique, vous ne devez 
304    jamais sp\'ecifier {\bf AlwaysOpen}, puisque vous voulez que le Storage Daemon 
305    ne l'ouvre que lorsqu'un job d\'emarre, aussi veuillez attribuer  explicitement 
306    la valeur {\bf No} \`a cette directive. Puisqu'un FIFO est un p\'eriph\'erique \`a sens 
307    unique, Bacula ne tente pas d'en lire le label, il se contente d'y \'ecrire. Pour 
308    cr\'eer un volume FIFO dans le catalogue, utilisez la commande {\bf add}  plut\^ot 
309    que la commande {\bf label} afin d'\'eviter de tenter d'\'ecrire un label.
310    
311    Lors d'une op\'eration de restauration, si l'Archive Device est un FIFO, Bacula 
312    tente de lire le FIFO, aussi vous devez avoir un programme externe qui \'ecrit dans 
313    le FIFO. Bacula attend que ce programme commence \`a \'ecrire pendant un d\'elai 
314    maximal de {\bf MaximumOpenWait} secondes apr\`es quoi il termine le job. Comme 
315    mentionn\'e ci-dessus, vous pouvez utiliser la directive {\bf RunBeforeJob} pour 
316    lancer ce programme auteur d\`es le d\'ebut du job.
317   
318    La directive Archive Device est requise. 
319
320 \item [Device Type = {\it Sp\'ecification-de-type}]
321    \index[sd]{Device Type}
322    \index[sd]{Directive!Device Type}
323    La sp\'ecification Device Type de d\'eclarer explicitement \`a Bacula quel type  
324    de p\'eriph\'erique vous d\'efinissez. La valeur de {\it Sp\'ecification-de-type} peut 
325    \^etre l'une des suivantes :
326    \begin{description}
327    \item [File]
328      Indique \`a Bacula que le p\'eriph\'erique est un fichier. Ce peut \^etre 
329      un fichier d\'efini sur un m\'edium fixe ou au contraire amovible (par exemple, un 
330      p\'eriph\'erique USB). Tous les fichiers doivent \^etre des p\'eriph\'eriques en acc\`es 
331      s\'electif (NDT : traduction Google sans doute \`a revoir de "random access")
332    \item[tape]
333      Indique \`a Bacula que le p\'eriph\'erique est un lecteur de bandes, donc \`a 
334      acc\`es s\'equentiel. Ces p\'eriph\'eriques sont control\'e par les appels 
335      ioctl().
336    \item[Fifo]
337       Indique \`a Bacula que le p\'eriph\'erique est un p\'eriph\'erique \`a acc\`es 
338       s\'equentiel "first-in-first-out" (premier entr\'e, premier sorti) en 
339       lecture seule ou en \'ecriture seule.
340    \item[DVD]
341       Indique \`a Bacula que le p\'eriph\'erique est un DVD. Les DVDs sont \`a acc\`es 
342       s\'equentiel en \'ecriture et \`a acc\`es s\'electif  (NDT : traduction Google sans 
343       doute \`a revoir de "random access") en lecture.
344    \end{description}
345    
346   La directive Device Type n'est pas requise, et si elle n'est pas sp\'ecifi\'ee, 
347   Bacula tentera de deviner cette information selon la sp\'ecification Archive 
348   Device fournie. Il existe plusieurs avantages \`a sp\'ecifier explicitement 
349   le type de p\'eriph\'erique. D'abord, sur certains syst\`emes, les p\'eriph\'eriques 
350   bloc et caract\`ere ont le m\^eme type, ce qui signifie que sur ces syst\`emes, 
351   Bacula est probablement incapable de deviner qu'un p\'eriph\'erique est un DVD. 
352   Ensuite, si vous sp\'ecifiez explicitement le type de p\'eriph\'erique, le point de 
353   montage n'a pas besoin d'\^etre d\'efini jusqu'\`a ce que le p\'eriph\'erique soit ouvert. 
354   C'est le cas de la plupart des p\'eriph\'eriques amovibles tels que les USB mont\'es 
355   par le daemon HAL. Au contraire, si le type de p\'eriph\'erique n'est pas 
356   sp\'ecifi\'e explicitement, le point de montage doit exister d\`es le 
357   d\'emarrage du Storage Daemon.
358
359   Cette directive est apparue avec la version 1.38.6 de Bacula.
360   
361 \item [Media Type = {\it name-string}]
362    \index[sd]{Media Type}
363    \index[sd]{Directive!Media Type}
364    La cha\^ine {\bf name-string} sp\'ecifi\'ee baptise le type de m\'edia support\'e par 
365    ce p\'eriph\'erique, par exemple, "DLT7000". Les noms de type de m\'edia sont 
366    arbitraires, vous pouvez utiliser le nom de votre choix, mais ils doivent 
367    \^etre connus du catalogue pour qu'il puisse garder trace de quel daemon 
368    peut lire quel type de m\'edia. En g\'en\'eral, chaque type de stockage devrait 
369    avoir un type de m\'edia unique associ\'e. Le m\^eme nom {\bf name-string} doit 
370    appara\^itre dans la d\'efinition de ressource Storage appropri\'ee du fichier 
371    de configuration du Director.
372    
373    M\^eme si les noms que vous assignez sont arbitraires, vous devriez les choisir 
374    avec circonspection, car le Media Type est utilis\'e pour d\'eterminer le 
375    p\'eriph\'erique de stockage \`a s\'electionner lors d'une restauration. Ainsi, vous 
376    devriez certainement utiliser le m\^eme Media Type pour tous les lecteurs 
377    dont les cartouches sont interchangeables. Ce n'est généralement pas un 
378    problème si vous n'avez qu'un Storage Daemon, mais c'en est un avec plusieurs 
379    Storage Daemon, surtout s'ils utilisent des média incompatibles.
380   
381    Si, par exemple, vous spécifiez le Media Type "DDS-4", Bacula pourra lors de 
382    restaurations sélectionner tout Storage Daemon qui supporte les "DDS-4". 
383    Si vous avez une librairie, vous voudrez peut-être baptiser son Media Type 
384    d'un nom qui lui soit unique, Ã  moins que vous souhaitiez pouvoir utiliser 
385    ses volumes dans d'autres lecteurs. Vous devriez aussi vous assurer d'avoir 
386    des noms de Media Type uniques si les media ne sont pas compatibles d'un 
387    lecteur Ã  l'autre. Cette spécification est requise pour tous les 
388    périphériques.
389
390    Enfin, si vous utilisez le stockage sur disque, sachez que chaque ressource 
391    Device a généralement un point de montage (ou répertoire) différent. Afin 
392    que Bacula puisse sélectionner correctement la ressource Device Ã  utiliser, 
393    chacun doit avoir un Media Type distinct.
394    
395 \label{Autochanger}
396 \item [Autochanger = {\it Yes|No}]
397    \index[sd]{Autochanger}
398    \index[sd]{Directive!Autochanger}
399    If {\bf Yes}, this device belongs to an automatic tape changer, and you
400    must specify an {\bf Autochanger} resource that points to the {\bf
401    Device} resources.  You must also specify a 
402    {\bf Changer Device}.  If the Autochanger direcive is set to {\bf
403    No} (default), the volume must be manually changed.  You should also
404    have an identical directive to the  
405    \ilink{Storage resource}{Autochanger1}  in the Director's
406    configuration file so that  when labeling tapes you are prompted for the slot.
407
408 \item [Changer Device = {\it name-string}]
409    \index[sd]{Changer Device}
410    \index[sd]{Directive!Changer Device}
411    The specified {\bf name-string} must be the {\bf generic SCSI} device
412    name of the autochanger that corresponds to the normal read/write
413    {\bf Archive Device}  specified in the Device resource. This
414    gemeric SCSI device name should be specified if you have an autochanger 
415    or if you have a standard tape drive and want to use the
416    {\bf Alert Command} (see below). For example, on Linux systems, for 
417    an Archive Device name of {\bf /dev/nst0}, you would specify {\bf
418    /dev/sg0} for the Changer Device name. Depending on your exact
419    configuration, and the number of autochangers or the type of
420    autochanger, what you specify here can vary.  This directive is
421    optional.  See the \ilink{ Using Autochangers}{_ChapterStart18} chapter
422    of this manual for more details of using this and the following
423    autochanger directives.
424
425 \item [Changer Command = {\it name-string}]
426    \index[sd]{Changer Command}
427    \index[sd]{Directive!Changer Command}
428    The {\bf name-string} specifies an external program to be called  that will
429    automatically change volumes as required by {\bf Bacula}.  Normally,
430    this directive will be specified only in the {\bf AutoChanger} resource,
431    which is then used for all devices.  However, you may also specify
432    the different {\bf Changer Commands} in each Device specification.
433    Most frequently,
434    you will specify the Bacula supplied {\bf mtx-changer}  script as follows:  
435
436 \footnotesize
437 \begin{verbatim}
438 Changer Command = "/path/mtx-changer %c %o %S %a %d"
439 \end{verbatim}
440 \normalsize
441
442    and you will install the {\bf mtx} on your system (found  in the {\bf depkgs}
443    release). An example of this command is in the default bacula-sd.conf file. 
444    For more details on the substitution characters that may be specified  to
445    configure your autochanger please see  the 
446    \ilink{Autochangers}{_ChapterStart18} chapter of this  manual.
447    For FreeBSD users, you might want to see one of the  several {\bf chio}
448    scripts in {\bf examples/autochangers}.  
449
450 \item [Alert Command = {\it name-string}]
451    \index[sd]{Alert Command}
452    The {\bf name-string} specifies an external program to be called  at the
453    \index[sd]{Directive!Changer Command}
454    completion of each Job after the device is released.  The purpose of this
455    command is to check for Tape Alerts, which  are present when something is
456    wrong with your tape drive  (at least for most modern tape drives).  The same
457    substitution characters that may be specified  in the Changer Command may also
458    be used in this string.  For more information, please see  the 
459    \ilink{Autochangers}{_ChapterStart18} chapter of this  manual. 
460    
461    
462    Note, it is not necessary to have an autochanger to use this  command. The
463    example below uses the {\bf tapeinfo} program  that comes with the {\bf mtx}
464    package, but it can be used  on any tape drive. However, you will need to
465    specify  a {\bf Changer Device} directive in your Device resource  (see above)
466    so that the generic SCSI device name can be  edited into the command (with the
467    \%c).  
468    
469    An example of the use of this command to print Tape Alerts  in the Job report
470    is:  
471
472 \footnotesize
473 \begin{verbatim}
474 Alert Command = "sh -c 'tapeinfo -f %c | grep TapeAlert'"
475       
476 \end{verbatim}
477 \normalsize
478
479 and an example output when there is a problem could be:  
480
481 \footnotesize
482 \begin{verbatim}
483 bacula-sd  Alert: TapeAlert[32]: Interface: Problem with SCSI interface
484                   between tape drive and initiator.
485       
486 \end{verbatim}
487 \normalsize
488
489 \item [Drive Index = {\it number}]
490    \index[sd]{Drive Index}
491    \index[sd]{Directive!Drive Index}
492    The {\bf Drive Index} that you specify is passed to the  {\bf mtx-changer}
493    script and is thus passed to the {\bf mtx}  program. By default, the Drive
494    Index is zero, so if you have only  one drive in your autochanger, everything
495    will work normally.  However, if you have multiple drives, you must specify t
496    multiple Bacula  Device resources (one for each drive).
497    The first will either set Drive Index to zero,  or
498    leave it unspecified, and the second Device Resource should  contain a Drive
499    Index set to 1, and so on. This will then permit you to  use two or more drives in your
500    autochanger. As of Bacula version 1.38.0, using the {\bf Autochanger}
501    resource, Bacula will automatically ensure that only one drive at a
502    time uses the autochanger script, so you no longer need locking scripts
503    as in the past -- the default mtx-changer script works for any number
504    of drives.
505
506 \item [Autoselect = {\it Yes|No}]
507    \index[sd]{Autoselect}
508    \index[sd]{Directive!Autoselect}
509    If this directive is set to {\bf yes} (default), and the Device
510    belongs to an autochanger, then when the Autochanger is referenced
511    by the Director, this device can automatically be selected. If this
512    directive is set to {\bf no}, then the Device can only be referenced
513    by directly using the Device name in the Director. This is useful
514    for reserving a drive for something special such as a high priority
515    backup or restore operations.
516
517 \item [Maximum Changer Wait = {\it time}]
518    \index[sd]{Maximum Changer Wait}
519    \index[sd]{Directive!Maximum Changer Wait}
520    This directive specifies the maximum time in seconds for Bacula to wait
521    for an autochanger to change the volume.  If this time is exceeded,
522    Bacula will invalidate the Volume slot number stored in the catalog and
523    try again.  If no additional changer volumes exist, Bacula will ask the
524    operator to intervene.  The default is 5 minutes.      
525
526 \item [Maximum Rewind Wait = {\it time}]
527    \index[sd]{Maximum Rewind Wait}
528    \index[sd]{Directive!Maximum Rewind Wait}
529    This directive specifies the maximum time in seconds for Bacula to wait
530    for a rewind before timing out.  If this time is exceeded,
531    Bacula will cancel the job.  The default is 5 minutes.
532
533 \item [Maximum Open Wait = {\it time}]
534    \index[sd]{Maximum Open Wait}
535    \index[sd]{Directive!Maximum Open Wait}
536    This directive specifies the maximum time in seconds for Bacula to wait
537    for a open before timing out.  If this time is exceeded,
538    Bacula will cancel the job.  The default is 5 minutes.
539
540 \item [Always Open = {\it Yes|No}]
541    \index[sd]{Always Open}
542    \index[sd]{Directive!Always Open}
543    If {\bf Yes} (default), Bacula will always keep the device open unless
544    specifically {\bf unmounted} by the Console program.  This permits
545    Bacula to ensure that the tape drive is always available.  If you set
546    {\bf AlwaysOpen} to {\bf no} {\bf Bacula} will only open the drive when
547    necessary, and at the end of the Job if no other Jobs are using the
548    drive, it will be freed.  The next time Bacula wants to append to a tape
549    on a drive that was freed, Bacula must rewind the tape and position to
550    the end.  To avoid unnecessary tape positioning and to minimize
551    unnecessary operator intervention, it is highly recommended that {\bf
552    Always Open = yes}.  This also ensures that the drive is available when
553    Bacula needs it.
554    
555    If you have {\bf Always Open = yes} (recommended) and you want  to use the
556    drive for something else, simply use the {\bf unmount}  command in the Console
557    program to release the drive. However, don't  forget to remount the drive with
558    {\bf mount} when the drive is  available or the next Bacula job will block.  
559    
560    For File storage, this directive is ignored. For a FIFO storage  device, you
561    must set this to {\bf No}.  
562    
563    Please note that if you set this directive to {\bf No} Bacula  will release
564    the tape drive between each job, and thus the next job  will rewind the tape
565    and position it to the end of the data. This  can be a very time consuming
566    operation. 
567
568 \item [Volume Poll Interval = {\it time}]
569    \index[sd]{Volume Poll Interval}
570    \index[sd]{Directive!Volume Poll Interval}
571    If the time  specified on this directive is non-zero, after  asking the
572    operator to mount a new volume Bacula will  periodically poll (or read) the
573    drive at the specified  interval to see if a new volume has been mounted. If
574    the  time interval is zero (the default), no polling will occur.  This
575    directive can be useful if you want to avoid operator  intervention via the
576    console. Instead, the operator can  simply remove the old volume and insert
577    the requested one,  and Bacula on the next poll will recognize the new tape
578    and  continue. Please be aware that if you set this interval  too small, you
579    may excessively wear your tape drive if the  old tape remains in the drive,
580    since Bacula will read it on  each poll. This can be avoided by ejecting the
581    tape using  the {\bf Offline On Unmount} and the {\bf Close on Poll} 
582    directives. 
583    However, if you are using a Linux 2.6 kernel or other OSes
584    such as FreeBSD or Solaris, the Offline On Unmount will leave the drive
585    with no tape, and Bacula will not be able to properly open the drive and
586    may fail the job.  For more information on this problem, please see the
587    \ilink{description of Offline On Unmount}{NoTapeInDrive} in the Tape
588    Testing chapter.
589
590 \item [Close on Poll= {\it Yes|No}]
591    \index[sd]{Close on Poll}
592    \index[sd]{Directive!Close on Poll}
593    If {\bf Yes}, Bacula close the device (equivalent to  an unmount except no
594    mount is required) and reopen it at each  poll. Normally this is not too
595    useful unless you have the  {\bf Offline on Unmount} directive set, in which
596    case the  drive will be taken offline preventing wear on the tape  during any
597    future polling. Once the operator inserts a new  tape, Bacula will recognize
598    the drive on the next poll and  automatically continue with the backup. 
599    Please see above more more details.
600
601 \item [Maximum Open Wait = {\it time}]
602    \index[sd]{Maximum Open Wait}
603    \index[sd]{Directive!Maximum Open Wait}
604    This directive specifies the maximum amount of time in seconds that
605    Bacula will wait for a device that is busy.  The default is 5 minutes.
606    If the device cannot be obtained, the current Job will be terminated in
607    error.  Bacula will re-attempt to open the drive the next time a Job
608    starts that needs the the drive.
609
610 \item [Removable media = {\it Yes|No}]
611    \index[sd]{Removable media}
612    \index[sd]{Directive!Removable media}
613    If {\bf Yes}, this device supports removable media (for example, tapes
614    or CDs).  If {\bf No}, media cannot be removed (for example, an
615    intermediate backup area on a hard disk).
616
617 \item [Random access = {\it Yes|No}]
618    \index[sd]{Random access}
619    \index[sd]{Directive!Random access}
620    If {\bf Yes}, the archive device is assumed to be a random access medium
621    which supports the {\bf lseek} (or {\bf lseek64} if Largefile is enabled
622    during configuration) facility.
623
624 \item [Minimum block size = {\it size-in-bytes}]
625    \index[sd]{Minimum block size}
626    \index[sd]{Directive!Minimum block size}
627    On most modern tape drives, you will not need or wamt to specify this
628    directive, and if you do so, it will be to make Bacula use fixed block
629    sizes.  This statement applies only to non-random access devices (e.g.
630    tape drives).  Blocks written by the storage daemon to a non-random
631    archive device will never be smaller than the given {\bf size-in-bytes}.
632    The Storage daemon will attempt to efficiently fill blocks with data
633    received from active sessions but will, if necessary, add padding to a
634    block to achieve the required minimum size.
635    
636    To force the block size to be fixed, as is the case for some non-random
637    access devices (tape drives), set the {\bf Minimum block size} and the
638    {\bf Maximum block size} to the same value (zero included).  The default
639    is that both the minimum and maximum block size are zero and the default
640    block size is 64,512 bytes.  If you wish the block size to be fixed and
641    different from the default, specify the same value for both {\bf Minimum
642    block size} and {\bf Maximum block size}.
643    
644    For  example, suppose you want a fixed block size of 100K bytes, then you 
645    would specify:  
646
647 \footnotesize
648 \begin{verbatim}
649  
650     Minimum block size = 100K
651     Maximum block size = 100K
652     
653 \end{verbatim}
654 \normalsize
655
656    Please note that if you specify a fixed block size as shown above,  the tape
657    drive must either be in variable block size mode, or  if it is in fixed block
658    size mode, the block size (generally  defined by {\bf mt}) {\bf must} be
659    identical to the size specified  in Bacula -- otherwise when you attempt to
660    re-read your Volumes,  you will get an error.  
661    
662    If you want the  block size to be variable but with a 64K minimum and 200K
663    maximum (and  default as well), you would specify:  
664
665 \footnotesize
666 \begin{verbatim}
667  
668     Minimum block size = 64K
669     Maximum blocksize = 200K
670    
671 \end{verbatim}
672 \normalsize
673
674 \item [Maximum block size = {\it size-in-bytes}]
675    \index[sd]{Maximum block size}
676    \index[sd]{Directive!Maximum block size}
677    On most modern tape drives, you will not need to specify this directive.
678    If you do so, it will most likely be to use fixed block sizes (see
679    Minimum block size above).  The Storage daemon will aways attempt to
680    write blocks of the specified {\bf size-in-bytes} to the archive device.
681    As a consequence, this statement specifies both the default block size
682    and the maximum block size.  The size written never exceed the given
683    {\bf size-in-bytes}.  If adding data to a block would cause it to exceed
684    the given maximum size, the block will be written to the archive device,
685    and the new data will begin a new block.
686    
687    If no value is specified or zero is specified, the Storage daemon will
688    use a default block size of 64,512 bytes (126 * 512).
689
690 \item [Hardware End of Medium = {\it Yes|No}]
691    \index[sd]{Hardware End of Medium}
692    \index[sd]{Directive!Hardware End of Medium}
693    If {\bf No}, the archive device is not required to support end  of medium
694    ioctl request, and the storage daemon will use the forward  space file
695    function to find the end of the recorded data. If  {\bf Yes}, the archive
696    device must support the {\tt ioctl}  {\tt MTEOM} call, which will position the
697    tape to the end of the  recorded data. In addition, your SCSI driver must keep
698    track  of the file number on the tape and report it back correctly by  the
699    {\bf MTIOCGET} ioctl. Note, some SCSI drivers will correctly  forward space to
700    the end of the recorded data, but they do not  keep track of the file number.
701    On Linux machines, the SCSI driver  has a {\bf fast-eod} option, which if set
702    will cause the driver  to lose track of the file number. You should ensure
703    that this  option is always turned off using the {\bf mt} program.  
704    
705    Default setting for Hardware End of Medium is {\bf Yes}. This  function is
706    used before appending to a tape to ensure that no  previously written data is
707    lost. We recommend if you have a non-standard or unusual tape drive that you
708    use the {\bf btape} program  to test your drive to see whether or not it
709    supports this function.  All modern (after 1998) tape drives support this
710    feature.  
711    
712 \item [Fast Forward Space File = {\it Yes|No}]
713    \index[sd]{Fast Forward Space File}
714    \index[sd]{Directive!Fast Forward Space File}
715    If {\bf No}, the archive device is not required to support  keeping track of
716    the file number ({\bf MTIOCGET} ioctl) during  forward space file. If {\bf
717    Yes}, the archive device must support  the {\tt ioctl} {\tt MTFSF} call, which
718    virtually all drivers  support, but in addition, your SCSI driver must keep
719    track of the  file number on the tape and report it back correctly by the 
720    {\bf MTIOCGET} ioctl. Note, some SCSI drivers will correctly  forward space,
721    but they do not keep track of the file number or more  seriously, they do not
722    report end of meduim.  
723    
724    Default setting for Fast Forward Space File is {\bf Yes}.
725    
726 \item [Use MTIOCGET = {\it Yes|No}]
727    \index[sd]{Fast Forward Space File}
728    \index[sd]{Directive!Fast Forward Space File}
729    If {\bf No}, the operating system is not required to support keeping track of
730    the file number and reporting it in the ({\bf MTIOCGET} ioctl). The default
731    is {\bf Yes}. If you must set this to No, Bacula will do the proper file
732    position determination, but it is very unfortunate because it means that 
733    tape movement is very inefficient.
734    Fortunately, this operation system deficiency seems to be the case only
735    on a few *BSD systems.  Operating systems known to work correctly are
736    Solaris, Linux and FreeBSD.
737
738 \item [BSF at EOM = {\it Yes|No}]
739    \index[sd]{BSF at EOM}
740    \index[sd]{Directive!BSF at EOM}
741    If {\bf No}, the default, no special action is taken by  Bacula with the End
742    of Medium (end of tape) is reached because  the tape will be positioned after
743    the last EOF tape mark, and  Bacula can append to the tape as desired.
744    However, on some  systems, such as FreeBSD, when Bacula reads the End of
745    Medium  (end of tape), the tape will be positioned after the second  EOF tape
746    mark (two successive EOF marks indicated End of  Medium). If Bacula appends
747    from that point, all the appended  data will be lost. The solution for such
748    systems is to  specify {\bf BSF at EOM} which causes Bacula to backspace  over
749    the second EOF mark. Determination of whether or not  you need this directive
750    is done using the {\bf test} command  in the {\bf btape} program.
751
752 \item [TWO EOF = {\it Yes|No}]
753    \index[sd]{TWO EOF}
754    \index[sd]{Directive!TWO EOF}
755    If {\bf Yes}, Bacula will write two end of file marks when  terminating a tape
756 -- i.e. after the last job or at the end of  the medium. If {\bf No}, the
757 default, Bacula will only write  one end of file to terminate the tape. 
758
759 \item [Backward Space Record = {\it Yes|No}]
760    \index[sd]{Backward Space Record}
761    \index[sd]{Directive!Backward Space Record}
762    If {\it Yes}, the archive device supports the {\tt MTBSR  ioctl} to backspace
763    records. If {\it No}, this call is not  used and the device must be rewound
764    and advanced forward to the  desired position. Default is {\bf Yes} for non
765    random-access  devices. This function if enabled is used at the end of a 
766    Volume after writing the end of file and any ANSI/IBM labels to determine whether
767    or not the last block was written correctly. If you turn this function off,
768    the test will not be done. This causes no harm as the re-read process is
769    precautionary rather than required.
770
771 \item [Backward Space File = {\it Yes|No}]
772    \index[sd]{Backward Space File}
773    \index[sd]{Directive!Backward Space File}
774    If {\it Yes}, the archive device supports the {\bf MTBSF} and  {\bf MTBSF
775   ioctl}s to backspace over an end of file mark and to the  start of a file. If
776   {\it No}, these calls are not used and the  device must be rewound and
777   advanced forward to the desired position.  Default is {\bf Yes} for non
778   random-access devices. 
779
780 \item [Forward Space Record = {\it Yes|No}]
781    \index[sd]{Forward Space Record}
782    \index[sd]{Directive!Forward Space Record}
783    If {\it Yes}, the archive device must support the {\bf MTFSR  ioctl} to
784    forward space over records. If {\bf No}, data must  be read in order to
785    advance the position on the device. Default is  {\bf Yes} for non
786    random-access devices. 
787
788 \item [Forward Space File = {\it Yes|No}]
789    \index[sd]{Forward Space File}
790    \index[sd]{Directive!Forward Space File}
791    If {\bf Yes}, the archive device must support the {\tt MTFSF  ioctl} to
792    forward space by file marks. If {\it No}, data  must be read to advance the
793    position on the device. Default is  {\bf Yes} for non random-access devices. 
794
795 \item [Offline On Unmount = {\it Yes|No}]
796    \index[sd]{Offline On Unmount}
797    \index[sd]{Directive!Offline On Unmount}
798    The default for this directive is {\bf No}. If {\bf Yes} the  archive device
799    must support the {\tt MTOFFL ioctl} to rewind and  take the volume offline. In
800    this case, Bacula will issue the  offline (eject) request before closing the
801    device during the {\bf unmount}  command. If {\bf No} Bacula will not attempt
802    to offline the  device before unmounting it. After an offline is issued,  the
803    cassette will be ejected thus {\bf requiring operator intervention}  to
804    continue, and on some systems require an explicit load command  to be issued
805    ({\bf mt -f /dev/xxx load}) before the system will recognize  the tape. If you
806    are using an autochanger, some devices  require an offline to be issued prior
807    to changing the volume. However,  most devices do not and may get very
808    confused.  
809
810    If you are using a Linux 2.6 kernel or other OSes
811    such as FreeBSD or Solaris, the Offline On Unmount will leave the drive
812    with no tape, and Bacula will not be able to properly open the drive and
813    may fail the job.  For more information on this problem, please see the
814    \ilink{description of Offline On Unmount}{NoTapeInDrive} in the Tape
815    Testing chapter.
816
817
818 \item [Maximum Volume Size = {\it size}]
819    \index[sd]{Maximum Volume Size}
820    \index[sd]{Directive!Maximum Volume Size}
821    No more than {\bf size} bytes will be written onto a given volume on the
822    archive device.  This directive is used mainly in testing Bacula to
823    simulate a small Volume.  It can also be useful if you wish to limit the
824    size of a File Volume to say less than 2GB of data.  In some rare cases
825    of really antiquated tape drives that do not properly indicate when the
826    end of a tape is reached during writing (though I have read about such
827    drives, I have never personally encountered one).  Please note, this
828    directive is deprecated (being phased out) in favor of the {\bf Maximum
829    Volume Bytes} defined in the Director's configuration file.
830
831 \item [Maximum File Size = {\it size}]
832    \index[sd]{Maximum File Size}
833    \index[sd]{Directive!Maximum File Size}
834    No more than {\bf size} bytes will be written into a given logical file
835    on the volume.  Once this size is reached, an end of file mark is
836    written on the volume and subsequent data are written into the next
837    file.  Breaking long sequences of data blocks with file marks permits
838    quicker positioning to the start of a given stream of data and can
839    improve recovery from read errors on the volume.  The default is one
840    Gigabyte.
841
842 \item [Block Positioning = {\it yes|no}]
843    \index[sd]{Block Positioning}
844    \index[sd]{Directive!Block Positioning}
845    This directive is not normally used (and has not yet been  tested). It will
846    tell Bacula not to use block positioning when  it is reading tapes. This can
847    cause Bacula to be {\bf extremely}  slow when restoring files. You might use
848    this directive if you  wrote your tapes with Bacula in variable block mode
849    (the default),  but your drive was in fixed block mode. If it then works as  I
850    hope, Bacula will be able to re-read your tapes. 
851
852 \item [Maximum Network Buffer Size = {\it bytes}]
853    \index[sd]{Maximum Network Buffer Size}
854    \index[sd]{Directive!Maximum Network Buffer Size}
855    where {\it bytes} specifies the initial network buffer  size to use with the
856    File daemon.  This size will be adjusted down if it is too large until
857    it is accepted by the OS. Please use care in setting this value since if
858    it is too large, it will be trimmed by 512 bytes until the OS is happy,
859    which may require a large number of system calls.  The default value is
860    32,768 bytes.
861
862    The default size was chosen to be relatively large but not too big in
863    the case that you are transmitting data over Internet.  It is clear that
864    on a high speed local network, you can increase this number and improve
865    performance. For example, some users have found that if you use a value
866    of 65,536 bytes they get 5-10 times the throughput.  Larger values for
867    most users don't seem to improve performance. If you are interested
868    in improving your backup speeds, this is definitely a place to
869    experiment. You will probably also want to make the corresponding change
870    in each of your File daemons conf files.
871
872
873 \item [Maximum Spool Size = {\it bytes}]
874    \index[sd]{Maximum Spool Size}
875    \index[sd]{Directive!Maximum Spool Size}
876    where the bytes specify the maximum spool size for all jobs  that are running.
877    The default is no limit. 
878
879 \item [Maximum Job Spool Size = {\it bytes}]
880    \index[sd]{Maximum Job Spool Size}
881    \index[sd]{Directive!Maximum Job Spool Size}
882    where the bytes specify the maximum spool size for any one job  that is
883    running. The default is no limit. 
884    This directive is implemented only in version 1.37 and later.
885
886 \item [Spool Directory = {\it directory}]
887    \index[sd]{Spool Directory}
888    \index[sd]{Directive!Spool Directory}
889    specifies the name of the directory to be used to store  the spool files for
890    this device. This directory is also used to store  temporary part files when
891    writing to a device that requires mount (DVD).  The default is to use the
892    working directory. 
893
894 \item [Maximum Part Size = {\it bytes}]
895    \index[sd]{Maximum Part Size}
896    \index[sd]{Directive!Maximum Part Size}
897    This is the maximum size of a volume part file. The default is no limit.
898    This directive is implemented only in version 1.37 and later.
899
900    If the device requires  mount, it is transfered to the device when this size
901    is reached.  In this case, you must take care to have enough disk space left
902    in  the spool directory.  
903
904    Otherwise, it is left on the hard disk.  
905
906    It is ignored for tape and FIFO devices.  
907
908
909 \end{description}
910
911 \subsection*{Devices that require a mount (DVD)}
912 \index[general]{Devices that require a mount (DVD)}
913 \index[general]{DVD!Devices that require a mount}
914 \addcontentsline{toc}{subsection}{Devices that require a mount (DVD)}
915
916 All the directives in this section are implemented only in
917 Bacula version 1.37 and later and hence are available in version 1.38.6.
918
919 As of version 1.39.5, the directives
920 "Requires Mount", "Mount Point", "Mount Command", and "Unmount Command"
921 apply to removable filesystems such as USB in addition to DVD.
922
923 \begin{description}
924
925 \item [Requires Mount = {\it Yes|No}]
926    \index[sd]{Requires Mount}
927    \index[sd]{Directive!Requires Mount}
928    You must set this directive to {\bf yes} for DVD-writers,  and to {\bf no} for
929    all other devices (tapes/files).  This directive indicates if the device
930    requires to be mounted to be read,  and if it must be written in a special way.
931    If it set, {\bf Mount Point},  {\bf Mount Command}, {\bf Unmount Command} and
932    {\bf Write Part Command}  directives must also be defined. 
933
934 \item [Mount Point = {\it directory}]
935    \index[sd]{Mount Point}
936    \index[sd]{Directive!Mount Point}
937    Directory where the device can be mounted. 
938
939 \item [Mount Command = {\it name-string}]
940    \index[sd]{Mount Command}
941    \index[sd]{Directive!Mount Command}
942    Command that must be executed to mount the device. Before the command is 
943    executed, \%a is replaced with the Archive Device, and \%m with the Mount 
944    Point.
945
946    Most frequently, you will define it as follows:  
947
948 \footnotesize
949 \begin{verbatim}
950   Mount Command = "/bin/mount -t iso9660 -o ro %a %m"
951 \end{verbatim}
952 \normalsize
953
954 \item [Unmount Command = {\it name-string}]
955    \index[sd]{Unmount Command}
956    \index[sd]{Directive!Unmount Command}
957    Command that must be executed to unmount the device. Before the command  is
958    executed, \%a is replaced with the Archive Device, and \%m with the  Mount
959    Point.
960
961    Most frequently, you will define it as follows:  
962
963 \footnotesize
964 \begin{verbatim}
965   Unmount Command = "/bin/umount %m"
966 \end{verbatim}
967 \normalsize
968
969 \item [Write Part Command = {\it name-string}]
970    \index[sd]{Write Part Command}
971    \index[sd]{Directive!Write Part Command}
972    Command that must be executed to write a part to the device. Before the 
973    command is executed, \%a is replaced with the Archive Device, \%m with the 
974    Mount Point, \%e is replaced with 1 if we are writing the first part,
975    and with 0 otherwise, and \%v with the current part filename.
976
977    For a DVD, you will most frequently specify the Bacula supplied  {\bf
978    dvd-handler} script as follows:  
979
980 \footnotesize
981 \begin{verbatim}
982   Write Part Command = "/path/dvd-handler %a write %e %v"
983 \end{verbatim}
984 \normalsize
985
986   Where {\bf /path} is the path to your scripts install directory, and
987   dvd-handler is the Bacula supplied script file.  
988   This command will already be present, but commented out,
989   in the default bacula-sd.conf file. To use it, simply remove
990   the comment (\#) symbol.
991
992
993 \item [Free Space Command = {\it name-string}]
994    \index[sd]{Free Space Command}
995    \index[sd]{Directive!Free Space Command}
996    Command that must be executed to check how much free space is left on the 
997    device. Before the command is executed,\%a is replaced with the Archive
998    Device, \%m with the Mount Point, \%e is replaced with 1 if we are writing
999    the first part, and with 0 otherwise, and \%v with the current part filename.
1000
1001    For a DVD, you will most frequently specify the Bacula supplied  {\bf
1002    dvd-handler} script as follows:  
1003
1004 \footnotesize
1005 \begin{verbatim}
1006   Free Space Command = "/path/dvd-handler %a free"
1007 \end{verbatim}
1008 \normalsize
1009
1010   Where {\bf /path} is the path to your scripts install directory, and
1011   dvd-handler is the Bacula supplied script file.
1012   If you want to specify your own command, please look at the code of
1013   dvd-handler to see what output Bacula expects from this command.
1014   This command will already be present, but commented out,
1015   in the default bacula-sd.conf file. To use it, simply remove
1016   the comment (\#) symbol.
1017
1018   If you do not set it, Bacula will expect there is always free space on the
1019   device. 
1020
1021 \end{description}
1022
1023 %% This pulls in the Autochanger resource from another file.
1024 \label{AutochangerRes}
1025 \label{AutochangerResource1}
1026 \input{autochangerres}
1027
1028
1029
1030
1031 \subsection*{Capabilities}
1032 \index[general]{Capabilities}
1033 \addcontentsline{toc}{subsection}{Capabilities}
1034
1035 \begin{description}
1036
1037 \item [Label media = {\it Yes|No}]
1038    \index[sd]{Label media}
1039    \index[sd]{Directive!Label media}
1040    If {\bf Yes}, permits this device to automatically label blank media
1041    without an explicit operator command.  It does so by using an internal
1042    algorithm as defined on the \ilink{Label Format}{Label} record in each
1043    Pool resource.  If this is {\bf No} as by default, Bacula will label
1044    tapes only by specific operator command ({\bf label} in the Console) or
1045    when the tape has been recycled.  The automatic labeling feature is most
1046    useful when writing to disk rather than tape volumes.
1047
1048 \item [Automatic mount = {\it Yes|No}]
1049    \index[sd]{Automatic mount}
1050    \index[sd]{Directive!Automatic mount}
1051    If {\bf Yes} (the default), permits the daemon to examine the device to
1052    determine if it contains a Bacula labeled volume.  This is done
1053    initially when the daemon is started, and then at the beginning of each
1054    job.  If the This directive is particularly important if you have set
1055    {\bf Always Open = no} because it permits Bacula to attempt to read the
1056    device before asking the system operator to mount a tape.  However,
1057    please note that the tape must be mounted before the job begins.
1058
1059 \end{description}
1060
1061 \subsection*{Messages Resource}
1062 \label{MessagesResource1}
1063 \index[general]{Resource!Messages}
1064 \index[general]{Messages Resource}
1065 \addcontentsline{toc}{subsection}{Messages Resource}
1066
1067 For a description of the Messages Resource, please see the 
1068 \ilink{Messages Resource}{_ChapterStart15} Chapter of this
1069 manual. 
1070
1071 \subsection*{Sample Storage Daemon Configuration File}
1072 \label{SampleConfiguration}
1073 \index[general]{File!Sample Storage Daemon Configuration}
1074 \index[general]{Sample Storage Daemon Configuration File}
1075 \addcontentsline{toc}{subsection}{Sample Storage Daemon Configuration File}
1076
1077 A example Storage Daemon configuration file might be the following: 
1078
1079 \footnotesize
1080 \begin{verbatim}
1081 #
1082 # Default Bacula Storage Daemon Configuration file
1083 #
1084 #  For Bacula release 1.37.2 (07 July 2005) -- gentoo 1.4.16
1085 #
1086 # You may need to change the name of your tape drive
1087 #   on the "Archive Device" directive in the Device
1088 #   resource.  If you change the Name and/or the
1089 #   "Media Type" in the Device resource, please ensure
1090 #   that bacula-dir.conf has corresponding changes.
1091 #
1092 Storage {                               # definition of myself
1093   Name = rufus-sd
1094   Address = rufus
1095   WorkingDirectory = "$HOME/bacula/bin/working"
1096   Pid Directory = "$HOME/bacula/bin/working"
1097   Maximum Concurrent Jobs = 20
1098 }
1099 #
1100 # List Directors who are permitted to contact Storage daemon
1101 #
1102 Director {
1103   Name = rufus-dir
1104   Password = "ZF9Ctf5PQoWCPkmR3s4atCB0usUPg+vWWyIo2VS5ti6k"
1105 }
1106 #
1107 # Restricted Director, used by tray-monitor to get the
1108 #   status of the storage daemon
1109 #
1110 Director {
1111   Name = rufus-mon
1112   Password = "9usxgc307dMbe7jbD16v0PXlhD64UVasIDD0DH2WAujcDsc6"
1113   Monitor = yes
1114 }
1115 #
1116 # Devices supported by this Storage daemon
1117 # To connect, the Director's bacula-dir.conf must have the
1118 #  same Name and MediaType.
1119 #
1120 Autochanger {
1121   Name = Autochanger
1122   Device = Drive-1
1123   Device = Drive-2
1124   Changer Command = "/home/kern/bacula/bin/mtx-changer %c %o %S %a %d"
1125   Changer Device = /dev/sg0
1126 }
1127
1128 Device {
1129   Name = Drive-1                      #
1130   Drive Index = 0 
1131   Media Type = DLT-8000
1132   Archive Device = /dev/nst0
1133   AutomaticMount = yes;               # when device opened, read it
1134   AlwaysOpen = yes;
1135   RemovableMedia = yes;
1136   RandomAccess = no;
1137   AutoChanger = yes
1138   Alert Command = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'"
1139 }
1140
1141 Device {
1142   Name = Drive-2                      #
1143   Drive Index = 1
1144   Media Type = DLT-8000
1145   Archive Device = /dev/nst1
1146   AutomaticMount = yes;               # when device opened, read it
1147   AlwaysOpen = yes;
1148   RemovableMedia = yes;
1149   RandomAccess = no;
1150   AutoChanger = yes
1151   Alert Command = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'"
1152 }
1153
1154 Device {
1155   Name = "HP DLT 80"
1156   Media Type = DLT8000
1157   Archive Device = /dev/nst0
1158   AutomaticMount = yes;                 # when device opened, read it
1159   AlwaysOpen = yes;
1160   RemovableMedia = yes;
1161 }
1162 #Device {
1163 #  Name = SDT-7000                     #
1164 #  Media Type = DDS-2
1165 #  Archive Device = /dev/nst0
1166 #  AutomaticMount = yes;               # when device opened, read it
1167 #  AlwaysOpen = yes;
1168 #  RemovableMedia = yes;
1169 #}
1170 #Device {
1171 #  Name = Floppy
1172 #  Media Type = Floppy
1173 #  Archive Device = /mnt/floppy
1174 #  RemovableMedia = yes;
1175 #  Random Access = Yes;
1176 #  AutomaticMount = yes;               # when device opened, read it
1177 #  AlwaysOpen = no;
1178 #}
1179 #Device {
1180 #  Name = FileStorage
1181 #  Media Type = File
1182 #  Archive Device = /tmp
1183 #  LabelMedia = yes;                   # lets Bacula label unlabeled media
1184 #  Random Access = Yes;
1185 #  AutomaticMount = yes;               # when device opened, read it
1186 #  RemovableMedia = no;
1187 #  AlwaysOpen = no;
1188 #}
1189 #Device {
1190 #  Name = "NEC ND-1300A"
1191 #  Media Type = DVD
1192 #  Archive Device = /dev/hda
1193 #  LabelMedia = yes;                   # lets Bacula label unlabeled media
1194 #  Random Access = Yes;
1195 #  AutomaticMount = yes;               # when device opened, read it
1196 #  RemovableMedia = yes;
1197 #  AlwaysOpen = no;
1198 #  MaximumPartSize = 800M;
1199 #  RequiresMount = yes;
1200 #  MountPoint = /mnt/cdrom;
1201 #  MountCommand = "/bin/mount -t iso9660 -o ro %a %m";
1202 #  UnmountCommand = "/bin/umount %m";
1203 #  SpoolDirectory = /tmp/backup;
1204 #  WritePartCommand = "/etc/bacula/dvd-handler %a write %e %v"
1205 #  FreeSpaceCommand = "/etc/bacula/dvd-handler %a free"
1206 #}
1207 #
1208 # A very old Exabyte with no end of media detection
1209 #
1210 #Device {
1211 #  Name = "Exabyte 8mm"
1212 #  Media Type = "8mm"
1213 #  Archive Device = /dev/nst0
1214 #  Hardware end of medium = No;
1215 #  AutomaticMount = yes;               # when device opened, read it
1216 #  AlwaysOpen = Yes;
1217 #  RemovableMedia = yes;
1218 #}
1219 #
1220 # Send all messages to the Director,
1221 # mount messages also are sent to the email address
1222 #
1223 Messages {
1224   Name = Standard
1225   director = rufus-dir = all
1226   operator = root = mount
1227 }
1228 \end{verbatim}
1229 \normalsize