Table of ContentsView in Frames

Restoring a Snapshot copy of a LUN in a volume

You can use SnapRestore to restore a Snapshot copy of a LUN and the volume that contains it to its state when the Snapshot copy was taken. You can use SnapRestore to restore an entire volume or a single LUN.

Before you begin

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.

About this task

When restoring a volume using SnapRestore, you only need as much available space as the size of the volume you are restoring. For example, if you are restoring a 10 GB volume, then you only need 10 GB of available space to perform the SnapRestore.

Attention: 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.

Steps

  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

    snap restore -s payroll_lun_backup.2 -t vol /vol/payroll_lun

    storage_system> 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

    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.

    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. Decide if you want to continue with the reversion.
    • If you want to continue the reversion, press y. The storage system reverts the volume from the selected Snapshot copy.
    • If you do not want to continue the reversion, press n or Ctrl-C. 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

After you finish

After you use SnapRestore to update a LUN from a Snapshot copy, you also need to restart any applications you closed down and remount the volume from the host side.