Iñaki,

Thank you for this. indeed, i've had this problem.
Gonna use your script!


--Thib


----- Mail original -----
De: "itlinux_igtp" <itli...@igtp.cat>
À: bacula-users@lists.sourceforge.net
Cc: krashoverr...@free.fr
Envoyé: Jeudi 11 Janvier 2018 09:56:34
Objet: Re: [Bacula-users] Autochanger best practicies

Hi Thibault,

 From what I recall of my bacula install, it is better to set the 
Changer Device to a linked device that is updated on boot, as /dev/sg3 
might be the autochanger but in a reboot could become a drive and the 
autochanger move to /dev/sg2 (for example). I use the following script 
run after reboot to set the autochager properly:

#! /bin/bash

# Find the autochanger device and create the /dev/changer link

for i in /dev/sg{0..4}# the range might be different for you!
do
   if (tapeinfo -f $i|grep "Medium Changer"); then
     logger -t rclocal "Will create changer link to $i"
     if readlink /dev/changer; then
       unlink /dev/changer
       logger -t rclocal "Removed an existing /dev/changer link"
     fi
     ln -s $i /dev/changer
   fi
done



Regards,
Iñaki


On 01/11/2018 08:53 AM, krashoverr...@free.fr wrote:
> Hello Bacula Users community,
>
> I need advices/best practicies about configuration of an Autochanger
> I've read the documentation on bacula website, and it works like a charm, 
> except one point
>
> First of all,
>
> - bacula-dir / bacula-sd / bacula-fd version 7.4.4 / SQLite -- running on a 
> Debian 9 virtualized server
> - Autochanger is a DELL PowerVault TL1000 with an LTO 6 drive -- Firmware up 
> to date
> - tapes have a code39 barcode
> - server / autochanger is on a remote location, I don't have physical access 
> to it
>
> ----
>
> Storage {
>    Name = Changer_TL1000
>    Password = "hellothere"
>    Address = servername
>    SDPort = 9103
>    Device = TL1000
>    Media Type = LTO-6
>    Heartbeat Interval = 60
>    Autochanger = yes
>    Maximum Concurrent Jobs = 20
> }
>
> Autochanger {
>    Name = Changer_TL1000
>    Device = TL1000
>    Changer Command = "/etc/bacula/scripts/mtx-changer %c %o %S %a %d"
>    Changer Device = /dev/sg3
> }
>
> Device {
>    Name = TL1000
>    Archive Device = /dev/nst0
>    Media Type = LTO-6
>    LabelMedia = yes
>    Random Access = yes
>    AutomaticMount = yes
>    RemovableMedia = Yes
>    AlwaysOpen = yes
>    AutoChanger = yes
>    Check Labels = yes
>    Alert Command = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'"
>    Spool Directory = /opt/bacula/spool
>    Maximum Spool Size = 50GB
>    Maximum Network Buffer Size = 65536
>    Maximum job Spool Size = 15GB
> }
>
> The problem occurs when I want to label a tape. It does not seems to label 
> the tape, but instead the "drive".
> There's something I must have misunderstood in the config.
>
> For example, the drive was loaded with tape called VGOBQ001.
> I've asked my local contact to set a new tape into the drive, and label it 
> with the bconsole "label" command, what he did (label : VGOBM002)
> When I "list volume" on bconsole, I can see the volume VGOBM002 has been 
> successfully created.
>
> He left VGOBM002 tape in the drive. Today's backup starts, and needs 
> VGOBQ001. Bacula unloads the drive, and loads the correct tape.
> Here's the log
>
> JobId 23: 3307 Issuing autochanger "unload slot 1, drive 0" command for vol 
> VGOBQ001.
> JobId 23: 3304 Issuing autochanger "load slot 3, drive 0" command for vol 
> VGOBQ001.
> JobId 23: 3305 Autochanger "load slot 3, drive 0", status is OK for vol 
> VGOBQ001.
> JobId 23: Error: The Volume= on device=VGOBM002 appears to be unlabeled.  
> #What the hell ?
> JobId 23: Volume "VGOBQ001" previously written, moving to end of data.
> JobId 23: Ready to append to end of Volume "VGOBQ001" at file=3160.
>
> Then the job starts with the correct VGOBQ001 tape.
> The problem is the Error line, how can my volume has no label, but my device 
> has one ?
> Did i miss something in the config ?
>
> Thank you for your support,
>
> Thibault
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Bacula-users mailing list
> Bacula-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bacula-users


-- 

Iñaki Martinez de Ilarduya Muñoz
Systems Administrator IGTP
e-mail: itli...@igtp.org
Tel (+34) 93 554-3079
Fax (+34) 93 465-1472

Germans Trias i Pujol Research Institute (IGTP)
Ctra de Can Ruti, Camí de les Escoles s/n
08916 Badalona, Barcelona,
Spain
www.germanstrias.org


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to