Deleting Full copy Backup from SBS and Server 2008

AID: 7950
  • Status: Published

1510 points

  • ByNick67
  • TypeTutorial
  • Posted on2011-09-29 at 13:14:33
Scenario:  You do full backups to a internal hard drive in either product (SBS or Server 2008).  All goes well for a very long time.  One day, backups begin to fail with a message that the disk is full.  Your disk contains many, many more backups than you need and you'd like to free up some space again.
Without too much manual hassle :)

Solution:
1. In the Server Manager, go to Disk Management, and assign the backup drive a drive letter.  I used letter 'L:'
2. Open an elevated priviledges command window
3. Using the handy pipe out '>' ability of the cmd window, pipe out the results of the vssadmin list versions command
My command window opened to c:\users\adminname and I ran
Vssadmin list versions /for=L: > Desktop\shadows.txt
Note that this command seems to be case sensitive!
*** it seems to have changed since I first posted to***
Vssadmin list shadows /for=L: > Desktop\shadows.txt
4.Rename the output file shadows.txt to shadows.xls and open it with Excel
5.Using Excel's autofilter, delete all rows that don't look like
Shadow Copy ID: {9a03c171-913b-46cf-81f6-79705a6a62d4}
The stuff between the curly brackets (the GUID) will vary in content
6. When you have nothing but rows left with that format do a find and replace operation
Replace Shadow Copy ID: with Delete shadows ID and save the resulting file as a text file
From the end of the file, delete however many rows you wish to save as the file lists them oldest to newest, and we wish to save those most recent entries.  Since this file lists all the shadows, we remove from it the shadows we wish to keep.
I originally had 69 backups.  I deleted thw last 30 rows, so this script will delete the 39 oldest backups and the newest 30 will remain in place.
See the attached file for structure
shadow.txt
  • 2 KB
  • diskshadow script
shadow.txt

7.  Create a cmd file with the following command
diskshadow -s desktop\shadow.txt
***note this too seems to have changed since I first posted to ***
diskshadow /s desktop\shadow.txt
I had my script file on the desktop, and it was named shadow.txt
8. Run the cmd file in an elevated command windows.
9. After the script completes, remove the drive letter from the backup drive

Done.
Congratulations, you've freed up space for more full backups on your disk

Resources
Advice to assign drive letter temporarily
http://forums.techarena.in/small-business-server/1337467.htm

Advice on the correct vssadmin commands
http://blogs.technet.com/b/filecab/archive/2009/06/22/backup-version-and-space-management-in-windows-server-backup.aspx

The piping out of the command window output is long standing going back to DOS.  If that is new to you, look here
http://www.robvanderwoude.com/battech_redirection.php

The method of cleaning up the output is up to you.  I find Excel very handy for doing those sorts of tasks.
Using Autofilter with contains and does not contain, and then deleting rows is fairly straight-forward and quick.

diskshadow scripting syntax
http://technet.microsoft.com/en-us/library/cc772172(WS.10).aspx
    Asked On
    2011-09-29 at 13:14:33ID7950
    Tags

    SBS 2008

    ,

    Server 2008

    ,

    backup

    ,

    Vssadmin

    ,

    full backups

    ,

    full disk

    Topic

    Windows Server 2008

    Views
    825

    Comments

    Add your Comment

    Please Sign up or Log in to comment on this article.

    Join Experts Exchange Today

    Gain Access to all our Tech Resources

    Get personalized answers

    Ask unlimited questions

    Access Proven Solutions

    Search 3.2 million solutions

    Read In-Depth How-To Guides

    1000+ articles, demos, & tips

    Watch Step by Step Tutorials

    Learn direct from top tech pros

    And Much More!

    Your complete tech resource

    See Plans and Pricing

    30-day free trial. Register in 60 seconds.

    Loading Advertisement...

    Top Windows Server 2008 Experts

    1. dariusg

      487,253

      Wizard

      1,568 points yesterday

      Profile
      Rank: Genius
    2. hanccocka

      269,517

      Guru

      2,000 points yesterday

      Profile
      Rank: Genius
    3. kevinhsieh

      266,722

      Guru

      0 points yesterday

      Profile
      Rank: Genius
    4. demazter

      188,767

      Guru

      0 points yesterday

      Profile
      Rank: Genius
    5. mkline71

      181,660

      Guru

      2,250 points yesterday

      Profile
      Rank: Genius
    6. motnahp00

      163,470

      Guru

      6,700 points yesterday

      Profile
      Rank: Sage
    7. leew

      144,180

      Master

      0 points yesterday

      Profile
      Rank: Savant
    8. ve3ofa

      131,857

      Master

      0 points yesterday

      Profile
      Rank: Genius
    9. acbrown2010

      114,392

      Master

      0 points yesterday

      Profile
      Rank: Genius
    10. arnold

      101,348

      Master

      2,000 points yesterday

      Profile
      Rank: Genius
    11. iSiek

      89,671

      Master

      6,100 points yesterday

      Profile
      Rank: Genius
    12. dstewartjr

      84,405

      Master

      2,000 points yesterday

      Profile
      Rank: Genius
    13. Anuroopsundd

      80,040

      Master

      750 points yesterday

      Profile
      Rank: Sage
    14. dvt_localboy

      79,517

      Master

      0 points yesterday

      Profile
      Rank: Sage
    15. alanhardisty

      76,976

      Master

      0 points yesterday

      Profile
      Rank: Genius
    16. newmath

      73,559

      Master

      0 points yesterday

      Profile
      Rank: Master
    17. hhaywood000

      71,824

      Master

      0 points yesterday

      Profile
      Rank: Wizard
    18. Neilsr

      70,519

      Master

      0 points yesterday

      Profile
      Rank: Genius
    19. RobWill

      60,712

      Master

      0 points yesterday

      Profile
      Rank: Savant
    20. Mutawadi

      60,156

      Master

      0 points yesterday

      Profile
      Rank: Guru
    21. dkotte

      56,740

      Master

      0 points yesterday

      Profile
      Rank: Guru
    22. spaperov

      55,822

      Master

      0 points yesterday

      Profile
      Rank: Wizard
    23. radhakrishnan2007

      55,732

      Master

      0 points yesterday

      Profile
      Rank: Wizard
    24. chakko

      53,161

      Master

      0 points yesterday

      Profile
      Rank: Genius
    25. cgaliher

      51,613

      Master

      0 points yesterday

      Profile
      Rank: Genius

    Hall Of Fame