3.7. Using Shadow CopiesShadow copies are a new technology within Windows products that enables a server to take snapshots of documents on a disk to record their states at certain points in time. If a user accidentally deletes or otherwise overwrites a file, he or she can open a version the server saved earlier in time, thereby eliminating the need to either recreate his or her work or contact the help desk to get them to restore the file from the most recent backup. When shadow copies are enabled on a disk, clients connecting to a share on that disk will be able to view and access previous point-in-time copies of either individual files or entire directories. Further benefits lurk beneath the surface of this feature, however. The service behind shadow copies, called the Volume Shadow Copy Service (VSS) , is actually responsible for a newly developed application programming interface (API) that allows server-based applications such as Exchange, SQL, and backup programs to take advantage of the benefits of shadow copies. Perhaps the most famous example is a backup that skips open files, either because they are currently open by a user or because they are locked by another process. In the past, this resulted in incomplete backups, either because the backup process halted in midstream because of this unrecoverable error, or because the process skipped the open file. If the open file is, say, your Exchange email database, that's not necessarily a good thing. But now, with volume shadow copies, the backup application can simply use an API to take a snapshot of any open files and back up that snapshot. Now you have an instant backup of a database at any point in time, with no interruption in availability to the user. This is a very nice feature. You definitely can take advantage of shadow copies in the user realm as well. Part of the volume shadow copy service is a piece of client software that can be pushed out to any computer in your domain through Group Policy. (This software is located on the Windows Server 2003 CD and can also be downloaded from Microsoft's web site.) Once the user has this client, Windows adds a tab to the Properties sheet for any document. This is shown in Figure 3-25. Figure 3-25. The Previous Versions add-on for the Volume Shadow Copy ServiceTo restore a previous version of a file, all the user has to do is select the appropriate version and either copy it to a different location using the Copy button, or restore it to its location at the time the snapshot was taken by using the Restore button. (This will overwrite the newer version because it's assumed that when a user wants to restore a previous version, he doesn't want the current version.) Note that viewing an executable file will run that file. To reduce user confusion, when a user accesses the Previous Versions link in the Explorer view (in Windows XP, the only client version of Windows that currently supports Previous Versions) of a particular share, he or she is presented only with a list of unique copiesthat is to say, a list of versions that differ from each other, a condition that indicates the file or folder changed. In addition, shadow copies are read-only, in that users can copy, drag-and-drop, and perform any other function on them as usual except for overwriting or deleting them. Some restrictions on shadow copies from an administrator standpoint are noted as follows:
3.7.1. Enabling Shadow CopiesTo enable shadow copies on the server, follow these steps:
When you enable shadow copies on a volume, the system creates a folder on that volume called System Volume Information, where the actual snapshots and log files of the operations are stored. By default, this folder is allocated 10% of the volume's total disk space, much like the Recycle Bin default in Windows. When you first enable shadow copies, a current snapshot of the volume is taken so that Windows can store a picture of the "state" of files on the disk. This state data is used to determine if files have changed from the time at which the state information was recorded. For example, an administrative assistant is performing rudimentary formatting functions on an Excel spreadsheet and she leaves for the day. Overnight, the Windows Server 2003 machine on which the file share resides is configured to take a snapshot of all filesfor this example, I will use 5:30 a.m. When this snapshot is taken, the state information for this Excel spreadsheet is copied into the System Volume Information folder. Now, when the administrative assistant arrives at work and begins to work on the spreadsheet, she is using the same version as the one she saved the previous night; remember that this is also the one on which the snapshot is based. When she finishes with some formatting, she saves the spreadsheet before she attends the Tuesday morning meeting of all employees. The VSS service detects that the Excel file is one which already has state data, and it realizes that it has changed, so it immediately makes available the 5:30 a.m. version of the filethe previous versionunder the appropriate tab in the Properties sheet for the Excel file. So now, when the administrative assistant comes back and realizes that she unintentionally removed an entire page from the workbook while she was formatting the file, she can retrieve the version from the previous night, and likely save her job. You should, however, note three very important items concerning how shadow copies might and (most notably) might not rescue you or your users from catastrophe:
3.7.2. Altering the Shadow Copy ScheduleShadow copies are scheduled by default to be made at 7:00 a.m. and at noon on weekdays. Server performance can be adversely affected if you schedule shadow copies to be taken more frequently than once every 60 minutes.
Additionally, as soon as 64 shadow copies per volume are stored, the oldest will be deleted and become irretrievable as new shadow copies are made to replace them. To change the shadow copy schedule, follow these steps:
|