Explanation: Our tape library has multiple LTO drives, we have multiple amanda configs, but all of the amanda configs are sharing a single "database" (all of the chg-zd-mtx.* files). Each amanda config (by name: dailyset, archive, tapemgr) is using it's own tape drive, and there is also a local dds drive in the amanda server. The following table might explain it a bit better:
Use: Device: incidental dds /dev/nst0 dailyset (amanda) /dev/nst1 archive (amanda) /dev/nst2 tapemgr (amanda) /dev/nst3 The labelstr for tapemgr is very loose, and allows us to read tapes from either of the other two configs. Because we have a shared chg-zd-mtx "database", we could not put the driveslot variable into our chg-zd-mtx.conf file, as that caused all the configs to try to use that specific drive. (Actually, it was a bit worse than that. The tape would eject out of the correct drive, but the changer script would always send the robot arm to the first drive in the library.) The following patch successfully resolves that problem for us. In order for this patch to be of use to you, you will just need to set a "drivenumoffset" in your shared chg-zd-mtx.conf file. In our situation (described above), drivenumoffset=1 because /dev/nst0 is not used for amanda. NOTE: Works for us, might work for you. We think we're not adding any bugs. BTW, we like amanda. Thanks for all the work! -ron *** chg-zd-mtx.orig Thu Nov 13 14:45:07 2003 --- chg-zd-mtx Fri Nov 14 11:55:36 2003 *************** *** 631,636 **** --- 631,637 ---- varlist="$varlist driveslot" varlist="$varlist poll_drive_ready" varlist="$varlist max_drive_wait" + varlist="$varlist drivenumoffset" for var in $varlist do *************** *** 646,656 **** eval $var=\"$val\" done # Deal with driveslot first so we can get DBGFILE set if we are still # using the old amgetconf. if [ -z "$driveslot" ]; then ! driveslot=0; fi # Get DBGFILE set if it is not already. --- 647,665 ---- eval $var=\"$val\" done + # If drivenumoffset is not set, default to 0 so that it doesn't break + # any later calculations + + if [ -z "$drivenumoffset" ]; then + drivenumoffset=0 + fi + # Deal with driveslot first so we can get DBGFILE set if we are still # using the old amgetconf. if [ -z "$driveslot" ]; then ! drivenum=`echo $tape | sed -n "s/\/dev\/\(.*\)\([0-9][0-9]*\)\(.*\)/\2/p" ` ! driveslot=$[$drivenum-$drivenumoffset]; fi # Get DBGFILE set if it is not already.