zfs: the exponential file system from hell
Xin Li
delphij at delphij.net
Tue Oct 1 19:12:55 UTC 2013
On 10/01/13 09:33, Jordan Hubbard wrote:
>
> On Sep 30, 2013, at 4:44 PM, kpneal at 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 <delphij at delphij.net> https://www.delphij.net/
FreeBSD - The Power to Serve! Live free or die
More information about the freebsd-fs
mailing list