Backup Exec “Removable Backup To Disk” with Rotating Disks

backupexec

I am setting up a backup system using the latest Backup Exec 2010 R3, and I would like to use usb hard drives as a backup media. I'm trying to figure out the best hassle-free way to introduce a disk rotation strategy into Backup Exec, but I'm coming up with the following problems:

Setup (simplified to address the problem at hand)

  • Backup Exec 2010 R3 server on a Windows 2003 R2 server
  • Use a different backup-to-disk folder for each day of the week
  • Rotate external disks based on the day of the week

Using the built-in removable backup to disk option

This option has problems, because backup-to-disk folders are based on drive letters instead of disk IDs. That means that:

  • More than one removable backup to disk drives cannot be assigned to the same drive letter.
  • If drive letters are assigned to disks to permit the creation of multiple removable backup to disk drives, you can easily use up all available drive letters when creating a comprehensive year-round backup system. Additionally, special setup is required to prepare disks for use (assigning a drive letter) to a drive.
  • If drive letter assignment gets re-arranged due to windows USB drive behavior, backup drives won't come online.

All this means that I don't have a straightforward way to link removable backup to disk folders to external drives.

Using a backup to disk setup

This setup seemed to work, at first, since Backup Exec was finding disks and using them. However, the system does not seem to care which physical disk to use for a backup, and creates backup to disk folders on the drives that have already been set up with other backup to disk folders. Imagine this scenario:

Backup Exec Devices:

  • BED001
  • BED002

Corresponding Physical Devices:

  • PD001
  • PD002

PD001 and PD002 are attached to the system to handle two days worth of backups. However, Backup Exec uses BED001 for both backups, and creates a new backup to disk folder on PD001 to handle the backup.

The BIG Question

The big question here is how do I set up the system to make it easy to identify which disk is needed in the event a restore operation is required to retrieve data from a specific date?

Best Answer

Alternative answer: Forcing drive letter persistence

Although I'm definitely sticking with my first answer, I thought I'd add another approach, which you may be able to get working with some initial effort. A massive disclaimer on this though, as I've never tried it and, typically, unless you use Backup Exec in exactly the way it was intended, it usually ends in tears.

Force either via USBDLM or WMI script

Essentially, this approach requires ensuring that all of your backup USB disks are given the same drive-letter, prior to the backup job running. This might be doable using USBDLM, from http://www.uwe-sieber.de/usbdlm_e.html. Otherwise, you'd be looking at a WMI script -- either run manually or scheduled to run during the day, prior to the backup job -- to find a valid, connected USB disk by serial/model/device ID and assign its drive-letter to the fixed one of your RB2D. You may even be able to run this in a Pre-Job Command, provided the backup device is not determined prior to the pre-job run.

Background

I reckon the problems with this approach will be due to Backup Exec's numbering logic for the IMG files that end up on a (R)B2D. I expect that Backup Exec will lose track of what can be overwritten, etc. This might be avoidable if you were to perform inventory operations on the RB2D every time you used it. Again, if the pre-job command runs before the backup device is determined, you might be able to use bemcmd.exe to run a saved Inventory job, after the drive-letter is assigned and before the backup job runs.

Sample VBScript to interface with WMI

A basic VBScript file that forces a the first partition on a disk to be mounted with a given drive-letter, based on a list of allowed Plug & Play Device IDs is as follows. It should work on anything Windows Server 2003 and upwards, but I only have XP to hand at the moment and so have not tested it myself:

Option Explicit

Const DRIVE_LETTER = "Q:"

Dim validDisks : validDisks = Array( _
    "USBSTOR\\DISK&VEN_KINGSTON&PROD_DATATRAVELER_2.0&REV_PMAP\\001D0F0C73C8B91123110031&0", _
    "USBSTOR\\DISK&VEN_TDKMEDIA&PROD_TF_150_DRIVE&REV_PMAP\\07AA0207B128CA8E&0", _
    "pnpdeviceid_of_disk_3", _
    "pnpdeviceid_of_disk_4" _
) 'REMEMBER TO ESCAPE ANY \ WITH \\

Dim wmiService : Set wmiService = GetObject("winmgmts:{impersonationLevel=Impersonate}!//.")

Dim wqlQuery : wqlQuery = "SELECT * FROM Win32_DiskDrive WHERE InterfaceType = 'USB' AND (PNPDeviceID = '" _
                         & Join(validDisks, "' OR PNPDeviceID = '") _
                         & "')"

Dim diskDrives : Set diskDrives = wmiService.ExecQuery(wqlQuery, , 48)
 
Dim diskDrive : For Each diskDrive In diskDrives
    WScript.Echo "Found disk: " & diskDrive.Caption 
    Dim deviceID : deviceID =  Replace(diskDrive.DeviceID, "\", "\\")
     
    wqlQuery = "ASSOCIATORS OF {Win32_DiskDrive.DeviceID=""" & deviceID & """} WHERE AssocClass = Win32_DiskDriveToDiskPartition"
    Dim partitions : Set partitions = wmiService.ExecQuery(wqlQuery, , 48)
 
    Dim partition : For Each partition In partitions
        WScript.Echo "Found partition: " & partition.Caption 
    
        wqlQuery = "ASSOCIATORS OF {Win32_DiskPartition.DeviceID=""" & partition.DeviceID & """} WHERE AssocClass = Win32_LogicalDiskToPartition"
        Dim logicalDisks : Set logicalDisks = wmiService.ExecQuery(wqlQuery, , 48)
 
        Dim logicalDisk : For Each logicalDisk In logicalDisks
            WScript.Echo "Found logical disk: " & logicalDisk.DeviceID 
            
            If UCase(Trim(logicalDisk.DeviceID)) <> UCase(DRIVE_LETTER) Then
                wqlQuery = "SELECT * FROM Win32_Volume WHERE Name = '" & logicalDisk.DeviceID & "\\'"
                Dim volumes : Set volumes = wmiService.ExecQuery(wqlQuery, , 48)
                
                Dim volume : For Each volume in volumes
                    WScript.Echo "Found volume: " & volume.Name
                    volume.DriveLetter = DRIVE_LETTER
                    volume.Put_
                    WScript.Echo "Changed USB disk drive letter to " & DRIVE_LETTER & "."
                    Exit For    'ONLY DO THIS TO THE FIRST ONE FOUND
                Next
            Else 
                WScript.Echo "USB disk drive letter is already " & DRIVE_LETTER & ".  No change required"
            End If
            
            Exit For    'ONLY DO THIS TO THE FIRST ONE FOUND
        Next
        
        Set logicalDisks = Nothing
        Exit For    'ONLY DO THIS TO THE FIRST ONE FOUND
    Next
    
    Set partitions = Nothing
    Exit For    'ONLY DO THIS TO THE FIRST ONE FOUND
Next

Set diskDrives = Nothing
Set wmiService = Nothing

Good luck.