Shadow Copies with automated, recursive Snapshots

Status
Not open for further replies.

Scampicfx

Contributor
Joined
Jul 4, 2016
Messages
125
Dear guys,

when I have a look to FreeNAS doc, I notice following chapter:
http://doc.freenas.org/9.10/sharing.html?highlight=shadow#configuring-shadow-copies

Quote:
Shadow copies will not work with a manual snapshot, you must create a periodic snapshot task for the pool or dataset being shared by SMB or a recursive task for a parent dataset.

When I go to bug section, I notice this feature request:
https://bugs.freenas.org/issues/2521 (4 years ago)

Afterwards, I notice that although the issue mentioned above is marked as "solved", it looks like the problem is back again:
https://bugs.freenas.org/issues/8026 (2 years ago)

So, my question is: what is the actual status of this problem?

I have many datasets and child-child-datasets configured. However, shares are only configured for the most top-level datasets. In total I have only 4-5 shares and about 20 datasets. It looks like this:

Code:
- volume
-- volume
---- data1 (dataset AND share)
------ user a (dataset only)
------ user b (dataset only)
------ user c (dataset only)
------ [...]
---- data2 (dataset AND share)
------ user a (dataset only)
------ user b (dataset only)
------ user c (dataset only)
------ [...]
---- [...]
---- dataN


I configured multiple recursive snapshot tasks for volume (1 hourly - keep a day; daily - keep a wek; weekly - keep a month, and so on...). FreeNAS created the snapshots correctly. However, I was not able to use the shadow copy function on a windows client.

So, before I get into detail, I would like to ask, if setting up this scenario is actually possible? It would be a mess to configure one seperate share for each sub-dataset and to configure multiple snapshots task for each sub-dataset... :/

Thanks!
Scampicfx
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Did you try selecting the snapshot task like this under the Sharing -> SMB -> Double Click on the share?

upload_2017-5-26_15-52-18.png


In the above example:

1. the snapshot task is recursively from tank
2. I'm sharing out the root of a dataset (Entertainment in my case)
3. I was able to look at previous versions without problems for tank/Entertainment.
4. I could not look at previous versions of a dataset under Entertainment called "test2" because it is a different file system.

A snippet from our manual: http://doc.freenas.org/9.10/sharing.html?highlight=vss#configuring-shadow-copies

Before using shadow copies with FreeNAS®, be aware of the following caveats:

  • If the Windows system is not fully patched to the latest service pack, Shadow Copies may not work. If you are unable to see any previous versions of files to restore, use Windows Update to make sure that the system is fully up-to-date.
  • Shadow copy support only works for ZFS pools or datasets. This means that the SMB share must be configured on a volume or dataset, not on a directory.
  • Datasets are filesystems and shadow copies cannot traverse filesystems. If you want to be able to see the shadow copies in your child datasets, create separate shares for them.
  • Shadow copies will not work with a manual snapshot, you must create a periodic snapshot task for the pool or dataset being shared by SMB or a recursive task for a parent dataset.
  • The periodic snapshot task should be created and at least one snapshot should exist before creating the SMB share. If the SMB share was created first, restart the SMB service in Services → Control Services.
  • Appropriate permissions must be configured on the volume/dataset being shared by SMB.
  • Users cannot delete shadow copies on the Windows system due to the way Samba works. Instead, the administrator can remove snapshots from the FreeNAS® administrative GUI. The only way to disable shadow copies completely is to remove the periodic snapshot task and delete all snapshots associated with the SMB share.
The bold is why I cannot look at previous versions of a dataset under Entertainment. If I'm understanding you, you are wanting datasets like "user a" to have previous versions. That would require you to share those out as their own shares. Is this your problem, and does this explain it?
 

Scampicfx

Contributor
Joined
Jul 4, 2016
Messages
125
Dear cyberjock,
thanks for your quick reply.

I just carried out following test regarding "data2":

Code:
- volume
-- volume
---- data1 (dataset AND share)
------ user a (dataset only)
------ user b (dataset only)
------ user c (dataset only)
------ [...]
---- data2 (dataset AND share)
------ user a (dataset only)
------ user b (dataset only)
------ user c (dataset only)
------ [...]
---- [...]
---- dataN


- data2 is configured as dataset and as a windows share
- i created a periodic snapshot task for volume/data2; i checked the box recursive, in order to include data2/user a, data2/user b, etc. in the snapshots!
- the periodic snapshot task is running smooth and is creating snapshots every 5 minutes from data2, data2/user a, data2/user b, etc.

I continued configuration by clicking Services -> Windows (SMB) and slecting the share /mnt/volume/data2; After selecting the share, I clicked on edit. In the modal box, I clicked on "Advanced Mode". At the bottom of the box, I selected "Periodic Snapshot Task: volume/data2 - every 5 minutes - 1 week".

I restarted SMB service. Waited.... Aaand...

and it looks like that it is working now! xD In Windows Explorer I can see the shadow copy of the file, now! I have to do some further testing tonight... :)

Thanks so much! This saves a lot of time! :)
 
Status
Not open for further replies.
Top