Jean-Christophe Delaye
2009-Nov-18 10:35 UTC
[Samba] Samba 3.4.2 with Solaris ZFS Snaphots
Hi, I'm trying to make samba working with Solaris ZFS Snaphots. Solaris 10 is running on a x64/X86 box which is both Samba (3.4.2) server and Zfs server. I created home/delaye filesystem with home zfs pool. # zpool list NAME SIZE USED AVAIL CAP HEALTH ALTROOT home 1.98G 2.60M 1.98G 0% ONLINE - home/delaye 2.47M 1.95G 1.66M /home/delaye Snapshots are named with the syntax @GMT-`date -u +%Y.%m.%d-%H.%M.%S` and created using # zfs snapshot home/delaye at GMT-`date -u +%Y.%m.%d-%H.%M.%S` # zfs list NAME USED AVAIL REFER MOUNTPOINT home 1.80M 1.95G 23K /home home/delaye 1.70M 1.95G 1.67M /home/delaye home/delaye at GMT-2009.11.18-10.01.13 31K - 1.67M - samba supports shadow copy (and zfs acl) as Build Options. smbd -b vfs_shadow_copy2_init vfs_shadow_copy_init vfs_zfsacl_init Builtin modules: pdb_ldap pdb_smbpasswd pdb_tdbsam pdb_wbc_sam rpc_lsarpc rpc_winreg rpc_initshutdown rpc_dssetup rpc_wkssvc rpc_svcctl rpc_ntsvcs rpc_netlogon rpc_netdfs rpc_srvsvc rpc_spoolss rpc_eventlog rpc_samr idmap_ldap idmap_tdb idmap_passdb idmap_nss nss_info_template auth_sam auth_unix auth_winbind auth_wbc auth_server auth_domain auth_builtin auth_netlogond vfs_default vfs_solarisacl I tried to configure a share in smb.conf supporting zfs snapshot as shadow copy provider with the following: [delaye] comment = JCD path = /home/delaye read only = No writable = yes acl check permissions = No hide dot files = No oplocks = No level2 oplocks = No vfs objects = shadow_copy2 shadow:snapdir = /home/delaye/.zfs/snapshot shadow:basedir = /home/delaye but I never see any previous version for files from client PC running XP (SP3) accessing to this samba share. Can anyone help to troubleshoot this? Does anybody have a running setup for Solaris zfs snapshots ? Thanks
On Wed, 18 Nov 2009 11:35:49 +0100 Jean-Christophe Delaye <Jean-Christophe.Delaye at eurecom.fr> wrote: JCD> Hi, JCD> I'm trying to make samba working with Solaris ZFS Snaphots. JCD> Solaris 10 is running on a x64/X86 box which is both Samba (3.4.2) JCD> server and Zfs server. JCD> I created home/delaye filesystem with home zfs pool. ..... .... JCD> Can anyone help to troubleshoot this? Does anybody have a running setup JCD> for Solaris zfs snapshots ? We are extensively using ZFS snapshots with samba, it works like a charm. We use the patches from http://www.edplese.com/samba-with-zfs.html this give us freedom in naming convention they still can be applied (manuallly) to samba-3.4.x/source3/modules/vfs_shadow_copy.c [homes] comment = Home directories browseable = no public = no read only = no inherit permissions = yes delete readonly = yes map archive = no map readonly = no # vfsobject = shadow_copy, zfsacl vfsobject = shadow_copy shadow_copy: sort = desc shadow_copy: path = .zfs/snapshot shadow_copy: format = $Y-$m-$d hide files = /?esktop.ini/*utloo*.lnk/*Briefcase*/*RECYCLE*/ -- Jean-Jacques Moulis Tel: (013) 281684 ISY Fax: (013) 139282 Link?ping University E-mail: jj at isy.liu.se 581 83 Link?ping
Jean-Jacques Moulis <jj at isy.liu.se> wrote:> We use the patches from http://www.edplese.com/samba-with-zfs.html > this give us freedom in naming convention > they still can be applied (manuallly) toSure? On 3.4.2, when I try to apply this patches only dirent-fix.patch is applicable. The other two are being rejected. Ralf
Hi, Sorry for the lack of proper threading, but I wasn't subscribed to the list at the time. On Nov 26, 2009, Jeremy Allison wrote:> On Wed, Nov 18, 2009 at 08:09:16PM +0100, Volker Lendecke wrote: > > On Wed, Nov 18, 2009 at 11:05:07AM -0800, Jeremy Allison wrote: > > > > We are extensively using ZFS snapshots with samba, it works like a charm. > > > > > > > > We use the patches from http://www.edplese.com/samba-with-zfs.html > > > > this give us freedom in naming convention > > > > they still can be applied (manuallly) to samba-3.4.x/source3/modules/vfs_shadow_copy.c > > > > > > Hmmm - these patches look really interesting ! I wonder > > > how they didn't get added into mainline source code.... > > > > Maybe because nobody wants to touch the shadow_copy module? > > shadow_copy2 is the one that has seen fixes lately, I have > > some patches for shadow_copy2 that are still pending to be > > merged upstream.What patches are currently pending? Do any of them eliminate the need for some of the ZFS patches?> Ah ok, didn't realize the difference between the two. > Maybe we should remove the vfs_shadow_copy and concentrate > everything on vfs_shadow_copy2 (and look at merging these > patches).Has anyone else started merging these patches to the shadow_copy2 module? If not, I'll get started with it. Ed Plese