Windows 7 / Getting Started

Shadow Copies

Windows Server 2008 includes a powerful feature for shared folder support: shadow copies. This feature automatically takes a snapshot of the files located in a shared folder at regular intervals. The shadow copy feature is designed to assist in the process of recovering previous versions of files without having to resort to backups. The shadow copy feature is very much like an "undelete" feature. It is useful for users who often require a return to either a previous version of a file or who accidentally destroy files they still need to use.

WS08 uses a default schedule for creating shadow copies: 7:00 a.m. and noon. If you find that this schedule does not meet your requirements, you can change it. For example, you might prefer to create shadow copies at noon and 5:30 p.m. if your staff tends to start early in the morning. But since you can create up to 512 shadow copies on a server, you can set just about any schedule you need. You should use a separate volume for shadow copies and set the maximum size for the shadow copies on this volume. Using a separate volume will increase the performance of the file server, since it will not need to perform the shadow copy write operation on the same disk as the file shares. Setting a maximum size will ensure that older shadow copies are overwritten when needed and that the disk used to store them will not fill up inadvertently.

Shadow copies are accessed through the Previous Versions tab of a file object's properties. A file object can be a file itself or a folder that stores the file. Users and administrators have access to previous versions so long as they have NTFS access rights to a file or folder.

Each shadow copy takes up 100 megabytes (MB). That's because a shadow copy is not a complete backup of a disk, but rather a copy of the file pointers that identify where a file is located on a disk. When a file is to be overwritten, WS08 uses a write forward process that writes the new version of the file in an empty area of the disk. Shadow copies can be retained as long as the disk has enough free space. Obviously, older versions of a file are eventually overwritten as the disk fills up. To size your shadow copy disk, you can calculate the number of shadow copies you hope to retain based on the schedule you set. For example, if you set a schedule to capture two copies a day for 30 days, you'll need 2 times 30 times 100 MB, or a total of 6 gigabytes (GB). You can usually get away with a 10-GB shadow copy disk.

Shadow copies do not replace backups. In addition, shadow copies are not backed up, so you cannot count on previous versions of a shadow copy. Finally, the shadow copy process is in fact a scheduled task. If you intend to delete the volume on which a shadow copy is performed, begin by deleting the shadow copy scheduled task. Otherwise, the shadow copy process will generate errors in the Event Log.

Shadow Copies for Resource Pools

Shadow copies can provide a first line of defense for host servers since they can let you quickly restore a failed virtual hard drive. Of course, you need to make sure your storage infrastructure works with the shadow copy service or that it doesn't include its own version of a shadow copy or snapshot feature. But if you want to set up shadow copies on the host servers, then you need to add a third partition or disk volume, as indicated earlier in the discussion on host server disk structures. And since host servers run Server Core only, you will need to configure shadow copies through the command line. Use the following commands to do so:

vssadmin add shadowstorage /for=D: /on=E: /maxsize=6000mb
vssadmin create shadow /for=D:
vssadmin list shadowstorage
vssadmin list shadows

The first command sets up the shadow copies according to the default schedule. The second creates the first shadow copy. The next two list the associations and then available shadow copies.

Shadow copy schedules are scheduled tasks. To control the scheduled task and modify its schedule, rely on the SCHTASKS.EXE command. Your shadow copies are ready.

[Previous] [Contents] [Next]