Table of Contents
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.
Command | Description | Availability |
Vssadmin add shadowstorage | Adds a volume shadow copy storage association. | Server only |
Vssadmin create shadow | Creates a new volume shadow copy. | Server only |
Vssadmin delete shadows | Deletes volume shadow copies. | Client and Server |
Vssadmin delete shadowstorage | Deletes volume shadow copy storage associations. | Server only |
Vssadmin list providers | Lists registered volume shadow copy providers. | Client and Server |
Vssadmin list shadows | Lists existing volume shadow copies. | Client and Server |
Vssadmin list shadowstorage | Lists all shadow copy storage associations on the system. | Client and Server |
Vssadmin list volumes | Lists volumes that are eligible for shadow copies. | Client and Server |
Vssadmin list writers | Lists all subscribed volume shadow copy writers on the system. | Client and Server |
Vssadmin resize shadowstorage | Resizes 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.
3. Ensure that you can see Registered Shadow Copy Providers
To list the currently registered shadow copy providers, Run the command 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
.
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.
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.
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.
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.”
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.
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.
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:
- Press the Windows key + R to open a Run dialog box.
- Type services.msc and press Enter.
- In the list of services, locate the ‘Volume Shadow Copy‘ service.
- Check its ‘Startup Type‘ If it’s disabled, double-click on the service.
- Change the ‘Startup type’ to ‘Automatic‘.
- 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‘.
- If the error message persists, you can attempt to temporarily disable Windows Defender and any third-party security systems installed on the device.
- 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.
- 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.
- 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.
- 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‘
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.
Thanks so much!!!! WMIC !!!!
No Problem, Livio Mozarth.
Excellent article, thanks!