Help Removing CIFS Previous Versions in Windows

Status
Not open for further replies.

davlun

Cadet
Joined
Apr 23, 2014
Messages
5
Hello,

We are running 9.3. I selected a 'periodic snapshot task' in the advanced section for a CIFS share late tonight at the office, after everyone had left for the day. I did not necessarily want it permanently but I did want to see how it presented itself in windows explorer. While I think it is interesting, I do not want to give access to end users to restore an entire folder tree to a version a month ago for example. So I tried to undo that, without success.

Here is what I have tried:
1) tried selecting "---" as my 'periodic snapshot task' multiple times and saving. I thought that if you could make a selection, you should be able to unmake a selection. However, when you reload the share info, the previously selected snapshot task is still visible. Further, when you look in windows explorer, you can still see the previous versions.

2) tried creating a new snapshot that has not run yet and won't until Friday. Then I went into share properties and selected this new 'periodic snapshot task' and saved the changes. After I confirmed that the selection was saved by reloading the share properties, I looked at windows explorer. Previous versions are still visible.

Is there any way to remove these? Do I have to delete the snapshots I have first? (I would prefer not to)

Thanks,

David
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Hello,

We are running 9.3. I selected a 'periodic snapshot task' in the advanced section for a CIFS share late tonight at the office, after everyone had left for the day. I did not necessarily want it permanently but I did want to see how it presented itself in windows explorer. While I think it is interesting, I do not want to give access to end users to restore an entire folder tree to a version a month ago for example. So I tried to undo that, without success.

Here is what I have tried:
1) tried selecting "---" as my 'periodic snapshot task' multiple times and saving. I thought that if you could make a selection, you should be able to unmake a selection. However, when you reload the share info, the previously selected snapshot task is still visible. Further, when you look in windows explorer, you can still see the previous versions.

2) tried creating a new snapshot that has not run yet and won't until Friday. Then I went into share properties and selected this new 'periodic snapshot task' and saved the changes. After I confirmed that the selection was saved by reloading the share properties, I looked at windows explorer. Previous versions are still visible.

Is there any way to remove these? Do I have to delete the snapshots I have first? (I would prefer not to)

Thanks,

David
Is this an AD environment? If so, there is a Group Policy Object you can enable that prevents users from 'restoring' from VSS.

Also, freenas can only present one snapshot task to SMB users. You could always create two of then and present the one that expires quickly.
 

davlun

Cadet
Joined
Apr 23, 2014
Messages
5
Anodos, thanks for the reply.

I will look into the GPO solution for the masses if cant fix any other way. My #2 attempt yesterday, creating a second snapshot with nothing in it (since it only runs on Friday's) removed the previous version history in windows explorer, after rebooting freenas.

My real question is this, how do you disassociate entirely a 'periodic snapshot task' from a share? It seemed that once assigned a task, the only way to get it not to show previous versions from the snapshots was to give it a new task to look at. I would think there would be a way to just remove the association between the share and snapshot versions altogether.

Thanks,

David
 

davlun

Cadet
Joined
Apr 23, 2014
Messages
5
Thanks for the help.

I have tried deleting the snapshot via the gui, but after saving changes, but when I reopen, the snapshot to show for versions is back again... clearly it is not being removed.

How do I remove the shadow_copy2 vfs object from the share config? I assume this is not in the GUI.
 
Joined
Jul 10, 2016
Messages
521
Did you try restarting the SMB service?
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Might be worth a feature request/bug report. It's a very weird thing to want, but the amount of work is minimal.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
You can remove the "shadow_copy2" vfs object by adding the share level auxiliary parameter vfs objects = zfsacl streams_xattr to only have "zfsacl" and "streams_xattr" enabled. If you want others (for instance zfs_space), then add them to the list vfs objects = zfsacl streams_xattr zfs_space
 

davlun

Cadet
Joined
Apr 23, 2014
Messages
5
Your depth of knowledge exceeds mine, but here are my responses.

I believe a strong argument can be made that any setting/attribute set by a gui should be able to be reversed by the gui. In this case, I can set it, but it does not remove itself.
Might be worth a feature request/bug report. It's a very weird thing to want, but the amount of work is minimal.

