Shadow Copies not showing up

cshenderson

Cadet
Joined
Mar 23, 2018
Messages
5
Been running FreeNAS for 3 years now; shadow copies always worked since I first set it up.

Upgraded to 11.3; re-edited the shares to select shadowcopy2 and make sure the enable checkbox is checked.
Snapshots are all still showing good and on schedule.
My testing has included deliberately changing file and add/deleting folders. Shadow copy not showing for file/folder.. nothing. Just: "There are no previous versions available"
Helpful note, running MS AD, all Win10, share though cifs (SMB).
I have done reboots, smb resets, I even did a config export, new install to 11.3 and config import (then fixed shares again); everything fine except .. no shadow copies.
Everything I see troubleshooting is for older versions.
Even tried aux parameter:shadow:ignore_empty_snaps = false

Any helpful tips here? Am I missing something dumb on my part?
 

Attachments

  • Freenas_Shadow.png
    Freenas_Shadow.png
    7.2 KB · Views: 850

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Been running FreeNAS for 3 years now; shadow copies always worked since I first set it up.

Upgraded to 11.3; re-edited the shares to select shadowcopy2 and make sure the enable checkbox is checked.
Snapshots are all still showing good and on schedule.
My testing has included deliberately changing file and add/deleting folders. Shadow copy not showing for file/folder.. nothing. Just: "There are no previous versions available"
Helpful note, running MS AD, all Win10, share though cifs (SMB).
I have done reboots, smb resets, I even did a config export, new install to 11.3 and config import (then fixed shares again); everything fine except .. no shadow copies.
Everything I see troubleshooting is for older versions.
Even tried aux parameter:shadow:ignore_empty_snaps = false

Any helpful tips here? Am I missing something dumb on my part?

PM me a debug. We'll figure this out and try to get it sorted before U1 if there's an issue with the new shadow copy module. I may need to schedule a remote session with you if it does indeed appear to be a problem because the module is working correctly in our lab.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Every time I do a debug I get a Kernal Panic. Debug gets to 76% saving..then dies
Okay. Let's start with the basics. Run the following commands and then PM me the contents of /var/log/samba4.
"testparm -s" > /var/log/samba4/testparm.out
"zfs list -t snap | grep <your dataset name>" > /var/log/samba4/zfslist.out

If you have problems getting the directory directory off your server, try running the command tar -cvzf /mnt/tank/share/samba.tgz /var/log/samba4 where you substitute "/mnt/tank/share" with your share's connectpath. This will put a .tgz file in your share that you can then attach to a PM.
 

cshenderson

Cadet
Joined
Mar 23, 2018
Messages
5
Sent you that stuff in a conversation. Not sure the terminology in use as I have never used this forum before.
 

cshenderson

Cadet
Joined
Mar 23, 2018
Messages
5
While troubleshooting, the problem is seemingly solved.
By removing the shadow_copy2 module from the SMB options, shadow copy started to show up on windows machines.

When running version before 11.2, the shadow module had to be loaded in the options for shadow copy to work.
Unsure if I'm just dumb or missing something everyone else understood - but I don't see this clearly in the manual.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
While troubleshooting, the problem is seemingly solved.
By removing the shadow_copy2 module from the SMB options, shadow copy started to show up on windows machines.

When running version before 11.2, the shadow module had to be loaded in the options for shadow copy to work.
Unsure if I'm just dumb or missing something everyone else understood - but I don't see this clearly in the manual.
The new behavior is to just use the checkbox to enable shadow copy support. All snapshots that are using space will be displayed. No further action needed. shadow_copy2 is exposed to provide backwards-compatibility with legacy behavior. I'll probably need to just add a validation error to prevent users from doing both at once.
 

jenksdrummer

Patron
Joined
Jun 7, 2011
Messages
250
FWIW; just built using 11.3U1; shadow copies were not working. Unchecked the 'enable shadowcopies' checkbox on the share; saved; checked it back...shadow copies are now working and showing snaps.

Edit; inconsistency so far; a share I have which contains a single 3.5TB VHDX file; that I'm doing snaps (for replication), doesn't show a shadow even though there's at least 2. Will do more testing/troubleshooting...
 
Last edited:

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
FWIW; just built using 11.3U1; shadow copies were not working. Unchecked the 'enable shadowcopies' checkbox on the share; saved; checked it back...shadow copies are now working and showing snaps.

Edit; inconsistency so far; a share I have which contains a single 3.5TB VHDX file; that I'm doing snaps (for replication), doesn't show a shadow even though there's at least 2. Will do more testing/troubleshooting...
As a sanity check, make sure you have > 0 space used in the snaps "zfs list -t snap".
 

jenksdrummer

Patron
Joined
Jun 7, 2011
Messages
250
Actually, it does say 0 used for that 3.4T dataset (ava 3.4T). Surprising, because the UI shows a snap with 3.4T referenced. Also currently running a replication job on that dataset to another 11.3U1 host and it seems to be doing "something" about 1gb of data on a 10gb nic.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Actually, it does say 0 used for that 3.4T dataset (ava 3.4T). Surprising, because the UI shows a snap with 3.4T referenced. Also currently running a replication job on that dataset to another 11.3U1 host and it seems to be doing "something" about 1gb of data on a 10gb nic.
Can you post full output of zfs list -t snap -o name,used | grep <dataset name>?
 

jenksdrummer

Patron
Joined
Jun 7, 2011
Messages
250
OK, so when the snap is using 0, it doesn't show up in Windows. It does show as a snap-point on FreeNAS. It also doesn't replicate the snap.

Doing pull-replication w/ netcat+ssh. Source shows 4 snaps, destination shows 2 snaps. File was unmodified during the times of the latest 2 snaps; and show 0s.

1584027261006.png


1584026849219.png

1584026906956.png
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
OK, so when the snap is using 0, it doesn't show up in Windows. It does show as a snap-point on FreeNAS. It also doesn't replicate the snap.

Doing pull-replication w/ netcat+ssh. Source shows 4 snaps, destination shows 2 snaps. File was unmodified during the times of the latest 2 snaps; and show 0s.

View attachment 36470

View attachment 36468
View attachment 36469
Yes, this is a design feature. There is a limit to how many previous versions of a file can be presented to an SMB client. We try to only show relevant ones.
 

arefin932

Cadet
Joined
Aug 30, 2020
Messages
3
Is there a way to force samba to show all the snapshots, even the one with size 0, in Windows Volume Shadow copy? I can see all the hourly snapshots in FreeNas but the Windows Volume Shadow Copy only shows the snapshots with size > 0. I have tried aux parameter:shadow:ignore_empty_snaps = false with no luck. Attached is my SAMBA configuration in FreeNas.
 

Attachments

  • VSC.png
    VSC.png
    10.4 KB · Views: 531
  • Snaps-01.png
    Snaps-01.png
    20.5 KB · Views: 416
  • Snaps-00.png
    Snaps-00.png
    12.5 KB · Views: 391
  • smb-01.png
    smb-01.png
    9.2 KB · Views: 425
  • smb-00.png
    smb-00.png
    18.1 KB · Views: 419

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Is there a way to force samba to show all the snapshots, even the one with size 0, in Windows Volume Shadow copy? I can see all the hourly snapshots in FreeNas but the Windows Volume Shadow Copy only shows the snapshots with size > 0. I have tried aux parameter:shadow:ignore_empty_snaps = false with no luck. Attached is my SAMBA configuration in FreeNas.
Why do you need to see all of them? If you need direct access to the shadow copy directory you can just open it in File Explorer.
For instance, if you're sharing /mnt/tank/share as "SMB" and tank/share is a dataset, then you can just navigate to \\<server>\<smb>\.zfs\snapshot. This does not even require snapdir visibility to be enabled.
 

arefin932

Cadet
Joined
Aug 30, 2020
Messages
3
Why do you need to see all of them? If you need direct access to the shadow copy directory you can just open it in File Explorer.
For instance, if you're sharing /mnt/tank/share as "SMB" and tank/share is a dataset, then you can just navigate to \\<server>\<smb>\.zfs\snapshot. This does not even require snapdir visibility to be enabled.

The reason is, even though we are modifying and adding files in that share, the snapshot size always remains 0 . If we export a share from the previous snapshot we can see the files of that point of time but snapshot size between the previous and current snapshot still shows 0. We have users who are updating excel files continuously and they want to restore files to a previous version very often. If all the snaps do not show up in previous version, they can't restore the files to the point they want. I have added at least 2 GB of data in that share on 09/04/2020, but as you see in the attached picture that the snapshot sizes are all 0.
 

Attachments

  • snaps.png
    snaps.png
    24.8 KB · Views: 479

arefin932

Cadet
Joined
Aug 30, 2020
Messages
3
Also, when I navigate to \\<server>\<smb>\.zfs\snapshot directory, it is empty. The snapshot sizes are showing all 0.
 

Attachments

  • snapdir.png
    snapdir.png
    30.8 KB · Views: 415
  • Snapshots.png
    Snapshots.png
    25.1 KB · Views: 556

GEOptic

Dabbler
Joined
Apr 18, 2018
Messages
42
Hey Guys !!

Any conclusion on this VSS issue? I got the same situation after upgrading to TrueNAS 12u1.

I tried the SnapShot check box trick but it did not work. But I did not stop/start SMB service.

Tks!!
 
Top