From owner-freebsd-fs@FreeBSD.ORG Fri Jan 1 15:12:41 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B7621065693 for ; Fri, 1 Jan 2010 15:12:41 +0000 (UTC) (envelope-from mahlerrd@yahoo.com) Received: from web51002.mail.re2.yahoo.com (web51002.mail.re2.yahoo.com [206.190.38.133]) by mx1.freebsd.org (Postfix) with SMTP id DA91E8FC18 for ; Fri, 1 Jan 2010 15:12:40 +0000 (UTC) Received: (qmail 85934 invoked by uid 60001); 1 Jan 2010 15:12:37 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1262358757; bh=0TnDNaJYCKwfLCzguXgSj50XXkWt4d/3Z7uGSzfZHeI=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=ed96aDppzBMGSgGCaaJKQSwKNmzB4ArKlScWH9pKZlfEjWMieggcovhyv8XcjcPxmFPRnxcLzVh0U8oecwxZrQgpdYjkJP92kgbdO2oic34nvmTZXez0ahx6/gLGksMPNyns5hGgmF6Xglm/5xhrXm2UfdUtpfzrhB9FUFcx6JM= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=cfHu3QGd2R1/iauZlHjLHYS+IAvxcBqtU38PTridYkBwpnrJ+ASkj3URlhAB1yjPZTyvlRe9+IW+zvIBXvwtFVvz/EKLACiboWHm7QmCl5Qdpasj7dW9mL9+8dKpV5w9a/FnUQBfK3ujGXHYaIJbsB8iO9F6nzAv/0b6rvYKOU8=; Message-ID: <884434.85467.qm@web51002.mail.re2.yahoo.com> X-YMail-OSG: hdNw9ZAVM1lwt2V8WTVihFU8SoLMKeRKTqzpsV8090O2ahKrqz80SE5K0MMv2y9F3AySaXwhxgHxEiXtRv1nxijwXSrKgNoXFbbG5DWSPo2xV5qo87HGHQlyQoc8CG8Mbq2yFA5HfkfkLYqPY5mrS07iDHQQvEQHJfFKOqxDULAU1rP1pvVPBrplLR4TBVTtuyZH7nPZl78rdiLVHGxloDzjfUqSsQTnxhoN6u3Vow_Qz61CLRlWCr.VCklPaNoLC8YnaCf83P.2k03RueN8OFdQiNj2Y3tI0.0OE7EAhSZ91Wwna2NprfYWQh9FRaK2RqT2Vsldv_H49ujHF0qyFOqpL1fauCZ8iamSXMLrWV23VCRg7uwKs5it1tQQhaiJsyWexA.J.OuxrCSEv1TRzP3eKYdE3z2DWWIp.qiqG20AuQzZf_3LpDFLtCmWTd6hZKFnWbWi2gOIWOEBjC15Vg4dQqOFb.xIIcUSrgAMsy5HJl8SLF11gpB9LsZ5G7TUqAHunPfrWoUKUnyxB0FowrY6aaJOc0nyDGQoi7Gjcxz49ix0nuP4tMZYgbnMUQaofA-- Received: from [174.101.168.4] by web51002.mail.re2.yahoo.com via HTTP; Fri, 01 Jan 2010 07:12:37 PST X-Mailer: YahooMailRC/240.3 YahooMailWebService/0.8.100.260964 References: <368515.86742.qm@web51005.mail.re2.yahoo.com> <489290.49450.qm@web51006.mail.re2.yahoo.com> <4B3C751A.9040909@quip.cz> Date: Fri, 1 Jan 2010 07:12:37 -0800 (PST) From: Richard Mahlerwein To: Miroslav Lachman <000.fbsd@quip.cz> In-Reply-To: <4B3C751A.9040909@quip.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-fs@freebsd.org Subject: Samba + Previous Versions X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Richard Mahlerwein List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jan 2010 15:12:41 -0000 >From: Miroslav Lachman <000.fbsd@quip.cz> > >Do you see Previous Versions on Samaba shares from FreeBSD? I think you >need some tweaks in smb.conf: > >http://www.edplese.com/samba-with-zfs.html > >http://www.edplese.com/blog/2009/12/02/samba-shadow_copy2-enhancements/ > >http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/VFS.html#id2651813 > >Miroslav Lachman I applied the patch to my 3.3.9 source and did a make deinstall && make reinstall. It compiled OK, but it still isn't working properly overall. Not sure this still belongs in freebsd-fs. I'd be happy to move or repost the thread elsewhere if that should be the case... Here's the relevant portion of my smb.conf [test] comment = Testing ZFS and Snapshots path=/tank root preexec = /usr/bin/snapshot_date.sh tank vfs objects = shadow_copy2 shadow_copy2: snapdir = tank shadow_copy2: sort = desc shadow_copy2: localtime = yes read only = no guest ok = yes For snapdir, I have tried various things; .zfs, /tank, tank, .snap, /tank/snap, /tank/.snap... and another 30 or 40 items. I have no idea what this should be. Anyway, to continue. The preexec is working, as shown by the snapshots with GMT in them (BTW, it's a test VM and I never bothered to set the time zone, so those are GMT tagged but are actually Eastern Time US. :) Cool! curie# zfs list NAME USED AVAIL REFER MOUNTPOINT tank 178K 2.94G 48K /tank tank@snap1 16K - 18K - tank@GMT-2009.12.31-15.49.36 0 - 48K - tank@GMT-2009.12.31-15.54.02 0 - 48K - tank@GMT-2010.01.01-09.50.29 0 - 48K - And a snip of my /var/log/samba/log.smbd says (you'll note an extra non-standard log line, described below) [2010/01/01 09:50:29, 1] smbd/service.c:make_connection_snum(1119) fcp-rich (192.168.1.100) connect to service test initially as user test (uid=1002, gid=1002) (pid 4835) [2010/01/01 09:50:30, 0] modules/vfs_shadow_copy2.c:shadow_copy2_get_shadow_copy2_data(647) shadow:initializing with snapdir (null) [2010/01/01 09:50:30, 0] modules/vfs_shadow_copy2.c:shadow_copy2_get_shadow_copy2_data(651) shadow:snapdir not found for /tank in get_shadow_copy_data [2010/01/01 09:50:30, 0] smbd/nttrans.c:call_nt_transact_ioctl(1867) FSCTL_GET_SHADOW_COPY_DATA: connectpath /tank, failed. [2010/01/01 09:50:39, 1] smbd/service.c:close_cnum(1331) fcp-rich (192.168.1.100) closed connection to service test You'll notice I added one extra DEBUG item around line 647 in my source to tell me what snapdir actually was when it fails. 635 static int shadow_copy2_get_shadow_copy2_data(vfs_handle_struct *handle, 636 files_struct *fsp, 637 SHADOW_COPY_DATA *shadow_copy2_data, 638 bool labels) 639 { 640 SMB_STRUCT_DIR *p; 641 const char *snapdir; 642 SMB_STRUCT_DIRENT *d; 643 TALLOC_CTX *tmp_ctx = talloc_new(handle->data); 644 char *snapshot; 645 646 snapdir = shadow_copy2_find_snapdir(tmp_ctx, handle); 647 DEBUG(0,("shadow:initializing with snapdir %s\n", snapdir)); 648 649 if (snapdir == NULL) { 650 DEBUG(0,("shadow:snapdir not found for %s in get_shadow_copy_data\n", 651 handle->conn->connectpath)); So, question 1. What do I put for snapdir? What else am I missing? I'm sure it's something simple I've overlooked. Thanks! Rich Mahlerwein