Windows Server 2012–Failed Backup Disk
November 12, 2013 5 Comments
This is a quick post just based on something i have done this morning for a charity i do some volunteer support for. This year i installed a new server for them running Windows Server 2012, and two Hyper-V guests as a Domain Controller and Exchange server. Due to budget restraints they only had a single USB drive available for backups, and of course, recently that failed.
Unfortunately since Windows Server 2008 (i think) it has become slightly more involved to use Windows Server Backup and USB Disks for rotation. You cannot simply add another disk and run the wizard to add it into the disk set – all drives must be connected at the same time.
This presents a unique challenge if the disk is not available, and that is the only disk in the set. You cannot simply run the wizard and choose to remove the failed disk from the destinations, because it will error saying ‘you need to add more disks first’. Ok –so you try to add a disk, but no, it cannot do that because the original disk is not connected. The same applies if using WBAdmin command line tool.
It is not immediately obvious though in which order you need to run the commands, however i do think this is one of the best written PowerShell articles and examples i have seen for a long time. (er, not this article, the TechNet pages)
So, firstly we need to ‘get’ the WBPolicy, and in an editable state.
C:\PS>$policy = Get-WBPolicy -Editable
Now that we have our Policy we can begin to edit it.
Remember that my example is only for a situation where we have a single backup target only.
C:\PS>$backupLocations = Get-WBBackupTarget -Policy $policy
So now we have our failed target under $backupLocations and our policy is of course $policy.
C:\PS>Remove-WBBackupTarget -Policy $policy -Target $backupLocations
We append  to our $backupLocations variable to let the command know it is ‘Backup Target 0’ we want to remove. If for example we had multilple disks in our Target we could select the right disk using its corresponding number.
Now we need to create a new target for our backup.
C:\PS>$disks = Get-WBDisk
Now stored in the disks variable are all of the disks on the system. You can type out $disks to view the available disks to select as targets. In my system i have a single C drive and the USB Disk attached, making my USB Disk, disk 1.
We now need to create a new backup target using our disk number.
C:\PS>$diskBackupLocation = New-WBBackupTarget -Disk $disks
This command adds $disk to the $diskBackupLocation variable. Now we can run the Add Backup Target command to add this new target to our policy.
C:\PS>Add-WBBackupTarget -Policy $policy -Target $diskBackupLocation
Finally we can ‘save’ our policy by using the ‘Set Policy’ command.
You will be prompted to format the disk at this point.
C:\PS>Set-WBPolicy -Policy $policy
Now your backups should be able to run again!
Hopefully this shows you why using a single backup disk as your backup location is not a good idea, but also how to get around it if you absolutely must do.