• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 942
  • Last Modified:

bacula bscan access remote tape drive

Hi There

I want to re-catalog a tape that's been accidentally deleted from the bacula database (Postgres), however the tape hasn't been overwritten. I've looked at the problem at it seems as though I should use bacula's bscan utility.

I've got a bacula 5.2.10 director (bacula-dir) running under RedHat Linux 5.8 on one server - let's call this serverA and the bacula-sd running on another server -- let's call this ServerB that has the tape drive attached to it.

From ServerA I issue the command at the Linux prompt

#bscan -s -m -c bacula-sd.conf -v -V My_Tape_Vol01 /dev/nst0

and the following is displayed.

#bscan: butil.c:287 Using device: "/dev/nst0" for reading.
16-Sep 18:19 bscan JobId 0: Warning: acquire.c:239 Read open device "TapeStorage" (/dev/nst0) Volume "My_Tape_Vol01" failed: ERR=dev.c:513 Unable to open device "TapeStorage" (/dev/nst0): ERR=No such file or directory

Mount Volume "My_Tape_Vol01" on device "TapeStorage" (/dev/nst0) and press return when ready:

The above message is obvious as the Tape drive isn't attached to /dev/nst0 on ServerA

My Question is: How can I get bscan on ServerA to 'see' the tape drive on ServerB?

Lisa Shaw
Lisa Shaw
  • 4
  • 3
1 Solution
Can you try sharing the NFS file system from server B and mounting this for server A. I think this might work but not tried with tapes as I use disks for Bacula.

Lisa ShawAuthor Commented:
Many thanks for your comment and the url link.

I've thought of using NFS but the tape drive isn't a file-system (it's bacula stuff), and I think bacula's bscan wants to read the tape volume from /dev/nst0.  Is there a way in Linux to define a remote device accessible from another server?

BTW I copied the bacula-sd.conf file from ServerB to ServerA.
Wait! can't you run bscan from the bacula-sd server? I normally have bacula-dir and bacula-sd on same box, so do you get bconsole on the bacula-sd server?

I guess the file copy A-B is why it thinks it should see the device when run on the bacula-dir.
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Lisa ShawAuthor Commented:
Unfortunately the bacula-dir and bacula-sd are installed on different servers, bconsole works fine.

I attempted to run bscan from the bacula-sd I now get a different error.

1) I shutdown the bacula-sd
2) I mount the tape
    #mt -f /dev/nst0 rewind
3) #bscan -h bacula-dir-host -u bacula -P thePassword -s -m -c bacula-sd.conf -v -V My_Tape_Vol01 /dev/nst0

Now I get the following:

bscan JobId 0: Ready to read from volume "My_Tape_Vol01" on device "TapeStorage" (/dev/nst0).

bscan: ERROR TERMINATION at bscan.c:305
postgresql.c:248 Unable to connect to PostgreSQL server. Database=bacula User=bacula

Possible causes: SQL server not running; password incorrect; max_connections exceeded.

I can successfully logon to the Postgress DB (which is on the bacula-dir server) using the same login credetials.

The IP address for the bscan -h bacula-dir-host is defined correctly in /etc/hosts on the bacula-sd server (where I'm issuing the bscan command).

Clearly running bscan from the bacula-sd server cannot connect to the Postgres db!


Please have a look at enabling remote connectivity for postgre

Lisa ShawAuthor Commented:
The solution is Spot on!

You MUST run bacula's bscan from the same server (usually the bacula-sd) where the tape drive is attached. This solution works for me as the bacula-dir (postgres db) is on a different server.

Thanks again!!
Glad I could help!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now