From owner-freebsd-current@FreeBSD.ORG Mon Mar 14 08:37:30 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 142E2106564A for ; Mon, 14 Mar 2011 08:37:30 +0000 (UTC) (envelope-from murankar@iut-mir-o.ujf-grenoble.fr) Received: from amazone1.ujf-grenoble.fr (amazone1.ujf-grenoble.fr [193.54.238.254]) by mx1.freebsd.org (Postfix) with ESMTP id B429F8FC15 for ; Mon, 14 Mar 2011 08:37:29 +0000 (UTC) Received: from tana3.ujf-grenoble.fr (tana3.ujf-grenoble.fr [152.77.18.201]) by amazone1.ujf-grenoble.fr (8.13.7/8.13.7/Configured by JE/GB 2010-12-10) with ESMTP id p2E8bRIX084303 for ; Mon, 14 Mar 2011 09:37:27 +0100 (CET) Received: from tana3.ujf-grenoble.fr (unknown [127.0.0.1]) by tana3.ujf-grenoble.fr (Postfix) with ESMTP id A54A35C0F for ; Mon, 14 Mar 2011 09:37:27 +0100 (CET) X-UJF-AV: Scanned on tana3.ujf-grenoble.fr Received: from tibre3.ujf-grenoble.fr (tibre3.ujf-grenoble.fr [152.77.18.213]) by tana3.ujf-grenoble.fr (Postfix) with ESMTP id 8AFF15C02 for ; Mon, 14 Mar 2011 09:37:27 +0100 (CET) Received: from iut-mir-o.ujf-grenoble.fr (iut-mir-o.ujf-grenoble.fr [152.77.59.35]) by tibre3.ujf-grenoble.fr (8.14.3/8.14.3/SyS-1.10) with ESMTP id p2E8bP3x042739 for ; Mon, 14 Mar 2011 09:37:27 +0100 (CET) (envelope-from murankar@iut-mir-o.ujf-grenoble.fr) Received: from iut-mir-o.ujf-grenoble.fr (localhost [127.0.0.1]) by iut-mir-o.ujf-grenoble.fr (8.14.4/8.14.4) with ESMTP id p2E8bPfM014482 for ; Mon, 14 Mar 2011 09:37:25 +0100 (CET) (envelope-from murankar@iut-mir-o.ujf-grenoble.fr) Received: (from murankar@localhost) by iut-mir-o.ujf-grenoble.fr (8.14.4/8.14.4/Submit) id p2E8bPW5014481 for freebsd-current@freebsd.org; Mon, 14 Mar 2011 09:37:25 +0100 (CET) (envelope-from murankar) Date: Mon, 14 Mar 2011 09:37:25 +0100 From: Urankar Mikael To: FreeBSD Current Message-ID: <20110314083725.GE47419@iut-mir-o.ujf-grenoble.fr> References: <20110310131710.GG96225@iut-mir-o.ujf-grenoble.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Subject: Re: ZFSv28, zfs list behaviour and sysutils/freebsd-snapshot X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2011 08:37:30 -0000 On Mon 14 March 2011 at 02:44:16AM -0400, J. Hellenthal wrote: > On Thu, 10 Mar 2011 08:17, mikael.urankar@ wrote: > >Hi, > > > >I'm using sysutils/freebsd-snapshot to make periodic ZFS backup snapshot > >and this soft is broken since the upgrade of my pool to ZFSv28. > >After some debugging it appears that "zfs list" behaviour has changed > >with ZFSv28, and since freebsd-snapshot relies on "zfs list" to retrieve > >the "ZFS file system name" from the "mountpoint name" the soft doesn't > >work anymore. > > > >output of "zfs list" on a 8.2R amd64 (ZFSv15) : > >zfs list /home/murankar > >NAME USED AVAIL REFER MOUNTPOINT > >tank/home/murankar 1.47M 1.59T 1.47M /home/murankar > > > >zfs list tank/home/murankar > >NAME USED AVAIL REFER MOUNTPOINT > >tank/home/murankar 1.47M 1.59T 1.47M /home/murankar > > > >on a 9-Current amd64 I've got no output for "zfs list /home/murankar" > >and a exit code of 1 > >the output of "zfs list tank/home/murankar" is correct : > >NAME USED AVAIL REFER MOUNTPOINT > >tank/home/murankar 6,56G 286G 6,55G /home/murankar > > Looking at the output here I am hoping that this is not hand typed! the > character ',' appears in this output which might fool a script into doing > other things if it has not been avoided in the first place. This is not hand typed and depends on the locale in use : zfs list tank/home/murankar NAME USED AVAIL REFER MOUNTPOINT tank/home/murankar 6,65G 286G 6,58G /home/murankar setenv LANG en_US.UTF8 zfs list tank/home/murankar NAME USED AVAIL REFER MOUNTPOINT tank/home/murankar 6.65G 286G 6.58G /home/murankar freebsd-snapshot set LC_ALL and LANG to C > > If you have upgraded that machine to 9-CURRENT and have > sysutils/zfsnap installed I would recommend deleting any snapshots > that you have before it runs the snapshot scripts. This assumes that the > snapshot script might have changed since you upgraded it and that the > snapshot names are different. Better to be on the sane side. > > See UPDATING/20100929 for reference. I've deleted all old snapshots before running the snapshot script, but to not avail. > > # Correct syntax: > zfs list pool/dataset1/dataset2 > > # Incorrect syntax: ( I hope you were hand typing that and missed... ) > zfs list /dataset1/dataset2 In fact I was only doing by "hand" what freebsd-snapshot is doing. See op_make() from /usr/local/sbin/snapshot (near line 285) : # operate on filesystem + echo "XXX zfs list $fs_dir" if [ ".$zfs_enabled" = .yes ] && (zfs list $fs_dir) >/dev/null 2>&1; then /usr/local/sbin/snapshot make -g4 /var:test XXX zfs list /var > > > > >Is it the normal behaviour for ZFSv28 or some kind of regression ? > > > > No its not normal, and some sort of regression possible. Though I usually > take regression as performance issues as in speed. > > Also, > > pkg-descr > freebsd-snapshot is a set of convenience front-end tools to mount(8) > and mdconfig(8) for the management of UFS2 snapshots. It is > also the under-lying tool used in the periodic snapshot > scheduler periodic-snapshot(8) and the mounting/unmouning > command in the amd(8) map /usr/local/etc/amd.map.snap. It > provides the making, expiring, visiting, mounting and > unmounting of filesystem snapshots. > > pkg-descr > zfSnap is simple sh script to make rolling zfs snapshots with cron. Main > advantage of zfSnap is that it's written in %100 pure /bin/sh, doesn't > require any additional software to run, and is simple to use. > > zfSnap keeps all information about snapshot in snapshot name. zfs snapshot > names are in form: Time-stamp--TTL where time-stamp is date and time of > snapshot creation and TTL is Time To Live in human readable form. > > > Did you happen to mix the above two up ? If so then rinse and repeat. > > > Good luck, > Nope, freebsd-snapshot can handle ZFS snapshot and it uses to work fine with ZFSv{14,15}, see the copyright notice : FreeBSD UFS/ZFS Snapshot Management Environment, the pkg-descr file seems outdated. Thanks for your help.