Chapter 22. Using Volume Shadow Copy

Using Volume Shadow Copy

Volume Shadow Copy service is a new feature of Microsoft Windows Server 2003. It offers two important features:

  • Shadow copying of files in shared folders Allows you to configure volumes so that shadow copies of files in shared folders are created automatically at specific intervals during the day. This allows you to go back and look at earlier versions of files stored in shared folders. You can use these earlier versions to recover deleted, incorrectly modified, or overwritten files. You can also compare versions of files to see what changes were made over time. Up to 64 versions of files are maintained.

  • Shadow copying of open or locked files for backups Allows you to use backup programs, such as Windows Backup, to back up files that are open or locked. This means you can back up when applications are using the files and no longer have to worry about backups failing because files were in use. Backup programs must implement the Volume Shadow Copy application programming interface (API).

Both features are independent of each other. You do not need to enable shadow copying of a volume to be able to back up open or locked files on a volume. This chapter primarily focuses on shadow copying of files in shared folders. Chapter 41, examines backups.

Shadow Copy Essentials

Shadow copying of files in shared folders is a feature administrators can use to create backup copies of files on designated volumes automatically. You can think of these backup copies as point-in-time snapshots that can be used to recover previous versions of files. Normally, when a user deletes a file from a shared folder, it is immediately deleted and doesn't go to the local Recycle Bin. This means the only way to recover it is from backup. The reason for this is that when you delete files over the network, the files are permanently deleted on the remote server and never make it to the Recycle Bin. This changes with shadow copying. If a user deletes a file from a network share, she can go back to a previous version and recover it—and she can do this without needing assistance from an administrator.

Using Shadow Copies of Shared Folders

Shadow copies of shared folders are designed to help recover files that were accidentally deleted, corrupted, or inappropriately edited. Once you configure shadow copies on a server, the server creates and maintains previous versions of all files and folders created on the volumes you've specified. It does this by creating snapshots of shared folders at predetermined intervals and storing these images in shadow copy storage in such a way that users and administrators can easily access the data to recover previous versions of files and folders.

Ideally, once you implement shadow copies throughout the organization and show users how to use the feature, users will be able to recover files and folders without needing assistance. This allows users to manage their own files, resolve problems, and fix mistakes. It also saves time and money because previous versions can be recovered quickly and easily and resources that would have been used to recover files and perform related tasks can be used elsewhere.

When planning to deploy shadow copies in your organization, look at the shared folders that are in use. When you identify the ones that would benefit from this feature, note the volumes on which those shares are located. Those are the volumes for which you will need to configure shadow copying. You might also want to consider changing the way users' personal data is stored. In Windows Server 2003, you can centrally manage user data folders through file shares, and then if you configure shadow copies on these file shares, users will have access to previous versions of all their data files and folders. The folders you can centrally manage are the following:

  • Application Data

  • Desktop

  • Start Menu

  • My Documents

  • My Pictures

You configure central management of these folders through Group Policy. When you do this, you want to redirect the root path for these folders to a file share.

How Shadow Copies Works

Shadow Copies for Shared Folders is made possible through the Shadow Copy API. The shadow copy driver (Volsnap.sys) and the Volume Shadow Copy service executable (Vssvc.exe) are key components used by this API. When you enable shadow copies on a server, the server is configured to a client-accessible shadow copy service provider. The default provider is the Microsoft Software Shadow Copy Provider, and it is responsible for providing the necessary interface between clients that want to access shadow copies and clients that write shadow copies or information pertaining to shadow copies, called Volume Shadow Copy service writers.

A number of shadow copy service writers are installed by default and other writers can be installed when you install other programs, such as third-party backup software. The default writers installed depend on the system configuration and include the following:

  • System Writer The standard shadow copies writer used by the operating system

  • File Replication Service (FRS) Writer Shadow copies writer used by FRS so that inuse files can be backed up, primarily on domain controllers

  • Event Log Writer Shadow copies writer used by other writers to write events in the event logs. Most shadow copy events are written to the Application log with the event source as VolSnap

  • Registry Writer Shadow copies writer used by other writers to make Registry changes

  • DHCP Jet Writer Shadow copies writer used to make backups of files in use by the Dynamic Host Configuration Protocol (DHCP)

  • WINS Jet Writer Shadow copies writer used to make backups of files in use by the Windows Internet Naming Service (WINS)

  • NT Directory Service (NTDS) Writer Shadow copies writer used to make backups of files in use by NTDS

  • Microsoft Data Engine (MSDE) Writer Used to write shadow copy data

  • IIS Metabase Writer Shadow copies writer used to make backups of Microsoft Internet Information Services (IIS) metabase files

  • Windows Management Instrumentation (WMI) Writer Standard WMI writer for shadow copies

  • Remote Storage Writer Shadow copies writer used to make backups of file in use by Remote Storage

  • Certification Authority Writer Shadow copies writer used to make backups of files in use by Microsoft Certificate service

  • Microsoft Exchange Writer Shadow copies writer used to make backups of files in use by Microsoft Exchange Server

Tip

You can list available shadow copy providers by typing vssadmin list providers at the command line. To list shadow copy writers, type vssadmin list writers.

