Table of ContentsView in Frames

Reverting a volume to a selected Snapshot copy

In certain situations, you need to revert a volume to a selected Snapshot copy using SnapRestore. You should notify the users of the volume before you revert that volume.

Before you begin

Ensure that you notify the users of the volume that you are going to revert a volume, and that the current data in the volume will be replaced by the selected Snapshot copy.
Note: NFS users should unmount the files and directories in the volume before the reversion. If they do not unmount the files and directories, they might get a “stale file handle” error message after the volume reversion.

About this task

When you revert a volume using SnapRestore, the maxdirsize option for the volume is also reverted as per the Snapshot copy used for restoration. You can view the value of the maxdirsize option for a volume by using the vol options command.

Steps

  1. As required, choose one of the actions from the following table:
    If... Then...
    You know the name of the Snapshot copy for each volume you want to revert Go to Step 5.
    You want to choose a Snapshot copy from the list of Snapshot copies available for reversion Go to Step 2.
  2. Enter the following command:snap restore [-f] -t vol vol_name
    -t vol specifies the volume name to revert.

    vol_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.

    Use the -f option to avoid warning messages and prompts to confirm your decision to revert the volume. For more information, see the na_snap(1) man page.

  3. Press y to confirm that you want to revert the volume.
    Data ONTAP displays a list of Snapshot copies.
  4. Enter the name of the Snapshot copy for reverting the volume, then go to Step 8.
    Data ONTAP displays the name of the volume to be reverted and the name of the Snapshot copy to be used for the reversion.
  5. Enter the following command:snap restore [-f] -t vol -s snapshot_name vol_name
    -t vol specifies the volume name to revert.

    -s snapshot_name specifies the name of the Snapshot copy from which to revert the data. You can enter only one Snapshot copy name.

  6. Press y to confirm that you want to revert the volume.
    Data ONTAP displays the name of the volume 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.
    Note: To cancel volume reversion, press Ctrl-C at any time before you enter y in Step 8.
  7. As required, choose one of the actions from the following table:
    If... Then...
    You want to continue with the reversion Press y.

    Result: The system reverts the volume from the selected Snapshot copy. If you are reverting the root volume, the system reboots.

    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 prompt.

Example

system> snap restore -t vol -s nightly.0 /vol/vol1
system> WARNING! This will restore a volume from a snapshot into the active file system. If the volume already exists in the active file system, 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, snapshot nightly.0
Proceed with restore? y

Result: Data ONTAP restores the volume called vol1 at /vol/vol1.

After a volume is reverted with SnapRestore, all user-visible information (data and attributes) for that volume in the active file system is identical to that contained in the Snapshot copy.