This has bothered me over the years and I'm dealing with it again now. I've never quite understood the full black magic that is Shadow Copies/VSS. I get it to the extent of what it does and how to initially set it up and set the schedules on the volumes. I also understand its role in backups.
Scenario
To simplify it, I'll stick with a single volume in my environment. I have the following schedules enabled:
1 - M-F 7am starting on 4/14/13
2 - M-F 12pm starting on 4/14/13
3 - 1st day of the month at 9am starting on 6/11/13
The Use limit
for that volume's shadow copies is 25,599MB (25GB)
.
The volume is 250GB
and has 44GB
of free space.
Going backwards from today I show all the correct times/schedules for shadow copies back until 7/29/13. It doesn't go back further, and there isn't a 7/1/13 monthly copy.
I'm pretty sure I remember reading there is a 64 copy limit before the oldest gets overwritten. This makes sense since I count exactly 64 copies currently in the list.
My Questions
- Is there a way to change this 64 copy limitation?
- Can I prevent monthly copies from being overwritten somehow and let it overwrite just the "dailies" instead?
- Does MS or others provide a way to manage shadow copies in a more granular fashion than the basic scheduling on the volume, etc. that I've already done above? ie. the ability to tell it "keep only the previous 4 weeks of this schedule" or similar.
My goal is to get to a point where i can have 12 "monthlies" and the previous month twice "dailies" (for a total roughly of 72 copies it would seem).
I have "real backups" using Commvault Simpana but it's so much easier to deal with a restore from shadow copies for simple file shares.
Yes you can change the limit up to 512 shadow copies per volume, by using the
MaxShadowCopies
registry key. You will probably also need to adjust the amount of storage space VSS is allowed to use withvssadmin.exe Resize ShadowStorage
. (You may configure Shadow Copies for a volume to back up to a separate volume, such as one with more space. Again, vssadmin.exe is your friend here.)No.
No.
VSS on its own works well, but it's pretty basic. Most good enterprise backup solutions make use of VSS on Windows machines. But to get those really granular and fine-tuned retention policies, you'll need to use a more thorough backup solution.
As you already have noticed, the automatic VSS removal mechanism would always remove the oldest shadow copy/copies and does not allow you to configure a more sophisticated retention scheme. It also seems impossible to set a "no delete" mark on a particular shadow copy set.
To overcome this, you might disable (or at least increase) the space limit for shadow copies and purge them in a periodical script according to your needs by either invoking the
diskshadow
executable or employing the win32_shadowcopy WMI class. It would be most conveniently called before a new VSS copy is created through the task scheduler of your system.