Yes I have tried to restart multiple times, and the server has been rebooted a few times in the last couple of weeks as well.
Did you try restarting the SMB service?

I think this may be what I need. Which config file would this be in?
You can remove the "shadow_copy2" vfs object by adding the share level auxiliary parameter vfs objects = zfsacl streams_xattr to only have "zfsacl" and "streams_xattr" enabled. If you want others (for instance zfs_space), then add them to the list vfs objects = zfsacl streams_xattr zfs_space

Thanks again for the help folks.

David
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
I think this may be what I need. Which config file would this be in?
David

This isn't in a config file. it is done through the web UI. Click on "Sharing" -> "CIFS Shares". Then select your share and enter "advanced mode". Once you are there populate the line I quoted above.
 

dkusek

Explorer
Joined
Mar 16, 2016
Messages
78
Im going to weigh in here. I'm running 9.10.2-U2 and this is not possible. If I have a replication task for a dataset (pool/dataset) and I then set an SMB share to show a "Periodic Snapshot Task" for pool/dataset, I am unable to remove it. I have put the auxiliary parameters in as advised above and it has shown no change. Also note that this is an instance where Active Directory is running (unable to restart SMB service because it is bound by AD). I also deleted the periodic snapshot task on pool/dataset and then removed all pool/dataset snapshots that had been stored. Then went back and tried selecting the null Periodic Snapshot Task and adding in the Aux Parameters again. The smb4.conf file looks like this: Screen Shot 2017-04-19 at 2.06.59 PM.png

My question at this point is do the Aux Params overrule the previously listed "vfs objects" in the smb4.conf file? If so, problem solved. If not, then this is definitely a bug that needs to be worked out.

Thank you!
 

Attachments

  • Screen Shot 2017-04-19 at 2.06.59 PM.png
    Screen Shot 2017-04-19 at 2.06.59 PM.png
    16.1 KB · Views: 448

dkusek

Explorer
Joined
Mar 16, 2016
Messages
78
Ok, I think an easy workaround here is to just delete the periodic snapshot task in Storage. Once I did that, I went back to Sharing > SMB and double clicked the pool/dataset share. The "Periodic Snapshot Task" was back to "----". We are going to make sure that this fixes the issue. After doing that, you can then just set up a new periodic snapshot task.

One thing that this might throw off is replication tasks that are reliant on concurrent, leap-frogging periodic snapshot tasks. If one had a replication task going, deleted the associated snapshot task to fix this issue, they would then probably have to re-replicate all data on the replication or backup pool.... Does that sound about right?
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Im going to weigh in here. I'm running 9.10.2-U2 and this is not possible. If I have a replication task for a dataset (pool/dataset) and I then set an SMB share to show a "Periodic Snapshot Task" for pool/dataset, I am unable to remove it. I have put the auxiliary parameters in as advised above and it has shown no change. Also note that this is an instance where Active Directory is running (unable to restart SMB service because it is bound by AD). I also deleted the periodic snapshot task on pool/dataset and then removed all pool/dataset snapshots that had been stored. Then went back and tried selecting the null Periodic Snapshot Task and adding in the Aux Parameters again. The smb4.conf file looks like this: Screen Shot 2017-04-19 at 2.06.59 PM.png

My question at this point is do the Aux Params overrule the previously listed "vfs objects" in the smb4.conf file? If so, problem solved. If not, then this is definitely a bug that needs to be worked out.

Thank you!

Adding the vfs objects line should work. Note that changes to a share definition will not affect current connections to the share. You will need to log out of the Windows client then log back in and access the share to see a change. I created a bug report here: https://bugs.freenas.org/issues/23460
 

dkusek

Explorer
Joined
Mar 16, 2016
Messages
78
When I did the previous steps, I was not connected to the share and the smb4.conf file did not change (outside of adding "vfs objects = zfs_space zfsacl catia fruit streams_xattr"). Thank you for the bug ticket submission!
 

dkusek

Explorer
Joined
Mar 16, 2016
Messages
78
Checked with "davlun" and following a reboot, your Aux Parameters one liner did the trick. Sorry for the run around. In any case, the bug should be fixed as one should be able to de-select a snapshot to be viewable to security and data integrity reasons.
 
Status
Not open for further replies.
Top