du which understands ZFS

aurfalien aurfalien at gmail.com
Tue Aug 20 17:48:51 UTC 2013


On Aug 20, 2013, at 10:19 AM, Darren Pilgrim wrote:

> On 8/20/2013 12:54 PM, kpneal at pobox.com wrote:
>> On Tue, Aug 20, 2013 at 10:01:48AM -0400, gtodd at bellanet.org wrote:
>>> 
>>> On Tue, 20 Aug 2013, Mark Felder wrote:
>>>> On Mon, Aug 19, 2013, at 22:51, aurfalien wrote:
>>>>> Hi,
>>>>> 
>>>>> Is there a version of du which understands ZFS?
>>>>> 
>>>>> Currently when running du I get this;
>>>>> 
>>>>> Filesystem             Size    Used   Avail Capacity Mounted on
>>>>> abyss                  51T     50k      51T     0%   /abyss
>>>>> abyss/PROJECT          72T     20T      51T    29%   /abyss/PROJECTS
>>>>> abyss/PROJECTX         54T    2.6T      51T     5%   /abyss/PROJECTSX
>>>>> 
>>>>> The zpool of abyss is 75TB in size.
>>>>> 
>>>> And do you want df to be aware of compression and deduplication, too? I
>>>> don't think this will show up in FreeBSD's df. Use the tools that ZFS
>>>> provides and you'll never get any unexpected surprises.
>>> 
>>> I think if there were to be a "zfs aware" df it would show filesystem
>>> statistics for ufs and other "traditional" filesystems, but if/when it
>>> detected zfs it would output something like:
>>> 
>>> "ZFS - free disk space does not apply" :-)
>> 
>> Well, except that that isn't really accurate. It looks like a df of
>> zfs shows a size of used+avail. You'll see something similar if you
>> NFS mount an exported filesystem.
>> 
>>> or maybe some more helpful message about using zpool(1) zfs(1) etc.
>> 
>> How about a short blurb along the lines of:
>> "The results from df are approximations that do not take into account
>> features supported by some filesystems like compression or deduplication.
>> Please refer to your filesystems documentation for filesystem-specific
>> details."
>> 
>> Perhaps throw in something about filesystem-specific metadata also
>> throwing off the numbers. This is true for UFS as well if indirect
>> blocks are needed, correct?
> 
> UFS with softupdates also has the fun side-effect of it being possible to have negative free space. :)
> 
> df is a nice tool to give rough approximations of usage, but is far too high level to provide the kind of reporting OP wants.  ZFS's own tools must be used for that.

Agreed.  Still getting used to the toolset involved with managing ZFS.


>  If we made df ZFS aware, we'd open the door to make it SMB, NFS, soft-updates, and FUSE aware.  Personally, I'd rather not have the lumbering monstrosity that would be such a df.
> 
> P.S. I'd like to offer this bit of humour:
> 
> Excerpt from `df -ciH`
> Filesystem Size Used Avail Capacity iused ifree %iused
> tank       807G  38k  807G     0%       7  1.6G    0%
> total      260T 1.1T  259T     0%    1.4M  505G    0%
> 
> A quarter petabyte and a half a trillion inodes.  Pretty impressive for a RAID-Z2 of four 1 TB disks. ;)

Thats not only funny, but awesome that you got that much space from 4x1TB disks.

What brand are these disks so I can get some before the vendor finds out :)

- aurf


More information about the freebsd-fs mailing list