From owner-freebsd-fs@FreeBSD.ORG Tue Oct 1 19:12:55 2013 Return-Path: Delivered-To: freebsd-fs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C44AECE5 for ; Tue, 1 Oct 2013 19:12:55 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [64.62.153.212]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AB1D92106 for ; Tue, 1 Oct 2013 19:12:55 +0000 (UTC) Received: from zeta.ixsystems.com (unknown [69.198.165.132]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by anubis.delphij.net (Postfix) with ESMTPSA id 502F6284C2; Tue, 1 Oct 2013 12:12:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=delphij.net; s=anubis; t=1380654775; bh=Sso/TDLTW/nzAR7egTQCFB8o/b/Xd3vK7ifm8itO4ns=; h=Date:From:Reply-To:To:Subject:References:In-Reply-To; b=KBWMcHlynil9eCUJY9HV/zU0J8nwaqZ00136NAfTVY/R9w3cl+4UdQjKC7TcnFqI5 dYjaQNI/gxuWUxI57GMFWIWPjGTvwu+mSib0B4k05UvefyPSwb65/7PY2HzNcocci1 0CwDrTP6QgogKok6iuAzqvSdnkfRodimfXTT7790= Message-ID: <524B1EB6.2020003@delphij.net> Date: Tue, 01 Oct 2013 12:12:54 -0700 From: Xin Li Organization: The FreeBSD Project MIME-Version: 1.0 To: Jordan Hubbard , freebsd-fs@FreeBSD.org Subject: Re: zfs: the exponential file system from hell References: <52457A32.2090105@fsn.hu> <77F6465C-4E76-4EE9-88B5-238FFB4E0161@sarenet.es> <20130930234401.GA68360@neutralgood.org> In-Reply-To: X-Enigmail-Version: 1.5.2 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: d@delphij.net List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2013 19:12:55 -0000 On 10/01/13 09:33, Jordan Hubbard wrote: > > On Sep 30, 2013, at 4:44 PM, kpneal@pobox.com wrote: > >> Bottom line: The replacement for the 'df' command when using ZFS is >> 'zfs list'. > > Given that we have the sources to df, I guess we should consider the > question begged: Do we want to change it to DTRT for zfs > filesystems? There's no Unix Law™ that says "df(1) must use the > output of statfs(2) directly and can use no longer sources of > information!" > > At the end of the day, df(1) is just a convenient status reporting > tool aimed at human consumption. It could easily reach out to "zfs > list" for the data it prints for zfs volumes if what's reported by > statfs(2) just isn't suitable. I don't think 'zfs list' reports the "right" numbers either: there is no notion of "available shared space between this, this and this file systems". The underlying problem is that it's always hard to represent mutli-dimensional value in a linear manner, to do it, we would need to create something new. I think one of a more preciese way of representing free space on ZFS would be something like this: File system Nominal Free Breakdown tank 25TB 0 + 25TB/2 tank/foo 25.001TB 1G + 25TB/2 Where, the /2 means the space is shared by two consumers. In the above example, we have a pool of 25TB free space and: tank: no reserved space tank/foo: 1G of reserved space. (Note: this is actually oversimplificating, there is refreserve and reserve that has to be handled differently) Personally I don't really like this idea as it makes it too complicated for users to understand. It would be easier to represent the situation in a chart (or a piechart), like: * - tank X - tank/foo O - tank/foo/bar _ - reserved space in tank/foo/bar ! - performance warning limit +---+-------------------+--------------+ +***|XXXXXXXXXXX[OOOO__]| !!!| +---+-------------------+--------------+ And the largest box represents the whole space for a given volume. Cheers, -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die