Using SnapRestore
What SnapRestore does
SnapRestore enables you use a snapshot to revert a an entity such as a volume, a file, or a LUN quickly to the state it was in when a particular snapshot was taken. In most cases, reverting an entity is much faster than restoring files from tape or copying files from a snapshot to the active file system.
After you select a snapshot for reversion, Data ONTAP reverts the specified entity to the data and timestamps that it contained when the selected snapshot was taken. Data that was written after the selected snapshot was taken is lost. If the entity you select for reversion is a root volume, Data ONTAP reboots the system.
Using SnapRestore
You can use SnapRestore with snapshots of LUNs. It is possible to use SnapRestore to restore a complete WAFL volume or a single LUN.
Caution
Using SnapRestore on a LUN, or on volume that contains LUNs, without stopping all host access to those LUNs, can cause data corruption and system errors.
You need to be aware of the following requirements:
- You must always unmount the LUN before you run the snaprestore command on a volume containing the LUN or a single file SnapRestore of the LUN. For a single file SnapRestore, you must also take the LUN offline.
- Check available space; SnapRestore does not revert the snapshot if sufficient space is unavailable.
- Make sure that the LUN is not the whole root volume (or it reboots the filer).
Restoring a snapshot of a LUN
To use SnapRestore to restore a snapshot of a LUN, complete the following steps.
Step
|
Action
|
|
1 |
From the host, stop all host access to the LUN.
|
|
2 |
From the host, if the LUN contains a host file system mounted on a host, unmount the LUN on that host.
|
|
3 |
From the filer, unmap the LUN by entering the following command:
lun unmap lun-path initiator-group
|
|
4 |
Enter the following command:
snap restore [-f] [-t vol] volume_name
[-s snapshot_name]
-f suppresses the warning message and the prompt for confirmation. This option is useful for scripts.
-t vol volume_name specifies the volume name to revert.
volume_name is the name of the volume to be reverted. Enter the name only, not the complete path. You can enter only one volume name.
-s snapshot_name specifies the name of the snapshot from which to revert the data. You can enter only one snapshot name.
Example
filer> snap restore -s payroll_lun_backup.2 -t
/vol/payroll_lun
filer> WARNING! This will restore a volume from a
snapshot into the active filesystem. If the volume
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/payroll_lun, snapshot
payroll_lun_backup.2
Proceed with restore? y
Result
If you did not use the -f option, Data ONTAP displays a warning message and prompts you to confirm your decision to revert the volume.
|
|
5 |
Press y to confirm that you want to revert the volume.
Result
Data ONTAP displays the name of the volume and the name of the snapshot for the reversion.If you did not use the -f option, Data ONTAP prompts you to decide whether to proceed with the reversion.
|
|
6 |
If...
|
Then...
|
You want to continue with the reversion
|
Press y.
Result
The filer reverts the volume from the selected snapshot. If you are reverting the root volume, the filer reboots the system.
|
You do not want to proceed with the reversion
|
Press n or Ctrl-C.
Result
The volume is not reverted and you are returned to a filer prompt.
|
|
7 |
If the old maps aren't the ones you want unmap them (if any old maps exist).
lun unmap lun-path initiator-group
|
|
8 |
Remap the LUN.
lun map lun-path initiator-group
|
|
9 |
From the host, remount the LUN, if it was mounted on a host.
|
|
10 |
From the host, restart access to the LUN.
|
|
11 |
From the filer, bring the restored LUN online by entering the following command:
lun online lun-path
|
Note
After you have used SnapRestore to update a LUN from a snapshot, you also need to restart any database applications you closed down and remount the volume from the host side.
Restoring an online LUN from tape
If you try to restore a LUN from a NetApp NDMP/dump tape and the LUN being restored still exists and is exported or online, the restore fails with the following message:
RESTORE: Inode XXX: file creation failed.
Reverting a file
To revert a single file (rather than a volume), complete the following steps.
Note
You cannot use SnapRestore for single file reversion on files with NT streams or on directories.
Step
|
Action
|
|
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.
Note NFS users who try to access a reverted file without first reopening it might get a "stale file handle" error message after the volume reversion. |
|
2 |
Enter the following command:
snap restore[-f] [-t file] [-s snapshot_name]
[-r restore_as_path] path_and_LUN_name
-f suppresses the warning message and the prompt for confirmation.
-t file specifies that you are entering the name of a file to revert.
-s snapshot_name specifies the name of the snapshot from which to revert the data.
-r restore_as_path restores the file to a location in the volume different from the location in the snapshot. 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_lun_name.
path_and_LUN_name is the complete path to the name of the file (LUN) to be reverted. You can enter only one path name.
A file (LUN) 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 re-create it before restoring the file.
Unless you enter -r and a path name, only the file (LUN) at the end of the path_and_lun_name is reverted.
Result
If you did not use the -f option, Data ONTAP displays a warning message and prompts you to confirm your decision to revert the file.
|
|
3 |
Press y to confirm that you want to revert the file.
Result
Data ONTAP displays the name of the file and the name of the snapshot for the reversion. If you did not use the -f option, Data ONTAP prompts you to decide whether to proceed with the reversion.
|
|
4 |
Press y to continue with the reversion.
Result
Data ONTAP reverts the LUN from the selected snapshot.
|
Example
filer> snap restore -t file -s payroll_backup_friday
/vol/vol1/payroll_luns
filer> 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/payroll_luns, snapshot
payroll_backup_friday
Proceed with restore? y
Result
Data ONTAP restores the LUN called payroll_backup_friday to the existing volume and directory structure /vol/vol1/payroll_luns.
After a LUN is reverted with SnapRestore, all user-visible information (data and file attributes) for that LUN in the active file system is identical to that contained in the snapshot.
Copyright © 1994-2003, Network Appliance, Inc. All rights
reserved.
Part No. 210-00338
File: c5data5.htm
Last updated: 01/17/03 17:40:37