Re: [Bacula-users] Bacula not autolabelling blank tapes.

2005-07-26 Thread Alan Brown


After about 10 minutes, the tape was rewound and labelled.

Either you are not waiting long enough after issuing the mtx load 
command, or you are not using one of the wait loops that are in the 
mtx-changer script. As a consequence, the mtx-changer script returns to 
Bacula *before* the tape is loaded and read, Bacula rewinds the drive, 
and gets an error.


The script default is 15 seconds.

Clearly this is long enough if the tape has something on the start, but 
not long enough if it's blank.


I have changed this to 30 (this is the usual sleep I use when scripting 
the weof across 60 virgin tapes - it's this that I was trying to get 
around)


I also looked at the wait_for_tape loop.

IMO checking the drive every second is excessive. 
I've changed it to check every 10 seconds for 3 minutes.


The pause is long enough for cases where the virgin tape has a EOF written to 
it or where the tape is labelled. I don't believe that's the problem.


But as it turned out, not long enough for a virgin tape.

There muct be some difference ion the handling and loading of blank vs 
erased tapes on LTO2 drives.


Can anyone else duplicate this?



---
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477alloc_id=16492op=click
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Bacula not autolabelling blank tapes.

2005-07-25 Thread Kern Sibbald
On Monday 25 July 2005 17:38, Alan Brown wrote:
 On Mon, 25 Jul 2005, Kern Sibbald wrote:
  What kind of output/debugging do you need to analyse and detect virgin
  blank tapes?
 
  I don't know of any way to detect blank media. If you know how, using
  standard Unix system calls, please fill me in.  In fact, there is
  generally, no universal Unix means of detecting that no medium is in the
  drive -- some OSes will tell you, but they are OS specific ioctl(),
  which I have now started adding to Bacula.
 
  I'm not 100% sure what the problem is.  I see your output, but I don't
  understand the problem.  Normally if you put up a blank tape and you
  want to label it, you will get an error message, and Bacula will go
  ahead and label it.

 It didn't - and autolabel is on

 I'm now getting a series of mail messages asking me to insert ALOW0041
 into tape drive 0, when it's already there:

 Data Transfer Element 0:Full (Storage Element 3 Loaded):VolumeTag =
 ALOW0041 Data Transfer Element 1:Empty

 As I said, writing a EOF at the start of the tape cures this problem and
 bacula will then happily label the tape.

  Are you telling me that in some cases it doesn't work that way?

 Yes.

  By the way, normally when it is not possible to rewind a drive, it is
  because there is no tape mounted.  I don't understand why there would be
  an error trying to rewind a drive containing a blank tape.  If that is
  the case, then I think your OS is broken.

 It's Linux, (Suse SLES-8), using 2.4.21-169-smp

  Before labeling a tape, Bacula does:
  - rewind
  - read
 
  If the rewind gets an error, Bacula assumes that something important is
  wrong and probably gives up or tries another tape if one is available.
 
  If the read fails, Bacula prints the error message and assumes it is a
  blank tape, rewinds it, writes the label, re-reads it, then rewinds
  again.
 
  My reading on the above errors you are seeing:
  In the above case, I suspect that you have an autochanger configuration
  error. Either you are not waiting long enough after issuing the mtx load
  command, or you are not using one of the wait loops that are in the
  mtx-changer script. As a consequence, the mtx-changer script returns to
  Bacula *before* the tape is loaded and read, Bacula rewinds the drive,
  and gets an error.

 The pause is long enough for cases where the virgin tape has a EOF
 written to it or where the tape is labelled. I don't believe that's the
 problem.


 (Bacula 1.36.3)

 the same error recurs AFTER the tape has been loaded:

 *stat dir
 [snippage]
