Volume Shadow Copy Troubleshooting, Delete existing shadow copies on windows server using command line , vssadmin command examples, use of diskshadow command

Vssadmin command

A quite useful built-in command which you can use as a starting point while troubleshooting the Shadow Copies is Vssadmin. Lets run this command with different parameters and check the results.

There are different switches / commands which can be used with vssadmin. To show / list the different commands, Open Powershell as Administrator or Command prompt as an Administrator and type vssadmin

VSSadmin
CommandDescriptionAvailability
Vssadmin add shadowstorageAdds a volume shadow copy storage association.Server only
Vssadmin create shadowCreates a new volume shadow copy.Server only
Vssadmin delete shadowsDeletes volume shadow copies.Client and Server
Vssadmin delete shadowstorageDeletes volume shadow copy storage associations.Server only
Vssadmin list providersLists registered volume shadow copy providers.Client and Server
Vssadmin list shadowsLists existing volume shadow copies.Client and Server
Vssadmin list shadowstorageLists all shadow copy storage associations on the system.Client and Server
Vssadmin list volumesLists volumes that are eligible for shadow copies.Client and Server
Vssadmin list writersLists all subscribed volume shadow copy writers on the system.Client and Server
Vssadmin resize shadowstorageResizes the maximum size for a shadow copy storage association.Client and Server
Source:Microsoft

Ensure that the VSS writers are in Stable State

Run the Command <strong>vssadmin list writers</strong> and make sure that all the VSS writers are in [1] stable state. you may see different vss writers depending upon application server you are running this command e.g. If you are running this command on Microsoft Exchange Server, you will see [Writer name: ‘Microsoft Exchange Writerin addition to the other vss writers. If Microsoft Exchange Writer status is not stable, Restart the Microsoft Exchange Information Store Service or restart Exchange Server and check the writer state again before re-starting the backup job.

VSSAdmin list writers

Ensure that you can see Registered Shadow Copy Providers

To list the currently registered shadow copy providers, Run the command vssadmin list providers

vssadmin list providers

If you do not see providers listed after running the above command it could be OS related issue or the Volume Shadow Copy Service is not running.

List existing Volume Shadow Copies

To list existing shadow Copies use the command <strong>vssadmin list shadows</strong>

vssadmin list shadows

Lists all shadow copy storage associations on the system.

Run below command to see all storage associations for the existing shadow copies. The default storage allocates 10% of the volume to the shadow copies.

vssadmin list shadowstorage

You can also check the Shadow Copy Storage Association on the volume using GUI Method by Right Clicking the Volume -> Properties -> click Shadow Copies Tab.

Shadow Copies

Run the command <strong>vssadmin list shadowstorage /?</strong> to get more parameters which you can use with this command. For example you can use /for parameter to list all associations for a specified volume.

vssadmin list shadowstorage /?

Delete Shadow Copies using command line

There are few options or commands you can use to delete the shadow copies. Shadow Copies data is stored in a folder called System Volume information which is a hidden system folder. If you see that the System volume information folder is quite big in size and consuming a lot of space then you can check if you got any stale shadow copies which might be stored in this system folder and which you may want to delete to free up the space. If you decided to get rid of shadow copies from the volume then follow below command line options to complete your task.

wmic command

Use <strong>wmic</strong> command to delete the shadow copies. When you run this command, you will be on the wmic:\root\cli> prompt. Type <strong>shadowcopy delete</strong> to delete the the shadow copies one by one. type Y to delete the shadow copy or N to skip to next shadow copy.

Note: To find the shadow copy ID use the command <strong>vssadmin list shadows</strong>. After using wmic command if you find that the shadow copies are not deleted or you get an error message as shown in the below screenshot, you can either use Vssadmin delete shadows command or <strong>Diskshadow </strong>command as shown in the next sections.

wmic

Vssadmin delete shadows

vssadmin delete shadows command can be used to delete all shadow copies or specific shadow copies from the volume. Use the /? in the end of the command to list parameters which you can use with this command. To delete all shadow copies using vssadmin delete shadows command, you can use below command.

<strong>Vssadmin delete shadows /all</strong>

diskshadow Command

You can also use <strong>diskshadow </strong>command to delete all the shadow copies from the system. Open command prompt as administrator -> Type <strong>diskshadow </strong>-> then on the <strong>DISKSHADOW</strong>> prompt type <strong>delete shadows all</strong> to delete / remove all shadow copies from the server.

Diskshadow command reference

diskshadow

Best Practices

Best Practice when configuring the Shadow Copy is to use a disk which will not be shadow copied and have enough free space to store the shadow copies as per the configuration. You get below message when setting it up which suggest the same.

Enable Shadow Copies

External References

Volume Shadow Copy Service | Microsoft Docs

Subscribe to Stay Connected

Thank you for visiting TechPress 👍. When you subscribe to the blog, email notification ✉ will be sent to you when a new blog post is published. You can unsubscribe at any time.

guest
2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments