網頁

2012年4月29日 星期日

Recover data from Volume Shadow Copy mechanism (part 1 of 2)

Volume Shadow Copy is a Microsoft mechanism that can automatically backup the volume content based on pre-determined interval. If need to restore individual files,you can select any of the previous 64 versions of the shadowed volume to restore it and get the deleted, damaged or overwritten files.

At first, we need to configure and enable Shadow Copy from command line or computer management as follows:
Adds a shadow copy storage association for a specified volumeTo enable Shadow Copy for a volume, we can do the following syntax from the command-line RunAs administrator:
”vssadmin add shadowstorage /for=volume /on=storevolume /maxsize=xxxMB”
ScreenHunter_19 Apr. 25 17.18In the Shadow Copies tab of property of Volume, click  “Volume C:\” and “Settings” button
ScreenHunter_21 Apr. 25 18.45You will see the related value mapping to the above command-line
ScreenHunter_22 Apr. 25 18.48Run “vssadmin list shadows” & “vssadmin list shadowstorage” again to realize the information about shadow copy
ScreenHunter_23 Apr. 25 19.07
Creates a new shadow copy of a specified volume

To create Shadow Copy for a volume, we can do the following syntax from the command-line RunAs administrator:
”vssadmin create shadow /for=volume”
ScreenHunter_24 Apr. 25 19.22In the Shadow Copies tab of property of Volume, you will see a times tag on Shadow copies of selected volume.
ScreenHunter_25 Apr. 25 20.15The above command is as click “Create Now” button so that it show a new time tag record now.
ScreenHunter_26 Apr. 25 20.23Run “vssadmin list shadows” & “vssadmin list shadowstorage” again to know there is two contents of shadow copy and its storage space is occupied now.
ScreenHunter_27 Apr. 25 20.29
One day, I go wrong to delete a database “Northwind” & overwrite file content from “1” to “shadow copy” in C:\SQLFILE\TEST1.sql
ScreenHunter_01 Apr. 26 11.20ScreenHunter_02 Apr. 26 11.24
How to recover these data now?

(1).Create a symbolic link to a shadow copy volume<Method 1>
Run “vssadmin list shadows /for=C:” and base on create time to find which shadow copy volume will be restored. In the output screen, we will use this shadow copy volume “\\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy2” as restore base.
ScreenHunter_04 Apr. 26 12.03To create a directory symbolic link, we can do the following syntax from the command-line RunAs administrator: ”mklink /d NewLinkName ShadowCopyVolume\
ScreenHunter_06 Apr. 26 14.04Now we can explore the content of shadow copy.
ScreenHunter_07 Apr. 26 14.06
<Method 2>
Right-click the drive letter on which the shadow copy is created next to click “Properties” in menu.
ScreenHunter_08 Apr. 26 14.13In Disk Properties, click “Previous Versions” –> select one shadow copies based on data modified –> click “Open” button
ScreenHunter_09 Apr. 26 14.15Now we can explore the content of shadow copy.
ScreenHunter_10 Apr. 26 14.22When we choose either method, the loss file will be found and recovered now!

沒有留言:

張貼留言

Since 2010 Design by Davidwa
©Copyright Davidwa Inc. All rights reserved.