How to Mark a Tape as Free

Applies To: System Center Data Protection Manager 2010

A free tape is a tape that is available to be written to by operations such as backup or copy. To reuse an expired tape from another DPM server, you must add it to the tape library or stand-alone tape drive and then mark it as free. Expired tapes that are being managed by that DPM server can be reused automatically without being marked as free by the administrator.

Blank tapes are automatically marked as free.

To mark a tape as free

  1. In DPM Administrator Console, click Management on the navigation bar, and then click the Libraries tab.

  2. In the display pane, expand the tape library or stand-alone tape drive and select the tape to be marked as free.

  3. In the Actions pane, click Mark tape as free.

To mark a tape as free using DPM Management Shell

  • Use the following syntax to mark a tape as free:

    Set-Tape [-Tape] <Media[]> -Free [-PassThru] [-Verbose] [-Debug] [-ErrorAction <ActionPreference> ] [-ErrorVariable <String> ] [-OutVariable <String> ] [-OutBuffer <Int32> ]

  • Use the following syntax to mark a tape as not free:

    Set-Tape [-Tape] <Media[]> -NotFree [-PassThru] [-Verbose] [-Debug] [-ErrorAction <ActionPreference> ] [-ErrorVariable <String> ] [-OutVariable <String> ] [-OutBuffer <Int32> ]

    For more information, type "Get-Help Set-Tape -detailed" in DPM Management Shell.

    For technical information, type "Get-Help Set-Tape -full" in DPM Management Shell.

To mark a tape containing valid data sets as Free

  1. Open a new Notepad file and copy the following script into it:

    param ([string] $DPMServerName, [string] $LibraryName, [string[]] $TapeLocationList)
    
    if(("-?","-help") -contains $args[0])
    {
        Write-Host "Usage: ForceFree-Tape.ps1 [[-DPMServerName] <Name of the DPM server>] [-LibraryName] <Name of the library> [-TapeLocationList] <Array of tape locations>"
        Write-Host "Example: Force-FreeTape.ps1 -LibraryName "My library" -TapeLocationList Slot-1, Slot-7"
        exit 0
    }
    
    if (!$DPMServerName)
    {
        $DPMServerName = Read-Host "DPM server name: "
    
        if (!$DPMServerName)
        {
            Write-Error "Dpm server name not specified."
            exit 1
        }
    }
    
    if (!$LibraryName)
    {
        $LibraryName = Read-Host "Library name: "
    
        if (!$LibraryName)
        {
            Write-Error "Library name not specified."
            exit 1
        }
    }
    
    if (!$TapeLocationList)
    {
        $TapeLocationList = Read-Host "Tape location: "
    
        if (!$TapeLocationList)
        {
            Write-Error "Tape location not specified."
            exit 1
        }
    }
    
    if (!(Connect-DPMServer $DPMServerName))
    {
        Write-Error "Failed to connect To DPM server $DPMServerName"
        exit 1
    }
    
    $library = Get-DPMLibrary $DPMServerName | where {$_.UserFriendlyName -eq $LibraryName}
    
    if (!$library)
    {
        Write-Error "Failed to find library with user friendly name $LibraryName"
        exit 1
    }
    
    foreach ($media in @(Get-Tape -DPMLibrary $library))
    {
        if ($TapeLocationList -contains $media.Location)
        {
            if ($media -is [Microsoft.Internal.EnterpriseStorage.Dls.UI.ObjectModel.LibraryManagement.ArchiveMedia])   
            {
                foreach ($rp in @(Get-RecoveryPoint -Tape $media))
                {
                    Get-RecoveryPoint -Datasource $rp.Datasource | Out-Null
    
                    Write-Verbose "Removing recovery point created at $($rp.RepresentedPointInTime) for tape in $($media.Location)."
                    Remove-RecoveryPoint -RecoveryPoint $rp -ForceDeletion -Confirm:$false
                }
    
                Write-Verbose "Setting tape in $($media.Location) as free."
                Set-Tape -Tape $media -Free
            }
            else
            {
                Write-Error "The tape in $($media.Location) is a cleaner tape."
            }
        }
    }
    
  2. Save the file as ForceFree.ps1.

  3. The syntax to run the script is ForceFree.ps1 -DPMServerName <Name of server> -LibraryName <Name of library> -TapeLocation <slot numbers>.

See Also

Concepts

Managing Tapes