LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Bacula + vchanger: bconsole "label barcodes" does not find the autochanger (https://www.linuxquestions.org/questions/linux-software-2/bacula-vchanger-bconsole-label-barcodes-does-not-find-the-autochanger-791897/)

catkin 02-27-2010 01:11 AM

Bacula + vchanger: bconsole "label barcodes" does not find the autochanger
 
Hello :)

This problem is almost certainly caused by my mis-configuring something but I can't find what (it's almost exactly from the setup instructions) and I don't know how to investigate further.

Sorry this post is so long but all of the information given may be essential.

Setting up Bacula + vchanger 0.8.5, following instructions in the vchanger 0.8.5 tarball's doc/vchangerHowto.html (excellent). Using a USB HDD. Got to the step of using bconsole to issue "label barcodes" command. Output was
Code:

Automatically selected Catalog: MyCatalog
Using Catalog "MyCatalog"
Automatically selected Storage: File
Connecting to Storage daemon File at ps1:9103 ...
3995 Device "FileStorage" (/tmp) is not an autochanger.
Device "FileStorage" has 0 slots.
No slots in changer to scan.

Which showed that the new virtual Autochanger was not found. Started bacula-sd in foreground debug mode from the command line:
Code:

root@ps1:~# bacula-sd -u bacula -g bacula -d 100 -f -c /etc/bacula/bacula-sd.conf
bacula-sd: stored_conf.c:698-0 Inserting director res: ps1-mon
bacula-sd: stored_conf.c:698-0 Inserting device res: usb-changer-drive-0
ps1-sd: jcr.c:140-0 read_last_jobs seek to 188
ps1-sd: jcr.c:147-0 Read num_items=2
ps1-sd: stored.c:534-0 calling init_dev /tmp
ps1-sd: dev.c:285-0 init_dev: tape=0 dev_name=/tmp
ps1-sd: stored.c:536-0 SD init done /tmp
ps1-sd: stored.c:534-0 calling init_dev /var/bacula/changer1/0/drive0
ps1-sd: dev.c:285-0 init_dev: tape=0 dev_name=/var/bacula/changer1/0/drive0
ps1-sd: stored.c:536-0 SD init done /var/bacula/changer1/0/drive0
ps1-sd: autochanger.c:273-0 Run program=/usr/local/bin/vchanger /etc/bacula/changer1.conf loaded 0 /var/bacula/changer1/0/drive0 0
ps1-sd: bnet_server.c:96-0 Addresses host[ipv4:0.0.0.0:9103]
ps1-sd: autochanger.c:275-0 run_prog: /usr/bin/vchanger /etc/bacula/changer1.conf loaded 0 /var/bacula/changer1/0/drive0 0 stat=268435664 result=ps1-sd: stored.c:549-0 calling first_open_device "usb-changer-drive-0" (/var/bacula/changer1/0/drive0)

And there it stopped. Plugged in the USB HDD. df showed it hadn't automounted. Inspected /var/bacula/changer1/0/drive0 and found it empty. Viewed vchanger log /var/bacula/changer1/changer1.log and found no messages from today. Viewed Bacula log /var/bacula/log and found no messages from today [strange?!].

Checked that vchanger was able to trigger automounting by
Code:

root@ps1:~# vchanger -u bacula -g bacula /etc/bacula/changer1.conf listmags
1:changer1:1:/mnt/vchanger/efa8a079-ab80-41c9-b018-85810dd3c45d
root@ps1:~# df
Filesystem          1K-blocks      Used Available Use% Mounted on
[snip]
/dev/sdb1            488237820    59800 488178020  1% /mnt/vchanger/efa8a079-ab80-41c9-b018-85810dd3c45

OK. Still no progress from bacula-sd running at command prompt until started bconsole and tried "label barcodes" again when got
Code:

ps1-sd: bnet.c:669-0 who=client host=192.168.1.41 port=36643
ps1-sd: cram-md5.c:73-0 send: auth cram-md5 <691048060.1267249865@ps1-sd> ssl=0
ps1-sd: cram-md5.c:133-0 cram-get received: auth cram-md5 <1496701667.1267249865@ps1-dir> ssl=0
ps1-sd: cram-md5.c:152-0 sending resp to challenge: V8/vdTZWgk/gn88JX//KQC
ps1-sd: dircmd.c:213-0 Message channel init completed.
ps1-sd: dircmd.c:588-0 Found device FileStorage
ps1-sd: dircmd.c:628-0 Found device FileStorage

Here is bacula-sd.conf
Code:

root@ps1:/etc/bacula# grep -E -v '^$|^#' bacula-sd.conf
Storage {                            # definition of myself
  Name = ps1-sd
  SDPort = 9103
  WorkingDirectory = "/var/bacula"
  Pid Directory = "/var/run"
  Maximum Concurrent Jobs = 20
}
Director {
  Name = ps1-dir
  Password = "<not shown>"
}
Director {
  Name = ps1-mon
  Password = "<not shown>"
  Monitor = yes
}
Device {
  Name = FileStorage
  Media Type = File
  Archive Device = /tmp
  LabelMedia = yes;                  # lets Bacula label unlabeled media
  Random Access = Yes;
  AutomaticMount = yes;              # when device opened, read it
  RemovableMedia = no;
  AlwaysOpen = no;
}
Autochanger {
  Name = usb-changer
  Device = usb-changer-drive-0
  Changer Command = "/usr/bin/vchanger %c %o %S %a %d"
  Changer Device = "/etc/bacula/changer1.conf"
}
Device {
  Name = usb-changer-drive-0
  DriveIndex = 0
  Autochanger = yes;
  DeviceType = File
  MediaType = File
  ArchiveDevice = /var/bacula/changer1/0/drive0
  RemovableMedia = no;
  RandomAccess = yes;
}
Messages {
  Name = Standard
  director = ps1-dir = all
}

Here is vchanger's changer1.conf
Code:

root@ps1:/etc/bacula# grep -E -v '^$|^#' changer1.conf
changer_name = "changer1"
work_dir = "/var/bacula/changer1"
logfile = "/var/bacula/changer1/changer1.log"
  Virtual_Drives = 1
slots_per_magazine = 5
magazine_bays = 1
automount_dir = /mnt/vchanger
magazine = "UUID:efa8a079-ab80-41c9-b018-85810dd3c45d"

What to do?

Best

Charles

catkin 02-28-2010 08:16 AM

The necessary Storage definition was missing from bacula-dir.conf:
Code:

# Virtual autochanger based on USB HDD drive
Storage {
  Name = changer1
  Address = ps1
  Password = "<not shown>"
  Device = usb-changer  # name of the Autochanger resource in bacula-sd.conf
  Media Type = File
  Autochanger = yes;
}



All times are GMT -5. The time now is 10:40 AM.