6381 Increme  Low-churn-peace2.2005-07-23_01.16.02 is waiting for a
 mount request

 *stat storage=MSL6000-0

 Connecting to Storage daemon MSL6000-0 at msslas:9103

 msslas-sd Version: 1.36.3 (22 April 2005) i686-pc-linux-gnu suse 8.1
 Daemon started 27-May-05 11:04, 771 Jobs run since started.

 Running Jobs:
 Incremental Backup job Low-churn-peace2 JobId=6381 Volume=ALOW0041
 device=/dev/nst0
  Files=34,009 Bytes=108,343,509,235 Bytes/sec=479,474
  FDReadSeqNo=3,541,649 in_msg=3460041 out_msg=3539 fd=7


 [snippage]

 Device status:
 Archive FileStorage is not open or does not exist.
 Archive FileStorage2 is not open or does not exist.
 Device /dev/nst0 open but no Bacula volume is mounted.
  Device is BLOCKED waiting for appendable media.
  Total Bytes Read=0 Blocks Read=0 Bytes/block=0
  Positioned at File=0 Block=0
 Device /dev/nst1 open but no Bacula volume is mounted.
  Total Bytes Read=0 Blocks Read=0 Bytes/block=0
  Positioned at File=0 Block=0
 Data spooling: 1 active jobs, 8,464,729,317 bytes; 742 total jobs,
 50,000,033,440 max bytes/job.
 Attr spooling: 1 active jobs, 0 bytes; 742 total jobs, 1,130,787,541 max
 bytes.

 * mount MSL6000-0
 3001 OK mount. Device=/dev/nst0

 * stat storage=MSL6000-0

 [snippage]

 Device status:
 Archive FileStorage is not open or does not exist.
 Archive FileStorage2 is not open or does not exist.
 Device /dev/nst0 open but no Bacula volume is mounted.
  Device is being initialized.
  Total Bytes Read=0 Blocks Read=0 Bytes/block=0
  Positioned at File=0 Block=0
 Device /dev/nst1 open but no Bacula volume is mounted.
  Total Bytes Read=0 Blocks Read=0 Bytes/block=0
  Positioned at File=0 Block=0
 Data spooling: 1 active jobs, 8,464,729,317 bytes; 742 total jobs,
 50,000,033,440 max bytes/job.
 Attr spooling: 1 active jobs, 0 bytes; 742 total jobs, 1,130,787,541 max
 bytes.



 At this point the tape is loaded in the drive and has been for 48 hours.

 About 5 minuts later:

 *
 You have messages.

 *messages

 25-Jul 16:29 msslas-sd: 3301 Issuing autochanger loaded drive 0 command.
 25-Jul 16:29 msslas-sd: 3302 Autochanger loaded drive 0, result is Slot
 3.


 Meantiem at this point in a bash shell:

 # tapeinfo -f /dev/sg25

 Product Type: Tape Drive
 Vendor ID: 'HP  '
 Product ID: 'Ultrium 2-SCSI  '
 Revision: 'F38W'
 Attached Changer: No
 SerialNumber: 'HUL3G04548'
 MinBlock:1
 

Re: [Bacula-users] Bacula not autolabelling blank tapes.

2005-07-25 Thread Kern Sibbald
On Monday 25 July 2005 18:44, Alan Brown wrote:
 After about 10 minutes, the tape was rewound and labelled.

  Either you are not waiting long enough after issuing the mtx load
  command, or you are not using one of the wait loops that are in the
  mtx-changer script. As a consequence, the mtx-changer script returns to
  Bacula *before* the tape is loaded and read, Bacula rewinds the drive,
  and gets an error.

 The script default is 15 seconds.

 Clearly this is long enough if the tape has something on the start, but
 not long enough if it's blank.

 I have changed this to 30 (this is the usual sleep I use when scripting
 the weof across 60 virgin tapes - it's this that I was trying to get
 around)

 I also looked at the wait_for_tape loop.

 IMO checking the drive every second is excessive.
 I've changed it to check every 10 seconds for 3 minutes.

  The pause is long enough for cases where the virgin tape has a EOF
  written to it or where the tape is labelled. I don't believe that's the
  problem.

 But as it turned out, not long enough for a virgin tape.

 There muct be some difference ion the handling and loading of blank vs
 erased tapes on LTO2 drives.

 Can anyone else duplicate this?

Every time I load a tape in my DLT drive, it farbles around for about 2 or 3 
minutes until it is happy with the tape. If I attempt any I/O during that 
time, it will fail, and on older OSes, it can hang the program or hang the 
OS.

To get a good answer, you probably need to ask a tape drive manufacturer.

-- 
Best regards,