To create copies of previous versions of files, Shadow Copies for Shared Folders uses a differential copy procedure. With this technique, only copies of files that have changed since the last copy are marked for copying. During the copy procedure, Shadow Copies for Shared Folders creates the previous version data in one of two ways:

  • If the application used to change a file stored details of the changes, Shadow Copies for Shared Folders performs a block-level copy of any changes that have been made to files since the last save. Thus, only changes are copied, not the entire file.

  • If the application used to change a file rewrote the entire file to disk, Shadow Copies for Shared Folders saves the entire file as it exists at that point in time.

If you're wondering exactly how this works, I was too at first, then I started experimenting. An example of an application that can save changes or full copies is Microsoft Word. If you enable Fast Saves in Word, only changes to a file are written to disk. If you clear the Fast Saves option, Word writes a complete copy of the file when you save it.

As mentioned previously, Shadow Copies for Shared Folders runs at predefined intervals. These predefined intervals are set as the run schedule when you configure shadow copying of a volume. As with other processes that have a run schedule, a scheduled task is created that is used to trigger shadow copying at the specified times. Because of this, Shadow Copies for Shared Folders is dependent on the Schedule Task service. If this service is stopped or improperly configured, shadow copying will not work.

Implementing Shadow Copies for Shared Folders

Implementing Shadow Copies for Shared Folders isn't something you should do haphazardly. You should take the time to plan out the implementation. Key issues that you should consider include the following:

  • Copy volumes For which volumes should shadow copying be configured?

  • Disk space How much disk space will be needed for shadow copying, and is there enough available space on existing volumes?

  • Shadow storage Where should the shadow copies be stored and on which volumes?

  • Run schedule How often should shadow copies be made?

Start your planning by considering for which volumes you want to configure shadow copies. Once you configure this feature, shadow copies will be created of files in the shared folders on these volumes. To implement shadow copying of files of shared folders, you enable shadow copying of the volume in which the shared folders are located. The initial shadow copy requires at least 100 megabytes (MB) of free space to create, regardless of how much data is stored in the volume's shared folders. The disk space used by Shadow Copies of Shared Folders is referred to as shadow storage. Shadow Copies uses this space to store previous versions of files and as a work area when it is taking snapshots. Because of this, the actual amount of space used for shadow storage is different from the amount of space allocated for shadow storage.

The amount of disk space available shouldn't be overlooked. The Shadow Copy service will save up to 64 versions of each file in shared folders and, by default, will configure its maximum space usage as up to 10 percent of the volume. Once set, the maximum size is fixed unless you change it. The service won't, however, reexamine free space later to determine if this maximum value should be changed. If a volume runs out of space, shadow copying will fail and errors will be generated in the event logs.

When you plan out your shadow copies implementation, you should think carefully about where shadow storage will be located. Shadow storage can be created on the volumes for which you are creating shadow copies or on different volumes. If you have busy file servers or you must scale this feature to serve many users or an increasing number of users, it might be best to use a separate volume on a separate drive for shadow storage.

Tip

Use the command-line tools to examine shadow storage

You can determine how much space is allocated to and used by shadow storage by using the VSSADMIN LIST SHADOWSTORAGE command. Working with this command is discussed in the section entitled "Configuring Shadow Copies at the Command Line" later in this chapter.

Shadow copying is a resource-intensive process. By default, when you configure shadow copying on a volume, copies are made at two scheduled intervals during the day: once in the morning at 7:00 A.M. and once at midday at 12:00 P.M. The morning copy allows you to save the work from the previous day and is meant to occur before users come in to work in the morning. The midday copy allows you to save work up to that point in the day and is meant to occur when users are taking a break for lunch. In this way, a user would lose at most, a half day's work and the resource impact caused by creating shadow copies is minimized.

When you configure the shadow copy schedule for your organization, you should take these same issues into consideration. Start by determining the best times of the day to create shadow copies. Ideally, this is when the server's resources are being used the least. Then determine how much potential data loss is acceptable, given the resources, the type of data stored, and the available disk space.

Tip

Plan shadow copies around backups

When planning the run schedule for shadow copies be sure to take into account the backup schedule for the related volumes. If you schedule shadow copies during backup, the shadow copy service writers will experience time out errors and any shadow copies that should have been created at that time will be lost. If you suspect a scheduling conflict, you can use the VSSADMIN LIST WRITERS command to check the last error status of the shadow copy writers.

You can change the default shadow copy times, add new scheduled run times, and schedule recurring tasks that create copies at specific time intervals during the day. However, it is recommended that you avoid creating shadow copies more frequently than once per hour. When configuring run schedules, keep in mind how much work is saved and how long users will have to retrieve versions of files. If you save changes 2 times a day during weekdays, the maximum of 64 shadow copies means that users have about 32 working days during which they could retrieve the oldest version of a file before it is automatically deleted.

After you configure shadow copying, you must install a client on computers throughout the organization. Two clients are available: the Previous Versions Client and the Shadow Copy Client. The installation of these clients is discussed in the section entitled "Using Shadow Copies on Clients" later in this chapter.

With either client, users can access the Previous Versions tab by right-clicking a shared file or folder, selecting Properties, and choosing Previous Versions. Users will then be able to view a version of a file, save a version of a file to a new location, or restore a previous version of a file. The clients can be distributed through Group Policy or Microsoft Systems Management Server (SMS).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset