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 2>&1; 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.000000000 +0000
> +++ mtx-changer 2005-07-25 18:06:19.000000000 +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 2>&1; 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=7477&alloc_id=16492&op=click
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to