Australian cloud for business software — built and run in Sydney since 2002

NetLeverage
NetLeverage

System state backups filling the backup disk: wbadmin delete systemstatebackup and -keepVersions

Technical article
Backup & Recovery

About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.

Microsoft documents that in Windows Server 2008 the space for system state backups is not managed automatically, so versions can accumulate until the target disk is full. For Windows Server 2016 to 2025, Microsoft's wbadmin pages say nothing either way, so first confirm with wbadmin get versions that versions really are piling up before you delete any. wbadmin delete systemstatebackup is the documented way to remove them, by count, by version or by age order.

Choose the count with care. -keepVersions counts versions, not days. On a domain controller, the newest version you keep must still be younger than the forest's tombstone lifetime, or it cannot be restored into a working domain.

What the symptom means

Microsoft's start systemstatebackup page says the command "creates a system state backup of the local computer and stores it on the location specified". The target is a drive letter or a GUID volume path, and the page also allows a \\servername\sharedfolder\ location.

Where the backups pile up, and how fast, depends on the release. Microsoft's page for Windows Server 2008 and 2008 R2 says that in Windows Server 2008 each system state backup is a full backup stored in its own directory, so every run needs the space of a full backup. In Windows Server 2008 R2 they are incremental and use shadow copies, "making better use of disk space". The 2009 post for those releases adds that space for system state backups in Windows Server 2008 is not managed automatically. The pages for Windows Server 2016 to 2025 do not say how a system state version is stored or sized, so measure it on your own server.

Microsoft's 2011 post on automatic disk usage management says the clean-up route for these backups is the command itself: "If you want to delete the system state backup, you may use wbadmin delete systemstatebackup in command shell." It adds that the tool "does not support backup deletion of other kinds".

The command takes one of three selectors, and only one:

  • -keepVersions:<number> keeps the newest that many system state backups and deletes the rest. "The value must be a positive integer. The parameter value -keepversions:0 deletes all the system state backups."
  • -version:<identifier> deletes the one backup named in MM/DD/YYYY-HH:MM form.
  • -deleteOldest deletes the oldest system state backup.

Three details decide whether it helps. It runs only from an elevated prompt, as a member of Backup Operators or Administrators. -backupTarget is needed to find backups that are not on the local computer, and -machine names the computer when several share one location. And "Versions made up of exclusively system state backups can be deleted using this command." A version taken together with volumes is not removed by it.

Likely causes

Cause What you see How to confirm
A schedule or script makes system state backups and nothing deletes any The list of versions grows by one per run until the disk is full wbadmin get versions -backupTarget:<volume> lists many versions; the target's free space keeps falling
System state is bundled into full or volume backups (-systemState on start backup) delete systemstatebackup leaves the space unchanged wbadmin get items -version:<identifier> shows the version contains more than system state
Several computers back up to the same disk The disk is full but your own system state versions are few wbadmin get versions -backupTarget:<volume> -machine:<name> for each computer
The delete command is scripted as -deleteOldest on a timetable while backups are failing Fewer versions than planned, then none Compare wbadmin get versions with the job history; the newest version stops getting newer
Each version has grown (larger Active Directory database, SYSVOL or certificate store) The same count of versions fills the disk sooner than before Compare the target's growth per run
Release 2008 behaviour: every version is a full copy Space use grows by the full size each run Compare with the 2008 page; confirm on your own release

Prove the cause before changing anything

These steps read only. Run them elevated.

  1. wbadmin get versions -backupTarget:<volume> -machine:<computername>. The page says this lists "the backup time, the backup storage location, the version identifier, and the type of recoveries you can perform". Without parameters it lists all backups of the local computer, "even if those backups are not available".
  2. wbadmin get items -version:<identifier> for each version you intend to remove. Microsoft's delete page says to use this to view the version type. Anything that includes volumes cannot be removed by the system state command.
  3. Check the free space of the target volume in File Explorer or Disk Management, and note it before and after.
  4. On a domain controller, find the tombstone lifetime. Microsoft says the attribute tombstoneLifetime sits on the object CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration,DC=COMPANY,DC=COM, viewed with Adsiedit.msc, Ldp.exe or an ADSI script. Per the same page, the default is 60 days, and a forest created with Windows Server 2003 SP1 media is set to 180; the page does not list later releases. Read the actual value rather than assuming.
  5. Work out the age of your newest successful version in days. It must be below the tombstone lifetime.

