From owner-freebsd-fs@FreeBSD.ORG Tue Aug 20 05:25:43 2013 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E6ABA71D; Tue, 20 Aug 2013 05:25:43 +0000 (UTC) (envelope-from kpaasial@gmail.com) Received: from mail-qe0-x235.google.com (mail-qe0-x235.google.com [IPv6:2607:f8b0:400d:c02::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 98A972342; Tue, 20 Aug 2013 05:25:43 +0000 (UTC) Received: by mail-qe0-f53.google.com with SMTP id 1so3132459qee.26 for ; Mon, 19 Aug 2013 22:25:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=2UornrQ/mLFFtry7oLh7L07DJgdUSsrt8FNKRkbLkoc=; b=n5l65aDSVTR8R/piEN/l4kjHgLXjtxrql9WuTuXjtR2OugjyTjKvFRL7mHjoAYTT6t ftSl2nO9ndh/JJ42RUbYhQvRgtzzPG2o/Dtl8MeagGS1aeKd+38kB5TvdW9FqUh9kd5i MhmmIIjACrHmLLWATH0GjRhsoB5N4W8iytkHAzBcBNTQkVTtChf67B3MvrsLy5J9zhpa HngVT2D3noZwQ2Bzv3WNPhR9mkIv1QMnPwSUqVKV4WdI9+KnmOk2fLti+O7xxa6/v8H2 eMgdF3PfK02FJOhvdjV6ElLmYo53GXSU6R14rav/E3jYjzOJ6v++ZTzuwLEXzznJkPRF 67wg== MIME-Version: 1.0 X-Received: by 10.224.163.131 with SMTP id a3mr1703121qay.52.1376976342775; Mon, 19 Aug 2013 22:25:42 -0700 (PDT) Received: by 10.224.5.195 with HTTP; Mon, 19 Aug 2013 22:25:42 -0700 (PDT) In-Reply-To: References: Date: Tue, 20 Aug 2013 08:25:42 +0300 Message-ID: Subject: Re: du which understands ZFS From: Kimmo Paasiala To: aurfalien Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-fs X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 05:25:44 -0000 On Tue, Aug 20, 2013 at 8:18 AM, aurfalien wrote: > > On Aug 19, 2013, at 9:46 PM, Artem Belevich wrote: > >> >> >> >> On Mon, Aug 19, 2013 at 8:51 PM, aurfalien wrote: >> Hi, >> >> Is there a version of du which understands ZFS? >> >> Currently when running du I get this; >> >> I guess you meant 'df'. >> >> Alas, the answer seems to be 'no, there's no ZFS-aware df'. The reason f= or that is that df gets its info via statfs(2) call and the only info it ge= ts back is total number of blocks and available number of blocks. It's assu= med that used space equals total-available. It worked well enough for other= filesystems where it was filesystem that was managing disk space. >> >> ZFS obviously violates this assumption as available space is actually pr= operty of the pool, not of the filesystem, so ZFS has to lie about total si= ze in order to present (arguably more important) amount of used and availab= le space in a consistent way. >> >> --Artem > > Thanks for the reply. > > There is a ZFS aware df in Illumos. I wonder if it would be possible to = port this to FreeBSD? > > Unsure how it works, hell I didn't even know how df worked until you expl= ained, still kinda don't :) > > At any rate, perhaps I'll bring bring this up in the FreeBSD dev list to = see what traction I get. > > - aurf > > How are you going to define the maximum size of particular dataset when it's set to "infinity" by default. The only way I know to get df(1) to show proper numbers is to set a quota for the dataset to limit the maximum size to something lower than the space available in the pool. -Kimmo