Bacula-users

Re: [Bacula-users] Unable to position to end of data on device

2013-09-25 11:30:29
Subject: Re: [Bacula-users] Unable to position to end of data on device
From: "Clark, Patricia A." <clarkpa AT ornl DOT gov>
To: Bacula Users <bacula-users AT lists.sourceforge DOT net>
Date: Wed, 25 Sep 2013 11:27:29 -0400
Deepak-

I am removing all of the thread as it is becoming messy and useless.
Second, Radosław is trying to tell you that your udev rules are incorrect
for the tape drive references and that your tape changer needs a udev rule
to keep it persistent, too.  You can use the persistent names provided by
the system at his suggestion however they are long and not easily
referenced when manual management is required.  Your current bacula cannot
work until your devices are correct and bacula can put tapes into devices
consistently.

Do not use the same names as the system for st, sg, or nst for your
persistent udev rules names.  Consider them "reserved".  Select something
else that is more meaningful, unique, and relatively short.  I have an
example of a rule for an autochanger and a rule for a tape drive below.  I
also use IBM LTO-5 tape drives and I use the default st driver.  I have a
Spectra Logic autochanger that is partitioned which makes it virtualized
which gave me an extra headache in that the scsi_id is identical across
the virtuals.  I have not included that udev rule so as to not muddy the
waters.  If someone would like an example, ask and I will post.

First: Produce a list of your scsi devices
lsscsi -g
>>From your previous post:
[root@bacula conf.d]# lsscsi -g | grep IBM
[0:0:0:0]    disk    IBM-ESXS ST9146852SS      B626  -         /dev/sg0
[0:0:1:0]    disk    IBM-ESXS ST9146852SS      B626  -         /dev/sg1
[1:0:0:1]    disk    IBM      1818      FAStT  0730  /dev/sdd   /dev/sg12
[1:0:0:31]   disk    IBM      Universal Xport  0730  -         /dev/sg13
[1:0:1:0]    tape    IBM      ULT3580-TD4      B710  /dev/st4   /dev/sg14
[1:0:2:0]    tape    IBM      ULT3580-TD4      B710  /dev/st5   /dev/sg15
[1:0:3:0]    tape    IBM      ULT3580-TD4      B710  /dev/st6   /dev/sg16
[1:0:4:0]    tape    IBM      ULT3580-TD4      B710  /dev/st7   /dev/sg17
[1:0:4:1]    mediumx IBM      03584L32         7440  /dev/sch1  /dev/sg18
[1:0:5:1]    disk    IBM      1818      FAStT  0730  /dev/sde   /dev/sg19
[1:0:5:31]   disk    IBM      Universal Xport  0730  -         /dev/sg20
[1:0:6:1]    disk    IBM      1818      FAStT  0730  /dev/sdg   /dev/sg23
[1:0:6:31]   disk    IBM      Universal Xport  0730  -         /dev/sg24
[1:0:7:1]    disk    IBM      1818      FAStT  0730  /dev/sdi   /dev/sg27
[1:0:7:31]   disk    IBM      Universal Xport  0730  -         /dev/sg28
[2:0:0:1]    disk    IBM      1818      FAStT  0730  /dev/sdb   /dev/sg3
[2:0:0:31]   disk    IBM      Universal Xport  0730  -         /dev/sg4
[2:0:1:1]    disk    IBM      1818      FAStT  0730  /dev/sdc   /dev/sg5
[2:0:1:31]   disk    IBM      Universal Xport  0730  -         /dev/sg6
[2:0:2:0]    tape    IBM      ULT3580-TD4      B710  /dev/st0   /dev/sg7
[2:0:3:0]    tape    IBM      ULT3580-TD4      B710  /dev/st1   /dev/sg8
[2:0:4:0]    tape    IBM      ULT3580-TD4      B710  /dev/st2   /dev/sg9
[2:0:4:1]    mediumx IBM      03584L32         7440  /dev/sch0  /dev/sg10
[2:0:5:0]    tape    IBM      ULT3580-TD4      B710  /dev/st3   /dev/sg11
[2:0:6:1]    disk    IBM      1818      FAStT  0730  /dev/sdf   /dev/sg21
[2:0:6:31]   disk    IBM      Universal Xport  0730  -         /dev/sg22
[2:0:7:1]    disk    IBM      1818      FAStT  0730  /dev/sdh   /dev/sg25
[2:0:7:31]   disk    IBM      Universal Xport  0730  -         /dev/sg26
[root@bacula conf.d]#


Second:
To get the scsi_id run the following command against each device,
autochanger or tape drive.  I have select one tape drive and one
autochanger entry from your list - these commands will produce the scsi_id
for the udev rule.  The "--whitelisted" option is required.  If you want
to see all of the information for the device add "--export" to the end of
the command.  I am going to make up the scsi_id as it does not appear in
your examples, you are using the ID_SCSI_SERIAL attribute.  This can be
used, but there is a more complex udev rule to use it.

# scsi_id --whitelisted --device=/dev/st0
321110090a5004532
# scsi_id --whitelisted --device=/dev/sg10
3221f0090a5004532

Third:

Now my udev rules for these two devices.  The scsi_id goes where
"RESULT==", use either exact match or use regular expressions as long as
they produce unique matches.  I have "*" on either end of the tape drive
scsi_id.


KERNEL=="sg*", SUBSYSTEM=="scsi_generic", PROGRAM="/sbin/scsi_id
--whitelisted --replace-whitespace /dev/$name",
RESULT=="3221f0090a5004532", ATTRS{type}=="8", SYMLINK+="mychanger"

KERNEL=="nst*[0-9]", SUBSYSTEM=="scsi_tape", PROGRAM="/sbin/scsi_id
--whitelisted --replace-whitespace /dev/$name",
RESULT=="*321110090a5004532*", SYMLINK+="mytape-0"

Last:
Each reboot should produce consistent /dev/mychanger and /dev/mytape-0
devices that should be used in your bacula configuration.  Make sure that
you test with your OS commands and bconsole commands verifying that the
tape that you mounted matches in both places - load/unload different tapes
into different drives.  Reboot and make sure it still has everything where
you had it, otherwise there is an error somewhere in your udev rules.
When this is clean and consistent, then exercise bacula backups.



Patti Clark
Linux System Administrator
Research and Development Systems Support Oak Ridge National Laboratory


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users