How to troubleshoot Volume shadow Copies on Windows

What is Volume Shadow Copy Service(VSS)?

The Volume Shadow Copy Service in the Windows operating system enables you to create consistent backups of open files and applications. It allows you to generate shadow copies of shared folders on your file server or Windows client OS at regular intervals.

If a user accidentally deletes a file from a file server, you can efficiently retrieve and restore the file from the shadow copy backup.

1. Vssadmin command

To begin troubleshooting Shadow Copies, a valuable built-in command is ‘Vssadmin‘. Let’s run this command with various parameters to check the results.

Vssadmin offers different switches and commands for managing Volume Shadow Copies. To view a list of these commands, open PowerShell or Command Prompt as an Administrator and type vssadmin /? and press Enter.

VSSadmin
Vssadmin /? command
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

2. Ensure that the VSS writers are in Stable State

Run the vssadmin list writers command and confirm that all VSS writers are in a stable state. Depending on the application server where you’re using this command, you may find various VSS writers. For instance, on a Microsoft Exchange Server, you will find ‘Microsoft Exchange Writer‘ in addition to other VSS writers.

If the status of the Microsoft Exchange Writer is not stable, consider restarting the ‘Microsoft Exchange Information Store Service‘ or the entire Exchange Server. Afterward, recheck the writer states before resuming the backup job.

Vssadmin list writers
Vssadmin list writers

3. 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
vssadmin list providers

If you don’t see any providers listed after running the command above, it might be due to an issue related to the operating system, or it could indicate that the Volume Shadow Copy Service is not running.

4. List Existing Volume Shadow Copies

To list existing shadow Copies use the command vssadmin list shadows.

vssadmin list shadows
vssadmin list shadows

5. Lists all Shadow copy storage associations

To view all storage associations for existing shadow copies, run the following command. By default, the storage allocates 10% of the volume to the shadow copies.

vssadmin list shadowstorage
vssadmin list shadowstorage

You can also check the Shadow Copy Storage Association on the volume using a graphical method. Simply right-click the volume > Properties > Shadow Copies tab.

Shadow Copies
Shadow Copies

To explore additional parameters for the ‘vssadmin list shadowstorage’ command, run ‘vssadmin list shadowstorage /?‘ This will provide you with more options, such as the ‘/for‘ parameter, which allows you to list all associations for a specified volume.

vssadmin list shadowstorage /?
vssadmin list shadowstorage /?

6. Delete Shadow Copies using Command line

You have several options for deleting shadow copies. The shadow copy data is stored in a hidden system folder called ‘System Volume Information‘. If you notice that this folder is taking up a significant amount of space, you can check for outdated shadow copies that might be stored there and decide to delete them to free up space.

If you choose to remove shadow copies from the volume, you can follow the command-line options below to accomplish the task.

wmic command

Use the ‘wmic‘ command to delete shadow copies. When you run this command, you’ll be at the ‘wmic:\root\cli>‘ prompt. Type ‘shadowcopy delete‘ to delete the shadow copies one by one. Type ‘Y‘ to confirm the deletion of a shadow copy or ‘N‘ to skip to the next one.

Note: To find the shadow copy ID, use the command ‘vssadmin list shadows‘. If, after using the ‘wmic‘ command, you find that the shadow copies are not deleted or encounter an error message, you have the option to use either the ‘Vssadmin delete shadows‘ command or the ‘Diskshadow‘ command, as demonstrated in the following sections.”

wmic
wmic command example

Vssadmin delete shadows

The vssadmin delete shadows command allows you to delete either all shadow copies or specific shadow copies from the volume. To see a list of parameters that can be used with this command, add /? to the end of the command.

If you wish to delete all shadow copies using the vssadmin delete shadows command, you can use the following command.

Vssadmin delete shadows /all

diskshadow Command

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

Diskshadow command reference

diskshadow
diskshadow command

Best Practices

The best practice when configuring Shadow Copy is to use a disk that won’t be shadow copied and has sufficient free space to accommodate the shadow copies according to the configuration. This is reinforced by the message you receive when setting it up.

Enable Shadow Copies
Enable Shadow Copies

Error code 0x80042302

You may receive this error message during a Windows device backup or system restore, “A Volume Shadow Copy Service component encountered an unexpected error. Check the Application event log for more information“.

To resolve this error, follow below troubleshooting steps:

  1. Press the Windows key + R to open a Run dialog box.
  2. Type services.msc and press Enter.
  3. In the list of services, locate the ‘Volume Shadow Copy‘ service.
  4. Check its ‘Startup Type‘ If it’s disabled, double-click on the service.
  5. Change the ‘Startup type’ to ‘Automatic‘.
Enable Volume Shadow Copy service and change its Startup type to automatic
  1. Ensure that the Microsoft Software Shadow Copy Provider service is not disabled. If it is disabled, you should double-click on the service and set the Startup type to ‘Automatic‘.
enable Microsoft Software Shadow Copy Provider service
  1. If the error message persists, you can attempt to temporarily disable Windows Defender and any third-party security systems installed on the device.
  1. Try to initiate the backup or perform the system restore again to check if the issue is resolved. After completing the backup process, remember to re-enable your security systems and Windows Defender.
  1. Perform a Clean boot of your Windows device. To enable a clean boot on the device:
    • Press Windows Key + R to open the Run box.
    • Type msconfig.exe in the run box.
    • Go to the General tab and uncheck Load startup items from Selective startup.
Perform a clean boot of windows Uncheck load startup items
  • In the Services tab, choose ‘Hide all Microsoft services‘ and then click the ‘Disable All‘ button located in the bottom right-hand corner of the window.
Hide all Microsoft services msconfig.exe
  • Click on Apply or OK to save the changes.
  • Restart your device.

Test the Volume Shadow Copy to ensure it’s functioning correctly. Once you’ve completed troubleshooting the error, be sure to change the startup type back to ‘Normal startup

msconfig normal startup while troubleshooting 0x80042302

More Information

Volume Shadow Copy Service | Microsoft Docs

Conclusion

In this blog post, we’ve explored troubleshooting issues related to shadow copies. The ‘vssadmin’ command is a valuable tool when working on Windows devices, and you can find examples of these commands along with screenshots.

3 thoughts on “How to troubleshoot Volume shadow Copies on Windows”

Leave a Comment