Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help Labeling Tapes

Status
Not open for further replies.

unixgy

Technical User
Dec 28, 2001
36
US
Hello.

I am using Networker 6.1.1 on Solaris 8. I have an L1000 library with 30 slots.

Currently, every morning we are removing the used tapes from the nightly backup, putting new ones in and re-labeling ALL the tapes via a script (Even the unused ones from the night before). Is there a way to only label the newly deposited tapes?

Any help is greatly appreciated!
 
The "mminfo" command can output the volumes that haven been used newly and the you may use the "nsrjb" command to lable the tape.

Example:
/usr/sbin/mminfo -a -q &quot;volrecycle=false,savetime<8 days ago,pool=ByDataDay,location=EXB-220&quot; -r &quot;volume&quot; 2>/dev/null | grep -v volume > /nsr/backup/TAPEcycle.tab
if [ $? -eq 0 ]; then
for volid in `cat /nsr/backup/TAPEcycle.tab`
do
if [ -n $volid ]; then
/usr/sbin/nsrjb -o recyclable -Y $volid
fi
done
fi
if [ -f /nsr/backup/TAPEcycle.tab ]; then
rm /nsr/backup/TAPEcycle.tab
fi

Please see the manual of &quot;mminfo and nsrjb&quot;

Hope this help

dansz
dansz007@msn.com
 
I do a very similar thing, but I'm using an IBM 3494 silo.

What you do to find out is how to take an inventory of the device directly, not through Networker. For example, for my device, it's &quot;mtlib -f/dev/lmcp0 -qI&quot; or something close to that.

Once you have that, it should be a simple matter to compare that list to what Networker thinks is in your device, (assuming the newly added tapes haven't been &quot;nsrjb -a&quot;'d yet), and thus add and label them. My next post in this thread will be the script I use.
 
#!/bin/ksh

UNIQUE=$$


#echo &quot;Inventorying Silo...&quot;
mtlib -l/dev/lmcp0 -qI | grep &quot;^[EN]&quot; > /tmp/LIBINV.${UNIQUE}

#echo &quot;Inventorying Legato...&quot;
nsrjb | grep &quot;^........[EN]&quot; | sed s/&quot;(A)&quot;/&quot;&quot;/g | sed s/&quot;(R)&quot;/&quot;&quot;/g > /tmp/LEGINV.${UNIQUE}

#echo &quot;Collecting Legato Location data...&quot;
mmlocate | grep &quot;ftwsilo&quot; > /tmp/LOCATE.${UNIQUE}

#echo &quot;Comparing Silo inventory with Legato inventory...&quot;
cat /tmp/LIBINV.${UNIQUE} | while read TAPE MISC
do
COUNT=`grep ${TAPE} /tmp/LEGINV.${UNIQUE} | wc -l`
if test ${COUNT} -eq 0
then
#echo &quot;Silo has ${TAPE}, Legato does not&quot;
echo &quot;SILO ${TAPE}&quot;
fi
done

#echo &quot;Comparing nsrjb inventory to Silo...&quot;
cat /tmp/LEGINV.${UNIQUE} | while read SLOT TAPE MISC
do
COUNT=`grep ${TAPE} /tmp/LIBINV.${UNIQUE} | wc -l`
if test ${COUNT} -eq 0
then
#echo &quot;Legato nsrjb has ${TAPE}, but it's not in the silo&quot;
echo &quot;NSRJB ${TAPE}&quot;
fi
done

#echo &quot;Comparing mmlocate data to Silo inventory...&quot;
cat /tmp/LOCATE.${UNIQUE} | while read TAPE MISC
do
COUNT=`grep ${TAPE} /tmp/LIBINV.${UNIQUE} | wc -l`
if test ${COUNT} -eq 0
then
#echo &quot;Legato location of ${TAPE} is silo, but it's not there&quot;
echo &quot;MMLOCATE ${TAPE}&quot;
fi
done

rm /tmp/LIBINV.${UNIQUE}
rm /tmp/LEGINV.${UNIQUE}
rm /tmp/LOCATE.${UNIQUE}
 
One way is to remember which slots you put the new tapes in and just label those slots. If you can't remember, then inventory your library. Any new tapes will have an &quot;*&quot; by them when you look at the volumes with the &quot;nsrjb -v&quot; command (meaning they are not in the media database). At this point label those tapes, either thru the GUI or using: &quot;nsrjb -LY -S (slot number or numbers). You can specify a specific drive with the -f switch, but if you don't then it will use all available drive to label those volumes.
 
If your library supports iding tapes by label, I strongly recommend using that (-T) instead of slot number (-S).

This may be specific to 3494, but as tapes are added or removed, their slot numbers in Networker change. Another admin was doing a round of label-by-slot-number one day right after I'd told NW to withdraw 30 tapes. The slots of the tapes they wanted to relabel were changed to different tapes, and they ended up wiping out 30 other tapes of data.
 
Thanks for all the responses.

What I have been able to do is:
1) Switch the used tapes
2) Run nsrjb -IE
3) Run mminfo -q 'location=<jukebox>,%used > 0' -r 'volume'
to get the volumes which need to be labeled

The bummer is we have different pools for each set of slots. And I would like to be able to label on all 4 drives at the same time. So I need to determine which slot the volume is in to label it appropriately and I need to somehow utilize all 4 drives.

Any more ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top