KB

Replacing Old Tapes with Ntbackup

When you replace a tape for an existing backup job, the backup will probably fail, saying that it can't find the tape:

Backup Status
  The operation was not performed because the specified media cannot be found

This is because the Scheduled Tasks that ntbackup creates reference the tapes by it's GUID.

You could recreate the backup job from scratch, or you could just find the new tape's GUID and then edit the task manually. This is usually quicker.

Find the tape drive's GUID

rsm view /tlibrary /guiddisplay

LIBRARY

Off-line Media  8F8AB43C19DE43A2AC8B036608FEAB60
LITE-ON DVD SOHD-167T   09E94F6C93964599A11D58F9BC5E5484
SONY SDT-11000 SCSI Sequential Device   4EE461D0AC00419F90F842E20BF62205

The command completed successfully

Find the tape's logical GUID:

Create the following batch file, it will tell you the logical GUID of the tape that's currently inserted. This is the GUID that ntbackup needs.

@echo off
rem Info from various sources, including Windows & .NET Magazine and Microsoft

set tapeguid=""
set partguid=""
set logguid=""
set t1=""

rem Set the GUID of the tape drive, must be determined manually
rem Use: rsm view /tlibrary /guiddisplay /desc
set drvguid=2BB08C0CA4A14A9FAC0709D49A566B60

rem Get the physical GUID of the tape in the drive
FOR /F "usebackq delims==" %%i IN (`rsm view /tphysical_media /cg%drvguid% /guiddisplay /b`) DO set tapeguid=%%i

rem Check to make sure there was a tape in the drive
if %tapeguid%=="" goto notape

rem Get the partition GUID of the tape
FOR /F "usebackq delims==" %%i IN (`rsm view /tpartition /cg%tapeguid% /guiddisplay /b`) DO set partguid=%%i

rem Get the logical media GUID of the partition; needed by NTBackup
FOR /F "usebackq delims==" %%i IN (`rsm view /tlogical_media /cg%partguid% /guiddisplay /b`) DO set logguid=%%i

rsm view /tphysical_media /cg%drvguid% /guiddisplay
echo Logical tape GUID: %logguid%

Edit the backup task

In Scheduled task, open the task for that tape. eg. the above tape corresponds to Monday1's backup. The command for the scheduled task will look like this:

C:\WINDOWS\system32\ntbackup.exe backup "@C:\Documents and Settings\Administrator\Local Settings\Application Data\Microsoft\Windows NT\NTBackup\data\Monday1.bks" /n "Monday1" /d "Monday1" /v:yes /r:no /rs:no /hc:on /m normal /j "Monday1" /l:s /g "385F4899D5154A29AC16E7D7C12CECFD

Change the /g option to reflect the new tape's GUID.

You'll be asked to enter the credentials that the task runs under, and then you're done.