Legato question about tape redundancy

  • Follow


Hi,
I have installed a legato system 7.2.1 for a customer on solaris. We
have a set of full tapes and set of incrementals. The tapes are L203's
so have a lot of capacity. The customer is concerned that he is writing
to the same full backup tape for 2 months in a row and asked if every
week he could write to a different full tape (just in case this tape
gets knackered)

I did say you could unmount a full tape and mount another one as i
think legato will just use whats there. Is there an automatic way to do
it in legato, or will I have to write a script? There are 5 full tapes,
so i guess i would have to write one to mount each one in turn?

Thanks

0
Reply cconnell_1 (83) 1/4/2006 9:56:55 AM

Have a look at the 'nsrmm' man page.  This is a command-line tool for
mounting/unmounting/labelling tapes, and can be incorporated into
scripts.

0
Reply tkevans 1/4/2006 4:41:11 PM


cconnell_1@lycos.com wrote:
> Hi,
> I have installed a legato system 7.2.1 for a customer on solaris. We
> have a set of full tapes and set of incrementals. The tapes are L203's
> so have a lot of capacity. The customer is concerned that he is writing
> to the same full backup tape for 2 months in a row and asked if every
> week he could write to a different full tape (just in case this tape
> gets knackered)

Under normal cases, networker writes to a tape until it fills, then
moves to another tape.  Are you not filling a single tape in 2 months
time?

> I did say you could unmount a full tape and mount another one as i
> think legato will just use whats there. Is there an automatic way to do
> it in legato, or will I have to write a script? There are 5 full tapes,
> so i guess i would have to write one to mount each one in turn?

I don't understand, are there 5 tapes or one?   You can mount/unmount
easily with the 'nsrjb' command (assuming an autochanger/jukebox).

If you have multiple drives, 'cloning' or 'staging' is often the best
way to handle this.  It will copy the data from the first backup and
ensure that it is written to a completely separate tape.  Any errors in
reading the first tape might be discovered immediately rather than
months later when you need the data.

Now, you've proved your first backup can be read, and you've copied it
to a second volume (which you can store elsewhere if you'd prefer).

-- 
Darren Dunham                                           ddunham@taos.com
Senior Technical Consultant         TAOS            http://www.taos.com/
Got some Dr Pepper?                           San Francisco, CA bay area
         < This line left intentionally blank to confuse you. >
0
Reply Darren 1/4/2006 7:08:52 PM

Hello,
Yes the full tape will be full in 2 months time as its about 10 % full,
we have five full tapes and five incrementals.
We dont have mulitple drives, so the customer wants the full tapes to
be rotated each week as opposed to putting all of the full backups on
one tape for the 2 month period, to spread them over the other tapes a
bit.
Thanks
Chrs

0
Reply cconnell_1 1/4/2006 9:57:59 PM

cconnell_1@lycos.com wrote:
> Hello,
> Yes the full tape will be full in 2 months time as its about 10 % full,
> we have five full tapes and five incrementals.
> We dont have mulitple drives, so the customer wants the full tapes to
> be rotated each week as opposed to putting all of the full backups on
> one tape for the 2 month period, to spread them over the other tapes a
> bit.

Some ideas:

*) Hack a script to put a different appendable tape in the drive prior
   to the backup.  Networker will use an appendable tape already mounted
   over one not mounted.

*) Create another group, put the client in both, and assign both groups
   to separate pools.  You'd need to modify the schedule, but by using
   separate pools you'd be forcing separate volumes.

*) If you have the disk space, run the backups to disk first.  Then
   stage to tape twice (into 2 separate pools).  You only need one drive
   for that.  Then all your data would be redundant.  As a bonus, recent
   backups could be restored from disk.

-- 
Darren Dunham                                           ddunham@taos.com
Senior Technical Consultant         TAOS            http://www.taos.com/
Got some Dr Pepper?                           San Francisco, CA bay area
         < This line left intentionally blank to confuse you. >
0
Reply Darren 1/5/2006 5:01:27 PM

HI Darren,
Many thanks for these ideas. I will definetely use at least one of
them!
C

0
Reply cconnell_1 1/6/2006 1:32:37 AM

Mmn trying option 2, in the schedule this is what im trying to do but I
dont think its possible, can you run 2 schedules alternative weeks?
i.e.

schedule1 run full/incremental one week then skip the next,
schedule2 same as above but running the full/incremental on the week
schedule1 skips?

Thanks

0
Reply cconnell_1 1/31/2006 1:35:15 PM

cconnell_1@lycos.com wrote:
> Mmn trying option 2, in the schedule this is what im trying to do but I
> dont think its possible, can you run 2 schedules alternative weeks?
> i.e.

