Windows Server 2012–Failed Backup Disk

WindowsVistaBackupIconThis 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.

Enter Windows Server Backup PowerShell.

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

Get-WBPolicy

Now that we have our Policy we can begin to edit it.

Get-WBPolicy variable

Remember that my example is only for a situation where we have a single backup target only.

We can now query our $policy for the backup targets, and then we can remove the target.

C:\PS>$backupLocations = Get-WBBackupTarget -Policy $policy

Get-WBBackupLocations

So now we have our failed target under $backupLocations and our policy is of course $policy.

C:\PS>Remove-WBBackupTarget -Policy $policy -Target $backupLocations[0]

We append [0] 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.

Rewmove-WBBackupLocations

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.

Get-WBDisk

We now need to create a new backup target using our disk number.

C:\PS>$diskBackupLocation = New-WBBackupTarget -Disk $disks[1]

This command adds $disk[1] 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

New-WBBackupLocaiton

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

Set-WBPolicy

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.

About Robert Pearman
Robert Pearman is a UK based Small Business Server enthusiast. He has been working within the SMB IT Industry for what feels like forever. Robert likes Piña colada and taking walks in the rain, on occasion he also enjoys writing about Small Business Technology like Windows Server Essentials or more recently writing PowerShell Scripts. If you're in trouble, and you can find him, maybe you can ask him a question.

6 Responses to Windows Server 2012–Failed Backup Disk

  1. Paul says:

    I’ve ran into this a few times. Can you not just disable the backup and start again? saves having to much about with PS.

  2. Paul says:

    Meant to say, good on you for doing some charity work, very commendable Sir! If you’re doing any more free work for non-profits and the client needs kit (like USB disks) you should reach out to your blog readers and see what’s available. I’ve got a room full of old servers, switches, routers, monitors etc that I recycle periodically. If someone could reuse the items, then great!

  3. Philippp says:

    It probably boils down to: Dont use any backup software from by MS. Just had a nightmare trying to restore a PC that I had backed up with the integrated backup solution of SBS Essentials 2011. Feels like they want to pull your leg.

  4. Antoine says:

    Good resume.
    A good document from Microsoft, regarding PS cmdlets for WSB, is at https://technet.microsoft.com/en-us/library/ee849849.aspx Written for 2008R2 but much more comprehensive than the terse documentation you linked to.

Leave a reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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

%d bloggers like this: