Samba 3.6 and Volume Shadow Copy/Previous Versions with ZFS

Discussion related to network/web services such as Apache, BIND Sendmail, etc.

Samba 3.6 and Volume Shadow Copy/Previous Versions with ZFS

Postby aXon » 24 May 2012, 23:32

I am using FreeBSD 9.0 and have Samba 3.6 installed with a patch from http://www.en.sysadmin-cookbook.net/samba/#toc-gen-6 included in [FILE]/usr/ports/net/samba36/files[/FILE] before the compilation.

In my [FILE]smb.conf[/FILE] I have following entry to enable shadow copy/ Previous versions for Windows clients
Code: Select all
[Shared]
   comment = Public Stuff
   path = /pool/shared
   public = yes
   writable = yes
   vfs objects = shadow_copy2
   shadow: snapdir = .zfs/snapshot
   shadow: sort = desc
   shadow: format = AutoH-%Y-%m-%dT%H:%M


I use a rolling ZFS backup script, and my snapshots fit the format I have given in the [FILE]smb.conf[/FILE]:
Code: Select all
pool/shared@AutoH-2012-05-24T10:00
pool/shared@AutoH-2012-05-24T11:00
pool/shared@AutoH-2012-05-24T12:00
pool/shared@AutoH-2012-05-24T13:00
pool/shared@AutoH-2012-05-24T14:00
pool/shared@AutoH-2012-05-24T15:00
pool/shared@AutoH-2012-05-24T16:00
pool/shared@AutoH-2012-05-24T17:00
pool/shared@AutoH-2012-05-24T18:00
pool/shared@AutoH-2012-05-24T19:00
pool/shared@AutoH-2012-05-24T20:00
pool/shared@AutoH-2012-05-24T21:00
pool/shared@AutoH-2012-05-24T22:00


It all works fine in Windows, I can got into the properties of items on the network share and find "Previous Versions" as a selectable tab there. Now the problem: it only seems to detect folder versions, but nothing is displayed for files. I can copy and restore directories, but nothing with files.

The working tab looks like in this screenshot
Image

Resources on the use of Volume Shadow Copy and Previous versions in conjunction with samba are scarce and date quite some time back (as well as being mostly about Solaris). The screenshot shown is from Windows XP SP3 and I have tested the same share on a Windows 7 setup, so my guess is that it seems like a server/samba/[FILE]smb.conf[/FILE] issue?

I would be glad for any input someone could offer on this topic :)
aXon
Junior Member
 
Posts: 7
Joined: 16 Apr 2012, 08:19

Postby acheron » 25 May 2012, 08:23

"Previous Versions" works fine here without the patch from http://www.en.sysadmin-cookbook.net/samba/#toc-gen-6. I just need to put the following line in the global section of [FILE]smb.conf[/FILE]:
Code: Select all
unix extensions = no

and these lines in the share section:
Code: Select all
follow symlinks = yes
wide links      = yes
acheron
Junior Member
 
Posts: 92
Joined: 18 Aug 2010, 11:37
Location: France

Postby aXon » 25 May 2012, 10:36

Thank you for your input acheron :)
I have deleted the patch file as well as recompiled/-installed samba and added your suggested parameters to my [FILE]smb.conf[/FILE].
Now a shared entry sample looks like this in the config
Code: Select all
[Shared]
  path=/pool/shared
  follow symlinks = yes
  wide links = yes
   vfs objects = shadow_copy2
   shadow: snapdir = .zfs/snapshot
   shadow: sort = desc
   shadow: format = AutoH-%Y-%m-%dT%H:%M


Unfortunately still no luck as "Previous Versions" tab not showing any entries, but directories do. Could you please post a full example share that works, or maybe example [FILE]smb.conf[/FILE] file you use, maybe I am missing something else. Thanks again.
aXon
Junior Member
 
Posts: 7
Joined: 16 Apr 2012, 08:19

Postby ondra_knezour » 25 May 2012, 12:20

Just blind shoot - compare yours FreeBSD version with acherons one. Last week I had somehow similar problem. Midnight commander installed on FreeBSD stable was displaying only empty directories over ssh link to computer with 9-release. After updating remote computer to stable branch problem disappeared.
ondra_knezour
Member
 
Posts: 382
Joined: 17 Nov 2008, 18:17
Location: Prague, Czech Republic, Europe

Postby aXon » 25 May 2012, 14:46

Ok, here we go:
Code: Select all
FreeBSD hostname 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan  3 07:46:30 UTC 2012     
root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64
samba36-3.6.5

Ports are up to date as well.
aXon
Junior Member
 
Posts: 7
Joined: 16 Apr 2012, 08:19

Postby acheron » 25 May 2012, 17:45

I'm running CURRENT (I don't know the exact svn revision). My [file]smb.conf[/file] is similar to yours. I'm not sure I understand what you mean with
"Previous Versions" tab not showing any entries, but directories do
You just need to double click on the "previous version" you are interested in and an Explorer will pop up and let you pick whatever files/directories you want from that snapshot.
acheron
Junior Member
 
Posts: 92
Joined: 18 Aug 2010, 11:37
Location: France

Postby aXon » 26 May 2012, 08:06

Ok, so we are using a different versions, if this has anything to do with it.

Maybe I have to clarify how I access "Previous versions" in Windows 7 and XP: I right click on any element, be it file or directory, on the network samba share in the Explorer and select "Properties" and from there I access the tab "Previous versions", which looks like the one in my first post. Now, this only gives me a populated list for directory properties, but for file properties the list of available snapshots is empty. When I select copy or restore for a directory in "Previous versions", everything works, so I am not sure what goes wrong for files.

Thanks again ;)
PS: If there is another way of accessing files/directories as you described, I don't know about it, which is why I use PV like I do through Explorer Properties.
aXon
Junior Member
 
Posts: 7
Joined: 16 Apr 2012, 08:19

Postby acheron » 01 Jun 2012, 08:24

Ok I see what you mean and I have the same behaviour. What I was doing is right click on the network share, select properties, previous version and double clik on the snapshot I'm interested in.
acheron
Junior Member
 
Posts: 92
Joined: 18 Aug 2010, 11:37
Location: France


Return to Web & Network Services

Who is online

Users browsing this forum: Zwanzie and 3 guests