> schedule1 run full/incremental one week then skip the next,
> schedule2 same as above but running the full/incremental on the week
> schedule1 skips?

You can, but it would have to be in the form of overrides.  I don't know
of any particular keywords you could give to a schedule that would
otherwise describe this.  

If you're willing to fudge a bit, you could probably define a schedule
that always does the first, third and fifth weeks, and one that does the
second and fourth weeks.  Because of how they fall, that won't really be
every other week.  

Without that, I think you'd be forced to either pick a normal schedule
and add skips, or pick a skip schedule and add backups on the weeks you
want.

-- 
Darren Dunham                                           ddunham@taos.com
Senior Technical Consultant         TAOS            http://www.taos.com/
Got some Dr Pepper?                           San Francisco, CA bay area
         < This line left intentionally blank to confuse you. >
0
Reply Darren 1/31/2006 4:49:31 PM

cconnell_1@lycos.com wrote:
> Mmn trying option 2, in the schedule this is what im trying to do but I
> dont think its possible, can you run 2 schedules alternative weeks?
> i.e.

You can also go through each volume which has been mounted XXX times and
mark this tape as readonly. So it won't be chosen again for backup, like:

mminfo -r volume -q '%used>0,!readonly,mounts>XXX' | \
while read tape; do
  nsrmm -o readonly $tape
done

mminfo scans each volume with data on it (%used>0) and isn't yet marked
readonly (!readonly) and has been mounted XXX times (mounts>XXX, replace XXX
with your desired number). For each such volume set the readonly flag
via nsrmm.

In another cycle you can then mark the tapes again as r/w. The mminfo/nsrmm
pair is a very powerful combination for automatic scripting, see the
manual pages:
mminfo(1M), nsrmm(1M)

-- 
Daniel
0
Reply Daniel 1/31/2006 10:38:57 PM

Daniel Rock <abuse@deadcafe.de> wrote:
> cconnell_1@lycos.com wrote:
>> Mmn trying option 2, in the schedule this is what im trying to do but I
>> dont think its possible, can you run 2 schedules alternative weeks?
>> i.e.

> You can also go through each volume which has been mounted XXX times and
> mark this tape as readonly. So it won't be chosen again for backup, like:

> mminfo -r volume -q '%used>0,!readonly,mounts>XXX' | \
> while read tape; do
>   nsrmm -o readonly $tape
> done

True.  If you're willing to do that via a cron job (so you assume it
happens every week), you could just script something to swap which pool
is used every week.

If the cron job ever fails, then you might not notice and you'd do two
weeks on one set, but that might not be a big deal.

> In another cycle you can then mark the tapes again as r/w. The mminfo/nsrmm
> pair is a very powerful combination for automatic scripting, see the
> manual pages:
> mminfo(1M), nsrmm(1M)

Don't forget nsradmin.  
-- 
Darren Dunham                                           ddunham@taos.com
Senior Technical Consultant         TAOS            http://www.taos.com/
Got some Dr Pepper?                           San Francisco, CA bay area
         < This line left intentionally blank to confuse you. >
0
Reply Darren 1/31/2006 11:21:14 PM

Hello
Thanks, Ok I decided to write a script just to rotate the tapes each
time a backup runs- incremental or full, it stores the tape volume it
last mounted in a file, it works well so far. enclosed is the script I
know its long and doesnt do very much! Could someone tell me if nsrjb
-Cv , if the tapes are recyclable, then it prints just 'yes' or
anything else? I cannot remember and dont have any tapes that are in
recycle mode.

#!/bin/ksh
######
###### Legato Rotate Backup Script
######
######
###### Check nsrjb is in good state and reset/reinvent the jukebox
######
######
isrunning=`ps -ef | grep -w "nsrexec"; ps -ef | grep -w "nsrindexd -a"`
if [ ! -z $isrunning ]; then
  echo "\nError..looks like a backup is running. Exit now.\n"
  exit 1
fi
echo "\nResetting hardware and unloading jukebox .."
/usr/sbin/nsrjb -HE
if [ $? != 0 ]; then
  echo "Jukebox error.. exit now.\n"
  exit 1
else
  echo "\nPerforming fresh jukebox inventory..."
  nsrjb -I
fi
#######
#######
#######
case "$1" in
'full')
        echo "\nRotating FULL tape"
        tapelogfile=/var/tmp/tape-log/lastfull
        tapes=`nsrjb -Cv | grep -w "Full" | grep "%" | awk {'print $2
'} | sort -n`
        rec_tapes=`nsrjb -Cv | grep -w "Full" | grep "yes" | awk
{'print $2 '} | sort -n`
        ;;
'inc')
        echo "\nRotating INCREMENTAL tape"
        tapelogfile=/var/tmp/tape-log/lastinc
        rec_tapes=`nsrjb -C -v | grep -w "NonFull" | grep "yes" | awk
{'print $2 '} | sort -n`
        ;;
