TrueNAS SCALETrueNAS SCALE Documentation Archive
This content follows the TrueNAS SCALE 22.12 (Bluefin) releases. Archival documentation is provided for reference only and not actively maintained.
Use the Product and Version selectors above to view content specific to different TrueNAS software or major version.

Managing Snapshots

Viewing the List of Snapshots

File Explorer limits the number of snapshots Windows presents to users. If TrueNAS responds with more than the File Explorer limit, File Explorer shows no available snapshots. TrueNAS displays a dialog stating the dataset snapshot count has more snapshots than recommended, and states performance or functionality might degrade.

There are two ways to view the list of snapshots:

  • Go to Datasets > Data Protection widget > Manage Snapshots link to open the Snapshots screen,

DatasetDataProtectManageSnapshotsSCALE

  • Go to Data Protection, locate the Periodic Snapshot Tasks widget, then click the Snapshots button in the lower right hand corner of the widget.

DataProtectSnapshotTasksSCALE

The Snapshots screen displays a list of snapshots on the system. Use the search bar at top to narrow the selection, clear the search bar to list all snapshots.

SnapshotsListingSCALE1

Click expand_more to view snapshot options.

SnapshotsListingExpandedSCALE1

Cloning to New Dataset

The Clone to New Dataset button creates a clone of the snapshot. The clone appears directly beneath the parent dataset in the dataset tree table on the Datasets screen. Clicking the Clone to New Dataset button opens a clone confirmation dialog.

StorageSnapshotCloneNewDatasetSCALE

Click Clone to confirm.

StorageSnapshotCloneNewDatasetCreatedSCALE

The Go to Datasets button opens the Datasets screen.

StorageSnapshotCloneNewDatasetListedContentSCALE

Promoting a Dataset

Clicking on the clone name in the dataset listing populates the Dataset Details widget. The Promote button is visible.

StorageSnapshotCloneNewDatasetPromoteSCALE

After clicking the Promote button, the dataset clone is promoted and this button no longer appears.

StorageSnapshotCloneNewDatasetAfterPromoteSCALE

Promote now displays on the Dataset Details widget when you select the demoted parent dataset.

DatasetDetailsParentDataNotPromotedSCALE

See zfs-promote.8 for more information.

Deleting a Snapshot

The Delete option destroys the snapshot. You must delete child clones before you can delete their parent snapshot. While creating a snapshot is instantaneous, deleting one is I/O intensive and can take a long time, especially when deduplication is enabled.

ZFS has to review all allocated blocks before deletion to see if another process is using that block. If not used, the ZFS can free that block.

SnapshotDeleteNonPromotedSCALE

Click the Delete button. A confirmation dialog displays. Select Confirm to activate the Delete button.

Deleting with Batch Operations

To delete multiple snapshots, select the left column box for each snapshot to include. Click the Delete button that displays.

To search through the snapshots list by name, type a matching criteria into the Filter Snapshots text field. The list now displays only the snapshot names that match the filter text.

SnapshotDeleteBatchSCALE

SnapshotDeleteBatchConfirmSCALE

Confirm activates the Delete button. If the snapshot has the Hold options selected, an error displays to prevent you from deleting that snapshot.

Using Revert

The Rollback option reverts the dataset back to the point in time saved by the snapshot.

Rollback is a dangerous operation that causes any configured replication tasks to fail.
Replications use the existing snapshot when doing an incremental backup, and rolling back can put the snapshots out-of-order. To restore the data within a snapshot:

  1. Clone the desired snapshot.
  2. Share the clone with the share type or service running on the TrueNAS system.
  3. Allow users to recover their needed data.
  4. Delete the clone from Datasets.

This approach does not destroy any on-disk data or impact replication.

TrueNAS asks for confirmation before rolling back to the chosen snapshot state. Select the radio button for how you want the rollback to operate.

DatasetRollbackSnapshotWarnSCALE

Click Confirm to activate the Rollback button.

Browsing a Snapshot Collection

Browsing a snapshot collection is an advanced capability that requires ZFS and command-line experience.

All dataset snapshots are accessible as an ordinary hierarchical file system, accessed from a hidden .zfs located at the root of every dataset.

A snapshot and any files it contains are not accessible or searchable if the snapshot mount path is longer than 88 characters. The data within the snapshot is safe but to make the snapshot accessible again shorten the mount path.

A user with permission to access the hidden file can view and explore all snapshots for a dataset from the Shell or the Shares screen using services like SMB, NFS, and SFTP.

In summary, the main required changes to settings are:

  • In dataset properties, change the ZFS properties to enable snapshot visibility.
  • In the Samba auxiliary settings, change the veto files command to not hide the .zfs, and add the setting zfsacl:expose_snapdir=true.

The effect is that any user who can access the dataset contents can view the list of snapshots by going to the dataset .zfs directory. Users can browse and search any files they have permission to access throughout the entire dataset snapshot collection.

When creating a snapshot, permissions or ACLs set on files within that snapshot might limit access to the files.

Snapshots are read-only, so users do not have permission to modify a snapshot or its files, even if they had write permissions when creating the snapshot.

The zfs diff ZFS command, which can run in the Shell, lists all changed files between any two snapshot versions within a dataset, or between any snapshot and the current data.

Related Content