Snapshots not exporting to Windows "Restore Previous Versions" over CIFS

Status
Not open for further replies.

Knowltey

Patron
Joined
Jul 21, 2013
Messages
430
Upgraded to 9.2.0 here recently and began noticing an issue that where the periodic snapshots that are made on my NAS do not seem to all export to the "Restore Previous Versions" interface when accessnig the CIFS share over Windows as they previously did.

However it does not seem to be an issue with 9.2.0 as I did some testing around with my other FreeNAS server and it seems to be able to export them all fine, however on my main NAS it seems that only the first created snapshot will be exported to the "Restore Previous Versions" interface, no others will be reflected in that interface.

The dataset in question that I am running said snapshosts on is located at /mnt/R1-1/Data and the CIFS share is also pointed at /mnt/R1-1/Data.

I had at one point renamed the pool and the datasets so that the snapshot full paths were under 53 characters in length since I saw an older topic here that stated that might be the case but tghere was no luck in that solution.

Anyone know if there may be any sort of things that I may have misconfigured on my NAS to cause this behaviour?
 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
Did you change your snapshot schedule (expiration)? Do you have multiple snapshots with different lifetimes?
 

Knowltey

Patron
Joined
Jul 21, 2013
Messages
430
I did recreate the pool fresh recently, but the issue existed before that as well (the fresh recreate was an attempt at troubleshooting). Snapshot schedule had not changed from the time it workedto the time it did not. Snapshot schedule is as follows:

- every 1 week, keep for 1 month, all days all times
- every 1 day, keep for 1 week, all days all times
- every 1 hour, keep for 1 day, all days all times
- every 12 hours, keep for 2 days, all days all times
- every 30 minutes, keep for 3 hours, M-F 17:00 -> 22:00
- every 30 minutes, keep for 3 hours, Friday, 22:00 -> 23:45:00
- every 30 minutes, keep for 3 hours, all day Saturday and Sunday.

If I delete the single snapshot that happens to get shown in the Restore Previous Versions interface via the FreeNAS GUI it will simply bring in whatever is the next snapshot that occurs. The current one being shown is one of the one month keep snapshots.
 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
The shadow copy functionality in FreeNAS is limited to one snapshot name format. With different snapshot lifetimes you have several formats (in your case you have 5 lifetimes: 3 hours, 2 days, 1 day, 1 week, 1 month). As it can make only one available via shadow copy it will pick the first snapshot in the config DB and use that. In your case it's the weekly (1 month lifetime) snapshots. So, before when it appeared to work better it probably showed you the "3 hours" snapshots then something changed in the config DB and now it picks the 1 week snapshots.
 

Knowltey

Patron
Joined
Jul 21, 2013
Messages
430
Ah that makes sense now that you mention it, on the first time it was a 1m, I deleted that and it made and grabbed a new 1m.

I shall go ahead and try making a new schedule and have it start with grabbing the 1 days before creating the other parts of he schedule and see I I still encounter the issue.
 

tanik1

Contributor
Joined
Mar 31, 2013
Messages
163
how would i access the zfs snapshots through windows 7? like browse the snapshot?
 

Knowltey

Patron
Joined
Jul 21, 2013
Messages
430
Right click on a file that is in the snapshot on a CIFS share and click "Restore Previous Versions." The snapshots will be exported to the Windows machine in a format that it can read.
 

tanik1

Contributor
Joined
Mar 31, 2013
Messages
163
Right click on a file that is in the snapshot on a CIFS share and click "Restore Previous Versions." The snapshots will be exported to the Windows machine in a format that it can read.

yea didnt see it show up the first time. Thought i had to turn something on. But now its listing the snapshots. thanks
 

Scharbag

Guru
Joined
Feb 1, 2012
Messages
620
When may FreeNAS be able to server multiple snapshots of the same dataset to windows? That is the only thing I miss from OpenIndiana.

I thought I read about this as a targeted feature but I could not find it in the roadmap (or I am just blind...).

Cheers,
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
When may FreeNAS be able to server multiple snapshots of the same dataset to windows? That is the only thing I miss from OpenIndiana.

I thought I read about this as a targeted feature but I could not find it in the roadmap (or I am just blind...).

Cheers,

I believe there was a significant upstream limitation that has been keeping this feature away, can't really remember what it was, though.
 

Kruger

Cadet
Joined
Sep 13, 2014
Messages
6
The shadow copy functionality in FreeNAS is limited to one snapshot name format. With different snapshot lifetimes you have several formats (in your case you have 5 lifetimes: 3 hours, 2 days, 1 day, 1 week, 1 month). As it can make only one available via shadow copy it will pick the first snapshot in the config DB and use that. In your case it's the weekly (1 month lifetime) snapshots. So, before when it appeared to work better it probably showed you the "3 hours" snapshots then something changed in the config DB and now it picks the 1 week snapshots.

Is there any possible way of changing the default snapshot in the example above, other than deleting and recreating it in order of preference?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Is there any possible way of changing the default snapshot in the example above, other than deleting and recreating it in order of preference?

Few things to point you in a direction... not sure where you'll go with it:

1. The shadow copy function is a feature of Samba, so Samba guys will probably know more about how to do this..
2. The behavior is still the same as always.
3. The limitation itself is because of Samba, so again the Samba guys will understand it better.
4. There is probably some hacky way to do what you are wanting (changing the default), but again Samba guys would know "how" to do that and could give advice.
 

pernils

Explorer
Joined
Aug 31, 2015
Messages
87
(freenas 9.3)

Does someone have a source for reading of this "non working" config (shadow:format)

Have read throw this http://manpages.ubuntu.com/manpages/xenial/man8/vfs_shadow_copy2.8.html and nowhere it tells you that you can't later on change into another snapshot schema.
You are stuck with that one you started with even if testparm show you something different.

for example. I have created a schema

- every 1 day, keep for 100 days
- every 10 min, keep for 1 day

Print out from testparm ...

Code:
.....
[data]
        path = /mnt/Vol_1/data
        read only = No
        guest ok = Yes
        ea support = No
        case sensitive = Yes
        hide dot files = No
        veto files = /.snapshot/.windows/.mac/.zfs/
        map archive = No
        map readonly = no
        store dos attributes = No
        vfs objects = shadow_copy2 zfs_space zfsacl aio_pthread streams_xattr recycle recycle
        zfsacl:acesort = dontcare
        nfs4:chown = true
        nfs4:acedup = merge
        nfs4:mode = special
        shadow:snapdirseverywhere = yes
        shadow:format = auto-%Y%m%d.%H%M-2d
        shadow:localtime = yes
        shadow:sort = desc
        shadow:snapdir = .zfs/snapshot
        recycle:subdir_mode = 0700
        recycle:directory_mode = 0777
        recycle:touch = yes
        recycle:versions = yes
        recycle:keeptree = yes
        recycle:repository = .recycle/%U

[data_100_days]
        path = /mnt/Vol_1/data
        read only = No
        ea support = No
        case sensitive = Yes
        hide dot files = No
        veto files = /.snapshot/.windows/.mac/.zfs/
        map archive = No
        map readonly = no
        store dos attributes = No
        vfs objects = shadow_copy2 zfs_space zfsacl aio_pthread streams_xattr recycle
        zfsacl:acesort = dontcare
        nfs4:chown = true
        nfs4:acedup = merge
        nfs4:mode = special
        shadow:snapdirseverywhere = yes
        shadow:format = auto-%Y%m%d.%H%M-100d
        shadow:localtime = yes
        shadow:sort = desc
        shadow:snapdir = .zfs/snapshot



Both of them will use the first created one.

Hmm.. could it be possible to create a script that will symlink the different schema to one format ?

Anyone tried this ?
 
Last edited:

pernils

Explorer
Joined
Aug 31, 2015
Messages
87
After a bit of testing ...

For making the snapshot dir visible .. (my dataset is Vol/test)

Code:
zfs set snapdir=visible Vol/test (my dataset is  Vol/test)


But this will not make this directory writable.
The final show stopper is that Auxiliary Parameters: on the CIFS share comes before the shadow:*** stuff so you can't change the shadow:snapdir by adding it into auxiliary parameters.

One way could be to edit the auto generated /usr/local/etc/smb4.conf and restart CIFS every time you make a change but then it start to get a bit to complex.

****************************

Moving this to new thread..

https://forums.freenas.org/index.ph...or-restore-previous-version-under-cifs.51129/
 
Last edited:
Status
Not open for further replies.
Top