*)
        echo "\nUsage: $0 { full | inc }\n"
        exit 1
        ;;
esac
#######
#######
####### Set variables
#######
#######
lasttape=`echo $tapes | awk '{print $NF}'`
firsttape=`echo $tapes | awk '{print $1}'`
tapelogfiledir=/var/tmp/tape-log
#######
#######
####### Start Program
#######
#######
####### Test Stupid conditions
#######
#######
if [ ! -d $tapelogfiledir ]; then
  echo "Error no tape log file directory, exit now."
  exit 1
fi
if [ -z $tapes ]; then
  echo "Error - sorry no tapes to write to."
  echo "Now trying to find any recyclable tapes.."
  if [ ! -z $rec_tapes ]; then
  echo "Found some recyclable tapes. Using those ones."
  tapes=$rec_tapes
  else
   echo "Sorry no tapes at all to write to.."
   exit 1
fi
####### Start Rotating Tapes
#######
if [ ! -f $tapelogfile ]; then
  echo "No tape log file -- creating one and starting from first
tape.."
  echo $firsttape > $tapelogfile
  echo "Mounting first tape --> \c"
  echo $firsttape "into Jukebox\n"
  nsrjb -l -f /dev/rmt/0cbn $firsttape
  exit 0
fi
prevtape=`cat $tapelogfile`
isempty=`echo $tapes | grep $prevtape`
if [ -z $isempty ]; then
  echo "Fileformat is bad. Exit now.."
  echo "Removed faulty log file, run script again"
  rm $tapelogfile
  exit 1
elif [ `wc -l $tapelogfile | awk {'print $1'}` != 1 ]; then
  echo "Fileformat is bad. Exit now.."
  echo "Removed faulty log file, run script again"
  rm $tapelogfile
  exit 1
elif [ `head -1 $tapelogfile` = $lasttape ]; then
  echo "Replacing last tape with first tape.."
  echo $firsttape > $tapelogfile
  echo "Mounting first tape --> \c"
  echo $firsttape "into Jukebox"
  nsrjb -l -f /dev/rmt/0cbn $firsttape
else
  echo "Mounting next tape --> \c"
  nexttape=`echo $tapes | awk '{ for (i=1; i<=NF; i++) if($i ==
"'$prevtape'") {print $(i+1)} }'`
  echo $nexttape "into Jukebox"
  nsrjb -l -f /dev/rmt/0cbn $nexttape
  echo $nexttape > $tapelogfile
fi
echo

0
Reply cconnell_1 2/1/2006 10:46:49 AM

cconnell_1@lycos.com wrote:
> Hello
> Thanks, Ok I decided to write a script just to rotate the tapes each
> time a backup runs- incremental or full, it stores the tape volume it
> last mounted in a file, it works well so far. enclosed is the script I
> know its long and doesnt do very much! Could someone tell me if nsrjb
> -Cv , if the tapes are recyclable, then it prints just 'yes' or
> anything else? I cannot remember and dont have any tapes that are in
> recycle mode.

Yes.  However, I hate parsing 'nsrjb' output.  I'd rather ask the mminfo
database directly.

You can query mminfo for recyclable or non-recyclable tapes, and you can
get simple flags which report the state of the volume.

-- 
Darren Dunham                                           ddunham@taos.com
Senior Technical Consultant         TAOS            http://www.taos.com/
Got some Dr Pepper?                           San Francisco, CA bay area
         < This line left intentionally blank to confuse you. >
0
Reply Darren 2/1/2006 7:25:51 PM

Thanks, Ok Ill try using mminfo. Can mminfo tell you if the volume is
in the jukebox? Thats partly why I used nsrjb and to do an inventory to
see whats in the jukebox before doing anything.

0
Reply cconnell_1 2/2/2006 9:04:59 AM

cconnell_1@lycos.com wrote:
> Thanks, Ok Ill try using mminfo. Can mminfo tell you if the volume is
> in the jukebox? Thats partly why I used nsrjb and to do an inventory to
> see whats in the jukebox before doing anything.

Yes.  Not which one, but any...  
To match volumes that are nearline (in a jukebox).

mminfo -q 'near'

To report jukebox status

mminfo -r 'avail'   ('n' means nearline or in a jukebox).

-- 
Darren Dunham                                           ddunham@taos.com
Senior Technical Consultant         TAOS            http://www.taos.com/
Got some Dr Pepper?                           San Francisco, CA bay area
         < This line left intentionally blank to confuse you. >
0
Reply Darren 2/2/2006 5:58:40 PM

13 Replies
196 Views

(page loaded in 0.251 seconds)


Reply: