Get a Quote     (408) 943-4100               TrueNAS Discord      VendOp_Icon_15x15px   Commercial Support Toggle between Light and Dark mode

Using SMB Shadow Copy

  3 minute read.

Last Modified 2023-01-18 10:24 EST

Enable Shadow Copies exports ZFS snapshots as Shadow Copies for Microsoft Volume Shadow Copy Service (VSS) clients.

About SMB Shadow Copies

Shadow Copies, also known as the Volume Shadow Copy Service (VSS) or Previous Versions, is a Microsoft service for creating volume snapshots. You can use shadow copies to restore previous versions of files from within Windows Explorer.

By default, all ZFS snapshots for a dataset underlying an SMB share path are presented to SMB clients through the volume shadow copy service or are accessible directly with SMB when the hidden ZFS snapshot directory is within the SMB share path.

Before you activate Shadow Copies in TrueNAS, there are a few caveats:

  • Shadow Copies might not work if the Windows system is not patched to the latest service pack. If previous versions of files to restore are not visible, use Windows Update to ensure the system is fully up-to-date.

  • Shadow Copies support only works for ZFS pools or datasets.

  • SMB share dataset or pool permissions must be configured appropriately.

Enabling Shadow Copies

To enable shadow copies, go to Shares > Windows (SMB) Shares and click Windows (SMB) Shares launch launch icon to display the list view Sharing > SMB screen.

  1. Click the more_vert for the share you want to change, and then click Edit. The Edit SMB screen displays.

  2. Scroll down to the bottom and click Advanced Options.

  3. Scroll down to Other Options and select Enable Shadow Copies.

  4. Click Save

Some users might experience issues in the Windows 10 v2004 release where they cannot access network shares. The problem appears to come from a bug in gpedit.msc, the Local Group Policy Editor. Unfortunately, setting the Allow insecure guest logon flag value to Enabled in Computer Configuration > Administrative Templates > Network > Lanman Workstation in the Windows appears to have no effect on the configuration.

To work around this issue, edit the Windows registry. Use Regedit and go to HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters. The DWORD AllowInsecureGuestAuth is an incorrect value: 0x00000000. Change this value to 0x00000001 (Hexadecimal 1) to allow adjusting the settings in gpedit.msc. You can use a Group Policy Update to apply this to a fleet of Windows machines.

Deleting Shadow Copies

Users with an SMB client cannot delete Shadow copies. Instead, the administrator uses the TrueNAS web interface to remove snapshots.

Disable shadow copies for an SMB share by clearing the Enable shadow copies checkbox on the Edit SMB screen for the SMB share. Disabling does not prevent access to the hidden .zfs/snapshot directory for a ZFS dataset when the directory is located within the path for an SMB share.

Related Content