Wishlist 0 ¥0.00

Backup Version and Space Management in Windows Server Backup

This article answers following questions related to Windows Server Backup in Windows Server 2008 and Windows Server 2008 R2:

Q1. How does Windows Server Backup store backups and maintain backup versions?
Q2. How do I query backup stored versions on a backup storage location?
Q3. How do I delete non system state backups created using Windows Server Backup?
Q4. How do I delete system state backups created using Windows Server Backup?

Overview

·Windows Server Backup is the built-in backup solution in Windows Server 2008 and Windows Server 2008 R2. Using Windows Server Backup, an administrator can schedule periodic backups of a server and also create backups on demand. For details on using Windows Server Backup, please see the Installed Help for Windows Server 2008 (http://technet.microsoft.com/en-us/library/cc770757(WS.10).aspx) and for Windows Server 2008 R2 (http://technet.microsoft.com/en-us/library/cc770757.aspx).

·Windows Server Backup in Windows Server 2008 allows administrators to back up entire volumes. More flexibility is available in Windows Server 2008 R2 where administrators can pick and choose individual files and folders to be included in a backup. The technology used by Windows Server Backup to perform a backup differs based on the nature of the backup:

oIf you back up an entire volume, Windows Server Backup creates a block-level backup that reads directly from the volume by passing the file system.

oIf you back up just specific files and folders, Windows Server Backup reads individual files going through the file system.

·Windows Server Backup stores backups at the following path: <BackupStorageLocation>\WindowsImageBackup\<ComputerName>\. A back up operation performs following steps:

1.Windows Server Backup reads data from source volumes and then creates a .vhd file per source volume on the backup storage location and writes the backup metadata.

2.Windows Server Backup stores backup versions in volume shadow copies. After the data write is complete, Windows Server Backup creates a shadow copy of the volume where the backup is stored using Volume Shadow Copy Service (VSS). This shadow copy retains the state of the storage volume as a “backup version” or “point-in-time” of the backup and must restore using this backup version. VSS is the underlying Microsoft technology required for maintaining backup versions. (For more information about VSS, see http://technet.microsoft.com/en-us/library/cc785914.aspx.)

3.After creating the shadow copy, Windows Server Backup updates the backup catalog which is stored on both the system volume of the server that is being backed up and the backup storage folder with the following information:

§The backup time The local system time of the server when the backup operation started.

§The shadow copy identifier (Shadow Copy ID) Used by Windows Server Backup to associate the backup version to the correct shadow copy.

§Version identifier Used by Windows Server Backup to uniquely identify a backup version. Users using command line tools (Wbadmin and the Windows PowerShell cmdlets for Windows Server Backup) will specify the version identifier as a parameter to the command to work with a backup version.

·If the backup storage location is full, Windows Server Backup automatically deletes the oldest backup version to make space for the current backup. Since each backup is stored inside a shadow copy, deleting a backup version is accomplished by simply deleting the corresponding shadow copy. However, space for a system state backup in Windows Server 2008 is not automatically managed by Windows Server Backup. See the section “How to Delete System State Backups” below for managing system state backups in Windows Server 2008.

·Windows Server Backup can store only one backup version on a network share (remote shared folder). You can store backups from multiple computers to a network share. A backup from a computer to a network share will be saved at: \\<RemoteServer>\<SharedFolderPath>\WindowsImageBackup\<ComputerBackedUp>. To delete the backup on network share, you need to delete the <ComputerBackedUp> directory from network share.

·Windows Server Backup uses the .vhd format for writing backups. The current virtual hard disk specification limits the size of a virtual hard disk to be 2040 GB, which can fit a volume of size 2040 GB – 2 MB, (i.e., 2088958 MB). Windows Server Backup in Windows Server 2008 also limits the maximum source volume size to be 2088958 MB. In Windows Server 2008 R2, if you are not backing up a full volume and, instead, creating a backup of selected files/folders, your source volume size can be more than 2088958 MB, provided your actual data size is less than equal to 2088958 MB. If you are creating a full volume backup, the maximum source volume size limit continues to be 2088958 MB.

How to Query Backup Versions

To see the backup versions present in a particular computer, use the Wbadmin get versions command. Note that, to use the Wbadmin command, you must be a member of the Administrators group or Backup Operators group and must open an elevated instance Cmd.exe (click Start, right-click Command Prompt, and then clickRun as administrator). For detailed Wbadmin command documentation, see:http://technet.microsoft.com/en-us/library/cc754015.aspx.

Sample output of Wbadmin get versions command:

wbadmin 1.0 - Backup command-line tool

(C) Copyright 2004 Microsoft Corp.

 

Backup time: 3/12/2009 10:55 AM

Backup target: Fixed Disk labeled New Volume(I:)

Version identifier: 03/12/2009-05:25

Can recover: Volume(s), File(s)

Snapshot ID: {f5e946da-5cc7-44c3-a747-9f1079e639b0}

 

Snapshot ID in the above output is new in Windows Server 2008 R2. Snapshot ID is same as Shadow Copy ID. It corresponds to a specific backup version and can be used to delete that backup version.

 

To view all backup versions on a particular backup storage location, type:

Wbadmin get versions -backupTarget:<BackupStorageLocation:>

For example, if you want to view all the backup versions on the backup storage location K:, type:

Wbadmin get versions –backupTarget:K:

In the output of Wbadmin get versions command, Backup time is the local system time and Version Identifier is the GMT time at the time the backup was created. If you change your system time zone, the value for Backup time will also change. Note that Version Identifier is a unique identifier for a given backup version and remains constant for a backup.

How to Delete Non-System State Backups

Windows Server Backup deletes a backup by just deleting the corresponding shadow copy and updating the backup catalog. You can perform the same steps manually to delete backups on demand. However, the backup catalog update cannot be done manually and it will happen instead during the next backup. In short, to delete a backup version manually, you need to delete the corresponding shadow copy from the backup storage location.

To delete a shadow copy, follow these general steps:

1.Identify the backup version you want to delete by querying the backup versions on your backup storage location.

2.Determine the shadow copy ID of the version you want to delete.

3.Delete the shadow copy.

Identify the backup version:

To list all the shadow copies on a volume, use the Vssadmin command. (For the complete syntax forVssadmin, see: http://technet.microsoft.com/en-us/library/cc754968(WS.10).aspx.) The following command line lists all shadow copies on a specified backup storage location:

Vssadmin list shadows /for=<BackupTarget>

For example, to list the shadow copies on the location Y, type:

Vssadmin list shadows /for=Y:

Determine the shadow copy ID:

On Windows Server 2008 R2, the shadow copy ID is same as Snapshot ID given in the output of querying backups. On Windows Server 2008, you can find your backup’s shadow copy ID by looking at output ofVssadmin list shadows /for=<Backup Target>. Match the shadow copy creation time with your backup’sBackup time value.

Delete the Shadow Copy for the specific Shadow Copy ID:

1.To open a command prompt with elevated privileges, click Start, right-click Command Prompt, and then click Run as administrator. Then type:

DiskShadow.exe

2.Type:

Delete shadows ID <Shadow Copy ID>

3.To exit DiskShadow type:

Exit

To delete the oldest shadow copy on backup storage location, type the following command in step 2 above:

Delete shadows OLDEST <BackupStorageLocation>

For example, if your storage location is volume G:, type:

Delete shadows OLDEST G:

If you have scheduled backups to dedicated disks, Windows Server Backup doesn’t assign a drive letter to the backup storage location to avoid any accidental data write or loss of backups. In that case, you can use the GUID of the backup storage volume to delete the oldest shadow copy. You can get volume GUIDs for all volumes on your system by using the Mountvol command. If your scheduled backup storage location is a dedicated disk, it will be reported with No Mount Points in the output of Mountvol. The volume GUID is in {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} format.

Then, to delete the oldest shadow copy on that volume, type:

Delete shadows OLDEST \\?\Volume{GUID}

For example, for a volume GUID of 7fc1871b-2e1f-11dd-a339-001e4fb7af35, type:

Delete shadows OLDEST \\?\Volume{7fc1871b-2e1f-11dd-a339-001e4fb7af35}

How to Delete System State Backups

In Windows Server 2008, each system state backup  is a full backup and is stored in a separate directory, consuming the space needed for a full backup every time. New in Windows Server 2008 R2 system state backups are incremental and use VSS shadow copies for creating different versions of the backup.

There are three ways to delete system state backups:

oDelete a specified version of system state backup

oExample: Delete the version that was taken on Tuesday evening with a version identifier of06/02/2009-18:25.

§In an elevated command prompt, query backup versions and identify the backup created on Tuesday with the version identifier of 06/02/2009-18:25.

§Then, type: Wbadmin delete systemstatebackup –version: 06/02/2009-18:25

oDelete the oldest version on a backup storage location

oExample: Delete the oldest version on backup target G:\

§In an elevated command prompt type: Wbadmin delete systemstatebackup –backupTarget:G: –deleteOldest

oDelete all backups except the latest N versions on a backup storage location.

oIn an elevated command prompt type: Wbadmin delete systemstatebackup -keepversions:N

Wbadmin start backup

Applies To: Windows Server 2008, Windows Server 2008 R2, Windows Vista

Creates a backup using specified parameters. If no parameters are specified and you have created a scheduled daily backup, this subcommand creates the backup by using the settings for the scheduled backup. If parameters are specified, it creates a Volume Shadow Copy Service (VSS) copy backup and will not update the history of the files that are being backed up.

To create a one-time backup with this subcommand, you must be a member of the Backup Operators group or the Administrators group, or you must have been delegated the appropriate permissions. In addition, you must run wbadmin from an elevated command prompt. (To open an elevated command prompt, click Start, right-click Command Prompt, and then click Run as administrator.)

For examples of how to use this subcommand, see Examples.

Syntax
 
 

Syntax for Windows°Vista and Windows Server 2008:

 
 
wbadmin start backup
[-backupTarget:{<BackupTargetLocation> | <TargetNetworkShare>}]
[-include:<VolumesToInclude>]
[-allCritical]
[-noVerify]
[-user:<UserName>]
[-password:<Password>]
[-noinheritAcl]
[-vssFull]
[-quiet]

Syntax for Windows°7 and Windows Server 2008 R2:

 
 
Wbadmin start backup
[-backupTarget:{<BackupTargetLocation> | <TargetNetworkShare>}]
[-include:<ItemsToInclude>]
[-nonRecurseInclude:<ItemsToInclude>]
[-exclude:<ItemsToExclude>]
[-nonRecurseExclude:<ItemsToExclude>]
[-allCritical]
[-systemState]
[-noVerify]
[-user:<UserName>]
[-password:<Password>]
[-noInheritAcl]
[-vssFull | -vssCopy] 
[-quiet]
Parameters
 
 

 

Parameter Description

-backupTarget

Specifies the storage location for this backup. Requires a hard disk drive letter (f:), a volume GUID-based path in the format of \\?\Volume{GUID}, or a Universal Naming Convention (UNC) path to a remote shared folder (\\<servername>\<sharename>\). By default, the backup will be saved at: \\<servername>\<sharename>\WindowsImageBackup\<ComputerBackedUp>\.

ImportantImportant
If you save a backup to a remote shared folder, that backup will be overwritten if you use the same folder to back up the same computer again. In addition, if the backup operation fails, you may end up with no backup because the older backup will be overwritten, but the newer backup will not be usable. You can avoid this by creating subfolders in the remote shared folder to organize your backups. If you do this, the subfolders will need twice the space as the parent folder.

 

 

-include

For Windows°Vista and Windows Server 2008, specifies the comma-delimited list of volume drive letters, volume mount points, or GUID-based volume names to include in the backup. This parameter should be used only when the -backupTarget parameter is used.

For Windows°7 and Windows Server 2008 R2, specifies the comma-delimited list of items to include in the backup. You can include multiple files, folders, or volumes. Volume paths can be specified using volume drive letters, volume mount points, or GUID-based volume names. If you use a GUID-based volume name, it should be terminated with a backslash (\). You can use the wildcard character (*) in the file name when specifying a path to a file. Should be used only when the -backupTarget parameter is used.

-exclude

For Windows°7 and Windows Server 2008 R2, specifies the comma-delimited list of items to exclude from the backup. You can exclude files, folders, or volumes. Volume paths can be specified using volume drive letters, volume mount points, or GUID-based volume names. If you use a GUID-based volume name, it should be terminated with a backslash (\). You can use the wildcard character (*) in the file name when specifying a path to a file. Should be used only when the -backupTarget parameter is used.

-nonRecurseInclude

For Windows°7 and Windows Server 2008 R2, specifies the non-recursive, comma-delimited list of items to include in the backup. You can include multiple files, folders, or volumes. Volume paths can be specified using volume drive letters, volume mount points, or GUID-based volume names. If you use a GUID-based volume name, it should be terminated with a backslash (\). You can use the wildcard character (*) in the file name when specifying a path to a file. Should be used only when the -backupTarget parameter is used.

-nonRecurseExclude

For Windows°7 and Windows Server 2008 R2, specifies the non-recursive, comma-delimited list of items to exclude from the backup. You can exclude files, folders, or volumes. Volume paths can be specified using volume drive letters, volume mount points, or GUID-based volume names. If you use a GUID-based volume name, it should be terminated with a backslash (\). You can use the wildcard character (*) in the file name when specifying a path to a file. Should be used only when the -backupTarget parameter is used.

-allCritical

Specifies that all critical volumes (volumes that contain operating system's state) be included in the backups. This parameter is useful if you are creating a backup for bare metal recovery. It should be used only when -backupTarget is specified, otherwise the command will fail. Can be used with the -include option.

TipTip
The target volume for a critical-volume backup can be a local drive, but it cannot be any of the volumes that are included in the backup.

 

 

-systemState

For Windows°7 and Windows Server 2008 R2, creates a backup that includes the system state in addition to any other items that you specified with the -include parameter. The system state contains boot files (Boot.ini, NDTLDR, NTDetect.com), the Windows Registry including COM settings, the SYSVOL (Group Policies and Logon Scripts), the Active Directory and NTDS.DIT on Domain Controllers and, if the certificates service is installed, the Certificate Store. If your server has the Web server role installed, the IIS Metadirectory will be included. If the server is part of a cluster, Cluster Service information will also be included.

-noVerify

Specifies that backups saved to removable media (such as a DVD) are not verified for errors. If you do not use this parameter, backups saved to removable media are verified for errors.

-user

If the backup is saved to a remote shared folder, specifies the user name with write permission to the folder.

-password

Specifies the password for the user name that is provided by the parameter -user.

-noInheritAcl

Applies the access control list (ACL) permissions that correspond to the credentials provided by the -user and -password parameters to \\<servername>\<sharename>\WindowsImageBackup\<ComputerBackedUp>\ (the folder that contains the backup). To access the backup later, you must use these credentials or be a member of the Administrators group or the Backup Operators group on the computer with the shared folder. If -noInheritAcl is not used, the ACL permissions from the remote shared folder are applied to the <ComputerBackedUp> folder by default so that anyone with access to the remote shared folder can access the backup.

-vssFull

Performs a full back up using the Volume Shadow Copy Service (VSS). All files are backed up, each file's history is updated to reflect that it was backed up, and the logs of previous backups may be truncated. If this parameter is not used wbadmin start backup makes a copy backup, but the history of files being backed up is not updated.

CautionCaution
Do not use this parameter if you are using a product other than Windows Server Backup to back up applications that are on the volumes included in the current backup. Doing so can potentially break the incremental, differential, or other type of backups that the other backup product is creating because the history that they are relying on to determine how much data to backup might be missing and they might perform a full backup unnecessarily.

 

 

-vssCopy

For Windows 7 andWindows Server 2008 R2, performs a copy backup using VSS. All files are backed up but the history of the files being backup up is not updated so you preserve the all the information on which files where changed, deleted, and so on, as well as any application log files. Using this type of backup does not affect the sequence of incremental and differential backups that might happen independent of this copy backup. This is the default value.

WarningWarning
A copy backup cannot be used for incremental or differential backups or restores.

 

 

-quiet

Runs the subcommand with no prompts to the user.

Examples
 
 

The following examples show how the wbadmin start backup command can be used in different backup scenarios:

Scenario #1

  • Create a backup of volumes e:, d:\mountpoint, and \\?\Volume{cc566d14-4410-11d9-9d93-806e6f6e6963}

  • Save the backup to volume f:

 
 
wbadmin start backup -backupTarget:f: -include:e:,d:\mountpoint,\\?\Volume{cc566d14-44a0-11d9-9d93-806e6f6e6963}\

Scenario #2

  • Perform a one-time backup of f:\folder1 and h:\folder2 to volume d:.

  • Backup the system state

  • Make a copy backup so that the normally scheduled differential backup is not impacted.

 
 
wbadmin start backup –backupTarget:d: -include:g\folder1,h:\folder2 –systemstate -vsscopy

Scenario #3

  • Perform a one-time backup of d:\folder1 that should be backed up non-recursively.

  • Backup the folder to the network location \\backupshare\backup1

  • Restrict access to the backup to members of the Administrators or Backup Operators group.

 
 
wbadmin start backup –backupTarget: \\backupshare\backup1 -noinheritacl -nonrecurseinclude:d:\folder1

What is the difference between VSS Full Backup and VSS Copy Backup in Windows Server 2008?

We sometimes get people asking about the difference between VSS Full Backup and VSS Copy Backup in Windows Server 2008.

 

Basically, for certain applications (such as Exchange), VSS Copy Backup preserves logs and VSS Full Backup truncate logs. Yes, we know, this explanation is not very enlightening per se…

 

The point is that some applications create log files. For example, Exchange server creates a transaction log file. If you are using only Windows Server Backup to protect the applications, you can use any option to backup the data. However, if you are using a third party backup application, you should not use VSS Full Backup because it will delete the logs at the end of the backup. If the third party backup application relies on those logs to take incremental backups, it would take full backups all the time – a less than optimal situation…

 

So, when you do a VSS full backup, you create backup of all the files – but after that, the backup application may truncate logs on the file system.

 

On the other hand, when you do a VSS copy backup, all files are backed up and you preserve the all the applications files including log files on the live system. That means, you do preserve information on which files where changed, deleted, etc, and this will not affect the sequence of incremental and differential that might happen independent of the copy backup. Therefore, a copy backup cannot be used as a starting point for incremental/differential backups/restores.

 

Just a final technical note: The backup type (full, copy, incremental) can be specified by a VSS-based backup application at the beginning of the backup session, using the IVssBackupComponents::SetBackupState. In response to that, any application that implements a VSS writer can choose to truncate the logs in the OnBackupComplete VSS event. This is one of the last events that a VSS-based backup application (such as DPM) sends to all affected writer at the end of the backup session.

Windows Server Backup

删除Windows Server Backup控制台上操作历史记录

首先在命令行状态运行Wbadmin delete catalog删除记录,然后打开事件查看器,打开BACKUP事件,清除所有事件,再打开Windows Server Backup控制台就没有备份还原历史记录了。最后可以删除备份文件夹了。

删除Windows Server Backup创建的含有其他文件的备份副本

参考网址:http://bbs.51cto.com/thread-1032029-1.html

经过微软确认,Windows Server 2008 R2的wbadmin的删除功能,确实只能用于纯system state备份的删除。如果包含其他backup,则不能用这个命令删除。换句话说,使用-allCritical参数备份的,wbadmin不能删除。

每次运行Windows Server Backup备份,程序除了创建WindowsImageBackup目录下的备份文件并产生一个快照ID外,由于是通过VSS程序,所以还会在System Volume Information目录下创建一个卷影副本文件,且二者的ID号相同。

diskshadow删除的是卷影副本,备份副本并没有删除。简单的说,通过diskshadow删除的只是目标卷下System Volume Information目录下的卷影副本文件,而备份文件夹WindowsImageBackup下的文件,diskshadow是不会删除的。

删除记录或卷影副本后,WindowsImageBackup目录下的备份文件可以手动删除。

微软官方资料:http://blogs.technet.com/b/filecab/archive/2009/06/22/backup-version-and-space-management-in-windows-server-backup.aspx

相关命令

vssadmin list shadows
diskshadow
delete shadows all
exit
wbadmin delete catalog
wbadmin start backup -allCritical -backuptarget:e:
wbadmin get versions
wbadmin delete systemstatebackup -keepversion:0

注:2012 的 wbadmin 删除属性多了一个 -backup 参数,用这个参数可以删除备份。

About Us

Since 1996, our company has been focusing on domain name registration, web hosting, server hosting, website construction, e-commerce and other Internet services, and constantly practicing the concept of "providing enterprise-level solutions and providing personalized service support". As a Dell Authorized Solution Provider, we also provide hardware product solutions associated with the company's services.
 

Contact Us

Address: No. 2, Jingwu Road, Zhengzhou City, Henan Province

Phone: 0086-371-63520088 

QQ:76257322

Website: 800188.com

E-mail: This email address is being protected from spambots. You need JavaScript enabled to view it.