Netvault Backup & Data Domain



Bit of an obscure one this, but never the less it may be useful for someone other than me. VTL-based backup software such as Quest (formerly Bakbone) Netvault Backup, when used in conjunction with de-duplication hardware such as Data Domain, has an issue whereby expired media will still occupy space on your storage for days, weeks or even months after it should be removed. This is because, as with most file systems, when the VTL media is expired, it’s not actually wiped, they just delete the media headers and therefore the dedupe hardware doesn’t know that the space is reclaimable.

In the case of Netvault, this is well documented; they even include a sample script for you to run to help reclaim the space. The only tiny problem is that it doesn’t work properly. It did work, but at some point something has changed in the newer releases of the software and it breaks things – not to mention that it won’t work on any media that isn’t connected to the backup server (which is more common than you might think).

So, to work around this in a way that works, see the following powershell script. It needs to be run from a machine with Netvault installed and you’ll need to run it separately for each VTL that you have on your de-duplication hardware.

You’ll also need to create a report component (expiredonlinemedia1 in this case) that returns all media marked for Reuse for a given library ID.

$vtl is the path to the “media” folder within your VTL (UNC or local path)
$util is the path to your Netvault Backup “util” folder
$lib is the full name of the library that you’re working with
$mediagroup is the name of the media group that you want to assign your media to

You may need to adjust the “Start-Sleep” value if you find that your VTL(s) aren’t enumerating all of the modified media fast enough, but I haven’t been able to find a way to tell from the cli when it’s finished hence the 120 second wait.

$vtl = "\\10.0.0.1\backup\vtl1\media\"
$util = "C:\Program Files (x86)\BakBone Software\NetVault Backup\util\"
$lib = "BACKUP1: \\10.0.0.1\backup\vtl1"
$mediagroup = "media1"

cd $util

& .\nvclosedoor.exe -libraryname $lib
& .\nvreport.exe -templatename expiredonlinemedia1 > medialist.txt
$media = gc .\medialist.txt

if($media -match "Nothing to display"){exit 0}
if($media -eq $null){exit 0}

& .\nvopendoor.exe -libraryname $lib

Start-Sleep 5

foreach($tape in $media[4..$($media.length-3)]){
	$tape = $tape.trim()
	if(Test-Path "$vtl$tape.disabled"){
		Remove-Item "$vtl$tape.disabled" -confirm:$false
	}
	Rename-Item "$vtl$tape" "$tape.disabled"
	& .\nvremovemedia.exe -medialabel $tape
	& .\nvmakemedia.exe 50000m mediafiles "$vtl$tape"
	
	if(Test-Path "$vtl$tape.disabled"){
		Remove-Item "$vtl$tape.disabled" -confirm:$false
	}
}
	
& .\nvclosedoor.exe -libraryname $lib

Start-Sleep 120	

foreach($tape in $media[4..$($media.length-3)]){
	$tape = $tape.trim()
	& .\nvlabelmedia.exe -barcode $tape -newlabel $tape -newgroupname $mediagroup
}

To run the script from a smartclient or other machine that isn’t the backup server, replace this line:

& .\nvremovemedia.exe -medialabel $tape

with this:

$sb = [scriptblock]::create("& 'C:\Program Files (x86)\BakBone Software\NetVault Backup\util\nvremovemedia.exe' -medialabel $tape")
Invoke-Command -ComputerName  -ScriptBlock $sb

Where <ServerName> is the name of your backup server.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.