Arno Lehmann wrote:
> Hi,
>
> 04.12.2008 19:41, Steve Thompson wrote:
>   
>> Bacula 2.4.2.
>>
>> I have just added a second pool to an all-disk configuration and have a 
>> question concerning automatic volume numbering. The relevant details are:
>>
>> Pool {
>>      Name = Foo_Pool
>>      Storage = Foo_Storage
>>      Label Format = "Foo-"
>>      ...
>> }
>>
>> Pool {
>>      Name = Bar_Pool
>>      Storage = Bar_Storage
>>      Label Format = "Bar-"
>>      ...
>> }
>>
>> Single catalog. When the second pool was added, there were 3260 volumes in 
>> Foo_Pool (from Foo-0001 to Foo-3260). Everything works, but the first 
>> backup that went to Bar_Pool created a volume called Bar-3261, when I was 
>> expecting Bar-0001. Why is this?
>>     
>
> That's because Bacula uses the overall number of known volumes, not 
> the number of volumes per pool. This decreases the probability that it 
> tries to create a volume which already exists (though it doesn't 
> absolutely prevent that).
>
> Just imagine that you delete one volume from the pool - the next one 
> automatically created will get an existing name.
>
> In setups where the volume names are expected to be numbered 
> sequentially, I just create the volumes manually (or by script, if a 
> large number of volumes will be needed).
>
> Arno
>   
Actually, bacula doesn't use the overall number of known volumes, but 
rather the media ID - which, I believe, is a database key. So if you 
keep creating and deleting volumes, the number will still increment.

Interestingly, if you use variable expansion, bacula *will* use the 
number of volumes in the pool (there is, as far as I can tell, no 
variable "mediaID") - and it may indeed cause the collision you mention.

Suggestion: if bacula detects such a collision using the number of 
volumes in the pool, use the next-lower number, and keep decrementing 
until it finds an available one (mathematically, there will always be 
one before the counter reaches zero). This will allow you to "backfill" 
the pool.

-- 
Kevin Keane
Owner
The NetTech
Turn your NetWORRY into a NetWORK!

Office: 866-642-7116
http://www.4nettech.com

This e-mail and attachments, if any, may contain confidential and/or 
proprietary information. Please be advised that the unauthorized use or 
disclosure of the information is strictly prohibited. The information herein is 
intended only for use by the intended recipient(s) named above. If you have 
received this transmission in error, please notify the sender immediately and 
permanently delete the e-mail and any copies, printouts or attachments thereof.


------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to