Bacula-users

Re: [Bacula-users] Ensuring Bacula uses the new tapes

2010-10-28 09:30:01
Subject: Re: [Bacula-users] Ensuring Bacula uses the new tapes
From: Bill Arlofski <waa-bacula AT revpol DOT com>
To: bacula-users AT lists.sourceforge DOT net
Date: Thu, 28 Oct 2010 09:27:05 -0400
On 10/27/10 12:23, Romer Ventura wrote:
> Hello,
> 
>     Recently i've been having a lot of problems when replacing tapes.
> For example: i put in 8 tapes into scratch pool, then each job pulls
> tapes from there into their respective pools, then when the month goes
> by and i replace the tapes with 8 new tapes, bacula still wants to use
> the tapes i removed even when i do update slots, and indicate
> Autochanger = yes on the config.
> 
>     So what can i do to ensure that when i replace the tapes, the new
> tapes are actually used instead of getting the error "manual mount might
> be required".


Hi Romer (OOPS! I wrote a whole reply before noticing that you have run the
update slots command)  I'll leave my original reply below this one, because it
may help someone else with a similar issue,  but I suspect your problem is
that you are not labeling your tapes by their barcodes.

If your changer supports barcodes, you need to use the "label barcodes"
command in which case Bacula will ask a couple question (which pool etc) and
will then cycle each tape into the drive, label it by its barcode and put it
back into its slot in the changer.

You can not label them with human friendly names, since Bacula will query the
changer for the barcodes of the tapes in the slots and the changer does not
know about the human readable labels that may have been manually written to
the tapes.

BTW, you can do a list media to see what tapes bacula thinks are in which
slots.  Look at the "Slot" and "In Changer" columns to confirm that Bacula
knows where your tapes are.

Hope this helps.

--
Bill Arlofski
Reverse Polarity, LLC




--[original reply when I thought your question was differnt  :)  ]--

The command you are looking  for is "update slots"

As long as your tapes have bar codes on them, and they have been labeled with
the "label barcodes" command, the update slots command will update the media
database so that bacula knows which tape is currently in the changer and in
which slot each tape resides.

What I do is create an "Update Slots" job that is configured to run at the
same time as my nightly backups but with a higher priority so it always runs
first.  This way I never really have to remember to manually run the update
slots command unless I need to run a restore or backup job manually after
media replacement, and before the nightly jobs run.

The Update Slots job def looks like this:

--[snip]--
# ----------------
# # Update Slots Job
# # ----------------
Job {
  Name = UpDateSlots
  Client = None
  Type = Admin
  FileSet = None
  Storage = c0
  Schedule = WeeklyToOffsiteDisk
  Messages = Standard
  Priority = 8
  SpoolData = no
  Pool = Default

  RunScript {
    RunsWhen = Before
    RunsOnClient = no
    Fail Job On Error = no
    Command = "/usr/local/sbin/runbefore-updateslots.sh"
  }
}
--[snip]--

and /usr/local/sbin/runbefore-updateslots.sh looks like this:


--[snip]--
#!/bin/bash
#
BC="/usr/sbin/bconsole"
CONF="/etc/bacula/include/bconsole-SITENAME.conf"
STORAGE="c0"

$BC -c $CONF << EOF
update slots storage=$STORAGE
quit
EOF
--[snip]--


Hope this helps.

--
Bill Arlofski
Reverse Polarity, LLC

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users