Using snap restore to revert a single file to a selected Snapshot copy is practical when the file is so large that you cannot copy the previous file version from the Snapshot copy to the active file system.
Some notes concerning snap restore file reversion:
To revert a single file (rather than a volume), complete the following steps.
Note
To cancel file reversion, press Ctrl-C at any time before you press y in Step 10.
| 1 |
Notify network users that you are going to revert a file so that they know that the current data in the file will be replaced by that of the selected Snapshot copy. Note |
|
| 2 | ||
|
You know the name of the Snapshot copy for reverting the file you want to revert |
Go to Step 6. | |
|
You want to choose a Snapshot copy from the list of Snapshot copies available for reversion |
Go to Step 3. | |
| 3 |
snap restore -t file -r restore_as_new_path path_and_file_name -t file specifies that you are entering the name of a file to revert. -r restore_as_new_path restores the file to a location different from (but in the same volume as) the location in the Snapshot copy. For example, if you specify /vol/vol0/vol3/myfile as the argument to -r, SnapRestore reverts the file called myfile to the location /vol/vol0/vol3 instead of to the path in vol3 indicated by path_and_file_name. path_and_file_name is the complete path to the name of the file to be reverted. You can enter only one path name. A file can be restored only to the volume where it was originally. The directory structure to which a file is to be restored must be the same as specified in the path. If this directory structure no longer exists, you must recreate it before restoring the file. Note ResultData ONTAP displays a warning message and prompts you to confirm your decision to revert the file. |
|
| 4 |
Press y to confirm that you want to revert the file. Result |
|
| 5 |
Enter the name of the Snapshot copy for reverting the file, then go to Step 8. ResultData ONTAP displays the name of the file to revert and the name of the Snapshot copy to be used for the reversion. |
|
| 6 |
snap restore -t file -s snapshot_name -t file specifies that you are entering the name of a file to revert. -s snapshot_name specifies the name of the Snapshot copy from which to revert the data. -r restore_as_path restores the file to a location different from the location in the Snapshot copy. For example, if you specify /vol/vol0/vol3/myfile as the argument to -r, SnapRestore reverts the file called myfile to the location /vol/vol0/vol3 instead of to the file structure indicated by the path in path_and_file_name. path_and_file_name is the complete path to the name of the file to be reverted. You can enter only one path name. A file can be restored only to the volume where it was originally. The directory structure to which a file is to be restored must be the same as specified in the path. If this directory structure no longer exists, you must recreate it before restoring the file. Unless you enter -r and a path name, only the file at the end of the path_and_file_name is reverted. You can enter only one path name. ResultIf you have not used the -f option, Data ONTAP displays a warning message and prompts you to confirm your decision to revert the file. |
|
| 7 |
Press y to confirm that you want to revert the file. ResultData ONTAP displays the name of the file and the name of the Snapshot copy for the reversion and, if you have not used the -f option, prompts you to decide whether to proceed with the reversion. |
|
| 8 | ||
ResultThe storage system reverts the file from the selected Snapshot copy. | ||
Result | ||
system> snap restore -t file /vol/vol1/users/jim/myfile
-s nightly.0
system> WARNING! This will restore a file from a snapshot into the active filesystem. If the file already exists in the active filesystem, it will be overwritten with the contents from the snapshot.
Are you sure you want to do this? y
You have selected file /vol/vol1/users/jim/myfile, snapshot nightly.0
Proceed with restore? y
Data ONTAP restores the file called myfile to the existing volume and directory structure /vol/vol1/users/jim.
system> snap restore -t file -s nightly.0
-r /vol/vol2/archive/eng/myfile /vol/vol2/users/jim/myfile
system> WARNING! This will restore a file from a snapshot into the active filesystem. If the file already exists in the active filesystem, it will be overwritten with the contents from the snapshot.
Are you sure you want to do this? y
You have selected file /vol/vol1/users/jim/myfile, snapshot nightly.0
Proceed with restore? y
Data ONTAP restores the file called myfile to a new location at /vol/vol2/archive/eng.
After a file has been reverted with SnapRestore, all user-visible information (data and file attributes) for that file in the active file system is identical to that contained in the Snapshot copy.
Copyright © 1994-2005, Network Appliance, Inc. All rights
reserved.
Part No. 210-01081_B0
File: snapres6.htm
Last updated: 01-Dec-2005 16:36:02