A good result: every version you plan to delete is system-state-only, the newest version is recent, and its age is well inside the tombstone lifetime. A bad result: the newest version is older than the tombstone lifetime. Do not delete anything in that case until you have a newer backup.

Fix

Take the new backup, then delete. Run wbadmin start systemstatebackup -backupTarget:<volume> -quiet first. Confirm it produced a new version with wbadmin get versions. Microsoft's delete and start systemstatebackup pages do not document exit codes, so check the version list or Get-WBSummary (it shows the last successful backup) rather than assuming success. Only then delete.

Prefer -keepVersions to -deleteOldest in a schedule. The Microsoft examples are wbadmin delete systemstatebackup -keepVersions:3 ("delete all system state backups, except the three most recent") and wbadmin delete systemstatebackup -backupTarget:f:\ -deleteOldest. -keepVersions never reduces the history below the number you chose, even when backups fail. A scheduled -deleteOldest keeps removing one version per run whether or not a new one was made.

Disruptive step: wbadmin delete systemstatebackup removes backups for good. Microsoft's page gives no undo. -keepVersions:0 deletes every system state backup, and -quiet removes the confirmation prompt. Test the command on a scratch target before putting it in a schedule.

Choose the number from the timetable. Work backwards. Versions kept = days of history you need ÷ days between backups, plus a spare. Then check that the age of the newest version after a worst-case failure stays under the tombstone lifetime.

More room. If the count you need does not fit, use a larger disk or add a second location. A second copy on separate storage protects against loss of the first.

Example (illustrative): dc01 takes a daily system state backup to a dedicated 100 GB volume F:. Suppose you measured that each version takes 18 GB of the volume (read the free space before and after a run; Windows Server 2008 stored each as a full copy, and your release may differ). Then 100 ÷ 18 = 5.56, so five versions (90 GB) fit and the sixth, needing 108 GB, does not fit on day six. With -keepVersions:3 run after each successful backup, the peak is the three kept plus the one being created: 4 × 18 = 72 GB, which fits with 28 GB to spare. History is three days. Say the domain's tombstone lifetime is 60 days. If backups then fail from day four onward, -keepVersions:3 still leaves the last three in place, and the newest of them (taken on day three) passes 60 days of age on day 63. That is the window to fix the job. A schedule using -deleteOldest would have removed those versions one a day.

Confirm the fix

  • After the delete, wbadmin get versions -backupTarget:<volume> should list exactly the number you kept.
  • The target volume's free space should rise by the size of the versions removed. If it does not, those versions were not system-state-only, or the space is used by other computers' backups.
  • The next scheduled run should create a new version without a space error.
  • A listed version is not a tested restore. For a domain controller, rehearse a restore in an isolated lab, because a restore into the live domain is a different operation.

What to watch afterwards

  • The age of the newest successful version. Alert when it is older than one backup interval plus a margin, long before it nears the tombstone lifetime.
  • Free space on the target after each run, as well as the version count.
  • Any change to the server's role. A new certificate authority or growing directory adds to each version.
  • Whether the delete job still runs after the backup job, and not before it.

Risks and limits

  • These commands have not been run or lab-tested.
  • Microsoft's pages for 2016 to 2025 do not say whether a system state version is a full or incremental copy. The worked example uses a per-version size you measure yourself; Windows Server 2008 stored each version as a full copy, and 2008 R2 stored them incrementally.
  • The delete command removes only versions made up exclusively of system state. Space held by full or volume backups needs another approach.
  • The tombstone figures come from a page describing Windows Server 2003 SP1 era forests. A forest can have been set to another value.
  • Backups of other computers on the same target are untouched by this command, so they continue to use the disk.
  • Deleting is permanent. Keep a copy of any system state backup you may need on separate storage first.

Sources