Kern

  (
  /\
  V_V


---
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477alloc_id=16492op=click
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Bacula not autolabelling blank tapes.

2005-07-25 Thread Phil Stracchino
Alan Brown wrote:
 
 Kern,
 
 This is the manifestation which happens when a _truely_ blank tape is
 loaded. (ie, virgin tape, just out of the wrapper.)
 
 23-Jul 03:43 msslas-sd: 3304 Issuing autochanger load slot 3, drive 0
 command.
 23-Jul 03:43 msslas-sd: 3305 Autochanger load slot 3, drive 0, status
 is OK.
 23-Jul 03:48 msslas-sd: Low-churn-peace2.2005-07-23_01.16.02 Warning:
 Couldn't rewind device /dev/nst0 ERR=dev.c:406 Rewind error on
 /dev/nst0. ERR=Input/output error.
 
 23-Jul 03:53 msslas-sd: 3301 Issuing autochanger loaded drive 0 command.
 23-Jul 03:53 msslas-sd: 3302 Autochanger loaded drive 0, result is
 Slot 3.
 23-Jul 03:58 msslas-sd: Low-churn-peace2.2005-07-23_01.16.02 Warning:
 Couldn't rewind device /dev/nst0 ERR=dev.c:406 Rewind error on
 /dev/nst0. ERR=Input/output error.
 
 
 mt -f /dev/nst0 weof solves the issue, but this needs to be sorted out
 properly.
 
 What kind of output/debugging do you need to analyse and detect virgin
 blank tapes?

I just labelled four brand new fresh-from-the-wrapper tapes like this on
 Friday.  Bacula threw some tape-related warning prior to labelling
them, but labelling worked just fine without having to do anything else.


-- 
 Phil Stracchino   [EMAIL PROTECTED]
Renaissance Man, Unix generalist, Perl hacker
 Mobile: 603-216-7037 Landline: 603-886-3518


---
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477alloc_id=16492op=click
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Bacula not autolabelling blank tapes.

2005-07-25 Thread Kern Sibbald
Well, I'm glad you found the problem.

I'm upped the default from 180 to 300 in the 1.37 mtx-changer script, 
but you might also want to take note that the latest script is a bit less 
system dependent:

wait_for_drive() {
  i=0
  while [ $i -le 300 ]; do  # Wait max 300 seconds
if mt -f $1 status | grep ONLINE  /dev/null 21; then
  break
fi
#   echo Device $1 - not ready, retrying...
sleep 1
i=`expr $i + 1`
  done
}


On Monday 25 July 2005 19:25, Alan Brown wrote:
 On Mon, 25 Jul 2005, Alan Brown wrote:
  The script default is 15 seconds.

 More tests showed the problem.

 A formatted (erased or written) LTO2 tape loads in 14 seconds.

 An unformatted (new blank) LTO2 tape loads in 16

  Clearly this is long enough if the tape has something on the start, but
  not long enough if it's blank.

 By a whole 1 second! Who would have thought it?

 I've checked this across a selection of unformatted and formatted tapes on
 2 different drives and it's fully consistent.

 The mods to mtx-changer to achieve the check:


 --- mtx-changer.old 2005-03-16 13:14:46.0 +
 +++ mtx-changer 2005-07-25 18:06:19.0 +0100
 @@ -42,13 +42,16 @@
   #  the $(seq 180) to $(jot 180) -- tip from Brian McDonald
   #
   wait_for_drive() {
 -  for i in $(seq 180); do   # Wait max 180 seconds
 +  cycles=0
 +  for i in $(seq 300); do   # Wait max 300 seconds
 +cycles=`expr $cycles + 1`
   if mt -f $1 status | grep ONLINE  /dev/null 21; then
 break
   fi
   #   echo Device $1 - not ready, retrying...
   sleep 1
 done
 +  echo Device $1 ready in  $cycles  seconds.
   }


 @@ -114,8 +117,8 @@
   #
   # Increase the sleep time if you have a slow device
   # or remove the sleep and add the following:
 -# wait_for_drive $device
 -  sleep 15
 + wait_for_drive $device
 +#  sleep 30
 exit $rtn
 ;;

-- 
Best regards,

Kern

  (
  /\
  V_V


---
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477alloc_id=16492op=click
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users