Managing Snapshots

The File Storage service supports snapshots for data protection of your file system. Snapshots are a consistent, point-in-time view of your file systems. Snapshots are copy-on-write, and scoped to the entire file system. The File Storage service encrypts all file system and snapshot data at rest. You can take as many snapshots as you need.

Data usage is metered against differentiated snapshot data. If nothing has changed within the file system since the last snapshot was taken, the new snapshot does not consume more storage. For more information, see File System Usage and Metering.

Snapshots are accessible under the root directory of the file system at .snapshot/name. For data protection, you can use a tool that supports NFSv3 to copy your data to a different availability domain, region, file system, object storage, or remote location.

For best performance, we recommend that you use the parallel tar (partar) and parallel copy (parcp) tools provided in the File Storage Parallel File Toolkit for this purpose. These tools work best with parallel workloads and requests. The Parallel File Toolkit is available for Oracle Linux, Red Hat Enterprise Linux, and CentOS. You can use rsync or regular tar for other operating system types. See Installing the Parallel File Tools for more information.

Tip

Watch a video about protecting data with snapshots in File Storage.

Required IAM Service Policy

To use Oracle Cloud Infrastructure, you must be granted security access in a policy  by an administrator. This access is required whether you're using the Console or the REST API with an SDK, CLI, or other tool. If you get a message that you don’t have permission or are unauthorized, verify with your administrator what type of access you have and which compartment  you should work in.

For administrators: The policy in Let users create, manage, and delete file systems allows users to create and delete snapshots.

If you're new to policies, see Getting Started with Policies and Common Policies.

Details About Your Snapshot

The Details page provides the following information about your snapshot:

SNAPSHOT OCID
Every Oracle Cloud Infrastructure resource has an Oracle-assigned unique ID called an Oracle Cloud Identifier (OCID). You need your snapshot's OCID to use the Command Line Interface (CLI) or the API. You also need the OCID when contacting support. See Resource Identifiers.
CREATED
The date and time that the snapshot was created.

Tagging Resources

You can apply tags to your resources to help you organize them according to your business needs. You can apply tags at the time you create a resource, or you can update the resource later with the desired tags. For general information about applying tags, see Resource Tags.

Using the Console

To create a snapshot
  1. Open the navigation menu. Under Core Infrastructure, click File Storage and then click File Systems.
  2. In the List Scope section, select a compartment.
  3. In the File Systems list, locate the file system you want to take a snapshot of. Click the Actions icon (three dots), and then click View File System Details.
  4. In Resources, click Snapshots.
  5. Click Create Snapshot.
  6. Fill out the required information:

    • Name: Enter a name for the snapshot. It must be unique among all other snapshots for this file system. The name can't be changed. Avoid entering confidential information.
  7. Click Create Snapshot. The snapshot is accessible under the root directory of the file system at .snapshot/name.
To view details of a snapshot
  1. Open the navigation menu. Under Core Infrastructure, click File Storage and then click File Systems.
  2. In the List Scope section, select a compartment.

  3. In the File Systems list, locate the file system you took the snapshot of. Click the Actions icon (three dots), and then click View File System Details.

  4. In Resources, click Snapshots.
  5. In the Snapshots list, locate the snapshot you're interested in. Click the Actions icon (three dots), and then click View Snapshot Details.
To create a snapshot from a Unix-style instance

You can create a snapshot from an instance that you've mounted the file system to. Snapshots are created under the root folder of your file system, in a hidden directory named .snapshot.

  1. Connect to your instance and open a command window.
  2. Navigate to your file system's hiden .snapshot directory. Type the following, replacing yourmountpoint with the name of the directory where you mounted the file system.

    cd /mnt/yourmountpoint/.snapshot
  3. Use the mkdir command to create a directory in the hidden .snapshot directory. The directory you create is the snapshot. Give the snapshot a name that will help you identify it. Avoid using confidential information in the snapshot name. For example:

    mkdir snapshot-Jan1
  4. Use the ls command to verify that your snapshot has been created in the .snapshot directory.

    ls
To restore a snapshot

Snapshots are created under the root folder of your file system, in a hidden directory named .snapshot.

You can restore a file within the snapshot, or an entire snapshot using the cp command. Use the -r option when restoring a snapshot that contains subdirectories.

For example:

cp -r .snapshot/snapshot_name/* destination_directory_name

Optionally, you can use rsync, tar, or another tool that supports NFSv3 to copy your data to another remote location. For optimal performance, use the Parallel File Tools.

For example: 

parcp .snapshot/snapshot_name/* destination_directory_name
To manage tags for a snapshot
  1. Open the navigation menu. Under Core Infrastructure, click File Storage and then click File Systems.
  2. In the List Scope section, select a compartment.

  3. In the File Systems list, locate the file system you took the snapshot of. Click the Actions icon (three dots), and then click View File System Details.

  4. In Resources, click Snapshots.
  5. In the Snapshots list, locate the snapshot you're interested in. Click the Actions icon (three dots), and then click View Snapshot Details.
  6. Click the Tags tab to view or edit the existing tags. Or click Apply tag(s) to add new ones.

For more information, see Resource Tags.

To delete a snapshot
  1. Open the navigation menu. Under Core Infrastructure, click File Storage and then click File Systems.
  2. In the List Scope section, select a compartment.
  3. Find the file system with the snapshot you want to delete.
  4. Click the Actions icon (three dots), and then click View File System Details.
  5. In Resources, click Snapshots.
  6. Find the snapshot you want to delete.
  7. Click Delete.

Using the Command Line Interface (CLI)

For information about using the CLI, see Command Line Interface (CLI).

To create a snapshot

You can create a snapshot of a file system. A snapshot is a point-in-time view of the file system. The snapshot is accessible at ./shapshot/name.

Open a command prompt and run oci fs snapshot create to create a snapshot of a file system.

For example:

oci fs snapshot create --file-system-id <file_system_OCID> --name "<January1>"

Avoid entering confidential information.

To list snapshots

Open a command prompt and run oci fs snapshot create to list all snapshots associated with a specific file system.

For example:

oci fs snapshot list --file-system-id <file_system_OCID>
To get a specific snapshot

Open a command prompt and run oci fs snapshot get to retrieve information about a specific snapshot.

For example:

oci fs snapshot get --snapshot-id <snapshot_OCID>
To delete a snapshot

Open a command prompt and run oci fs snapshot delete to delete a snapshot.

For example:

oci fs snapshot delete --snapshot-id <snapshot_OCID>