Everhart, Glenn (FUSA) From: dunnett@mala.bc.ca Sent: Wednesday, May 19, 1999 4:15 PM To: Info-VAX@Mvb.Saic.Com Subject: Re: Slow DLT tape access with Backup In article <3742A455.36B85E9B@star.zko.dec.youknowwhere>, Andy Goldstein writes: > > The problem is that BACKUP, while it is using the fast skip feature of > the drive, is not as smart as it could be about searching the tape. It > skips one file mark at a time and looks for a HDR1 label at each one. ok, that explains some of what I saw. > > BACKUP does a skip to the next tape mark before checking the label. If > you manually position the tape one tape mark short of the start of the > desired save set it should find the one you want. Thanks, that was the missing piece. If I skip 3*n-1 file marks and then issue the backup command the listing starts right up. I've cobbled together a bit of DCL to use the skip file function to find the start of a saveset. Using my test tape I can find the 9th saveset in about 8 minutes ( checking each header along the way ) or in about 1 minute if I tell it to skip the first 8 files. The code is attached in case anyone else is interested ( as-is, use at your own risk, etc ). What does backup do with a /VERIFY? Does it rewind the tape and search from the beginning or does it skip backwards across the file? (or, as I seem to recall from the 9 track days, does it depend on the size of the saveset? ) ---- $! $! FIND_SAVESET: Skip to a specified saveset on a tape $! $! This procedure uses the skip by file function $! to locate a specified saveset on a backup tape $! $! Parameters p1 Tape drive $! p2 saveset to find $! p3 [OPTIONAL] savesets to skip over before $! starting search ( if known came improve $! performance significantly ) $! $ $! $! Version Check $! $ VERSION = F$EXTRACT(1,3,F$GETSYI("VERSION")) $ IF VERSION .LTS. "7.1" $ THEN $ WRITE SYS$OUTPUT "Procedure must run on VMS 7.1 or higher" $ EXIT $ ENDIF $! $! Get Parameters $! $ IF "''P1'" .EQS. "" THEN INQUIRE P1 "Tape drive" $ IF "''P2'" .EQS. "" THEN INQUIRE P2 "Saveset to find" $ P2 = F$EDIT(P2,"UPCASE,TRIM") $ $ if "''P3'" .EQS. "" THEN P3 = 0 $ $ TAPE = "''p1'" $ SET MAGT/REWIND 'TAPE' ! Make sure we're at BOT $! $! Enable fast skip $! (use MKSET for 7.1, SET MAGTAPE command for 7.2 and up ) $! $ IF VERSION .EQS. "7.1" $ THEN $ MKSET = "$SYS$ETC:MKSET.EXE" $ MKSET/ALWAYS 'TAPE' $ ELSE $ SET MAGT/FAST=ALWAYS 'TAPE' $ ENDIF $ $ OPEN/READ TAPE 'TAPE' $! $! Get Volume label $! $ READ TAPE REC $ IF F$EXTRACT(0,4,REC) .NES. "VOL1" $ THEN $ WRITE SYS$OUTPUT "VOL1 not found, tape is wrong format" $ GOTO TAPE_DONE $ ENDIF $ $ WRITE SYS$OUTPUT "Volume Label: ", F$EDIT(F$EXTRACT(4,17,REC),"TRIM") $! $! Skip some savesets if requested $! $ IF P3 .GT. 0 $ THEN $ skipcnt = p3*3 $ SET MAGT/SKIP=FILE='skipcnt' 'TAPE' $ ENDIF $! $! Get a file header $! $GET_HDR1: $ $ READ TAPE REC $ IF F$EXTRACT(0,4,REC) .NES. "HDR1" $ THEN $ WRITE SYS$OUTPUT "HDR1 not found, tape is wrong format" $ GOTO TAPE_DONE $ ENDIF $ $ FILE = F$EDIT(F$EXTRACT(4,17,REC),"TRIM,UPCASE") $ WRITE SYS$OUTPUT "Found file: ", FILE $ $ IF FILE .EQS. P2 $ THEN $ SET MAGT/SKIP=FILE=-2 'TAPE' ! Position to record before HDR1 $ GOTO TAPE_DONE $ ENDIF $! $! Position to start of next saveset $! $ SET MAGT/SKIP=FILE=3 'TAPE' $ IF $STATUS .EQ. %X1001827A THEN GOTO TAPE_DONE ! RMS$_EOF $ $ GOTO GET_HDR1 $ $TAPE_DONE: $ $ CLOSE TAPE $ -- ============================================================================= Malcolm Dunnett Malaspina University-College Email: dunnett@mala.bc.ca Information Systems Nanaimo, B.C. CANADA V9R 5S5 Tel: (250)755-8738