Video Screencast Help
Protect Your POS Environment Against Retail Data Breaches. Learn More.

"Media In Use" when running a restore

Created: 03 Sep 2013 • Updated: 06 Sep 2013 | 1 comment
Language Translations
TuxanForLife's picture
+1 1 Vote
Login to vote

Assumptions:
NetBackup 7+, Unix master server

Intro:
If you are restoring a file recently written to tape, there's a fair chance that the tape will still be in use.
If the restore job is time-sensitive (and, really aren't they all?) here is a procedure I've tried to release
the tape (at the expense of killing the jobs that were writing to it).
I'll refer to the tape mediaID as "<mediaID>", replace this with the ID of your media - say AH0101.

 

  1. From master server – suspend ALL scheduling  
    master#   /usr/openv/netbackup/bin/admincmd/nbpemreq -suspend_scheduling

 

  1. Dump the current job that is using that media
    master# /usr/openv/netbackup/bin/admincmd/nbrbutil  -listActiveMediaJobs <MediaId>

    If that fails, you can try an older invocation
    master# /usr/openv/netbackup/bin/admincmd/nbrbutil -dump | grep <MediaID>  | sed 's/.*firstuserid//;s/(Media_Drive_Allocation_Record.*//' | grep jobid

     

  2. Try  /usr/openv/netbackup/bin/admincmd/nbrbutil   -releaseMedia   <MediaID>

    Else cancel the jobs that are using it. 
     master#  bpdbjobs -cancel 397341,23422,43224  (sample unix process IDs)
     

  3. Wait five minutes until the jobs are done.
     
  4. Suspend the tape so that other jobs don’t grab it and start writing to it.
     master#  bpmedia –suspend   -m <MediaID> -h  auspcrpbak01  –v
      (only needed on the media server that had grabbed the allocation of that media. Exit status = 0 )

 

  1. Resume scheduling jobs to the media server
     master#  /usr/openv/netbackup/bin/admincmd/nbpemreq -suspend_scheduling
     
  2. Resume the restore job. Restore jobs will still use suspended media.
     
  3. Once the restore completes, unsuspend the media  <MediaID>.  But if we forget to do this, the tape will be recycled into the pool once data on it expires.

 

Comments 1 CommentJump to latest comment

erikalui's picture

I usually do not get this error and it happens rarely but I'll save this solution as it is the easier way to tackle the issue rather than the method I used to use previously.

0
Login to vote