Using SnapRestore
What SnapRestore does
SnapRestore uses a Snapshot copy to revert an entire volume or a LUN to its state when the Snapshot copy was taken. You can use SnapRestore to restore an entire volume, or you can perform a single file SnapRestore on a LUN.
Requirements for using SnapRestore
Before using SnapRestore, you must perform the following tasks:
- Always unmount the LUN before you run the snap restore command on a volume containing the LUN or before you run 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 copy if sufficient space is unavailable.
Caution
When a single LUN is restored, it must be taken offline or be unmapped prior to recovery. Using SnapRestore on a LUN, or on a volume that contains LUNs, without stopping all host access to those LUNs, can cause data corruption and system errors.
Restoring a Snapshot copy of a LUN
To use SnapRestore to restore a Snapshot copy 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 storage system, 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 restore.
volume_name is the name of the volume to be restored. Enter the name only, not the complete path. You can enter only one volume name.
-s snapshot_name specifies the name of the Snapshot copy from which to restore the data. You can enter only one Snapshot copy 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 restore the volume.
|
|
5
|
Press y to confirm that you want to restore the volume.
Result
Data ONTAP displays the name of the volume and the name of the Snapshot copy 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 storage system reverts the volume from the selected Snapshot copy.
|
|
You do not want to proceed with the reversion
|
Press n or press Ctrl-C.
Result
The volume is not reverted and you are returned to a storage system prompt.
|
|
7
|
Enter the following command to unmap the existing old maps that you do not want to keep.
lun unmap lun_path initiator-group
|
|
8
|
Remap the LUN by entering the following command:
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 storage system, bring the restored LUN online by entering the following command:
lun online lun_path
|
Note
After you use SnapRestore to update a LUN from a Snapshot copy, 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 an 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.
Restore a single LUN
To restore a single LUN (rather than a volume), complete the following steps.
Note
You cannot use SnapRestore to restore LUNs with NT streams or on directories.
Step
|
Action
|
|
1
|
Notify network users that you are going to restore a LUN so that they know that the current data in the LUN will be replaced by that of the selected Snapshot copy.
|
|
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 copy from which to restore the data.
-r restore_as_path restores the file to a location in the volume different from the location in the Snapshot copy. For example, if you specify /vol/vol0/vol3/mylun as the argument to -r, SnapRestore restores the file called mylun to the location /vol/vol0/vol3 instead of to the path structure indicated by the path in path_and_lun_name.
path_and_LUN_name is the complete path to the name of the LUN to be restored. You can enter only one path name.
A LUN can be restored only to the volume where it was originally. The directory structure to which a LUN 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 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 restore the LUN.
|
|
3
|
Press y to confirm that you want to restore the file.
Result
Data ONTAP displays the name of the LUN and the name of the Snapshot copy for the restore operation. If you did not use the -f option, Data ONTAP prompts you to decide whether to proceed with the restore operation.
|
|
4
|
Press y to continue with the restore operation.
Result
Data ONTAP restores the LUN from the selected Snapshot copy.
|
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 restored 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 copy.
Copyright © 1994-2005, Network Appliance, Inc. All rights
reserved.
Part No. 210-01094_B0
File: c9data-6.htm
Last updated: 08-Dec-2005 13:25:35