Accessing ZFS snapshots over NFS

From Open-E Wiki
Jump to navigation Jump to search

A ZFS dataset keeps every one of its snapshots available as a read-only, browsable directory under a hidden .zfs/snapshot path at the root of the dataset. Instead of cloning a snapshot or rolling the dataset back, you can share this special directory over NFS so clients can browse and copy files directly out of any snapshot on their own.

Note: this feature is available in Open-E JovianDSS starting with software version up33. It is not available in earlier versions.

How it works

When a share's Path is set to exactly .zfs/snapshot, the storage server automatically:

  • Exports the share as read-only, regardless of any other read/write setting.
  • Enables crossmnt, so NFS clients can descend from the shared directory into each individual snapshot (every snapshot is its own filesystem).

You do not need to configure either of these yourself — they are applied automatically whenever a share's path is .zfs/snapshot. Any other path under .zfs (for example, a specific snapshot name) is rejected and cannot be shared directly; browse to the individual snapshot from the client side after mounting instead.

Creating the share

  1. Go to Storage Management → open the pool → Shares → expand the dataset whose snapshots you want to access, and click Add share.
  2. In the Share wizard, on the Share properties step, enter a share Name and set Path to:
    .zfs/snapshot
  3. Continue to the Access protocols step and expand Enable NFS protocol.
    The read-only NFS path field shows the full export path for reference.
  4. Set Read access IPs and, if needed, Read/write access IPs (leave them empty to allow any client).
  5. Finish the wizard to create and activate the share.

Note: the same .zfs/snapshot path can also be used on an SMB share, by enabling the SMB protocol instead on the same step.

Accessing the share from an NFS client

Mount the share the same way as any other NFS export, for example:

 mount -t nfs <storage-server-address>:/Pools/<pool>/<dataset>/.zfs/snapshot /mnt/snaps

Once mounted, the directory contains one subdirectory per existing snapshot of the dataset, named after the snapshot. Each subdirectory is a read-only, point-in-time copy of the dataset's contents at the time the snapshot was taken.

Known limitations

  • The share is always read-only — files inside a snapshot cannot be modified or deleted from the client.
  • Only the exact path .zfs/snapshot can be shared. Deeper paths (for example, a specific snapshot name under it) cannot be entered as a share path.
  • Deleting a snapshot removes its directory from the share automatically; no share reconfiguration is required.

See also:

NFS service

Share properties

Share protocols

Snapshots