Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 May 2010 09:35:58 -0700
From:      Freddie Cash <fjwcash@gmail.com>
To:        FreeBSD Stable <freebsd-stable@freebsd.org>
Subject:   Re: Different sizes between zfs list and zpool list
Message-ID:  <w2qb269bc571005050935ne4eac24fr755019f7699997b4@mail.gmail.com>
In-Reply-To: <p2lb269bc571005050928of3c258a6re8e80aa2262a14ae@mail.gmail.com>
References:  <AANLkTim-yHHl9Neeb40gD3W333foqEIcGYCY2EaorvKg@mail.gmail.com> <l2jb269bc571005050856w86b6f13as54a8778c28dd9099@mail.gmail.com> <AANLkTilN2XiX7ZsqcXIL-UfSCZtdloLkaW5r9_0RYsLV@mail.gmail.com> <p2lb269bc571005050928of3c258a6re8e80aa2262a14ae@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, May 5, 2010 at 9:28 AM, Freddie Cash <fjwcash@gmail.com> wrote:

> On Wed, May 5, 2010 at 9:20 AM, Tom Evans <tevans.uk@googlemail.com>wrote:
>
>> On Wed, May 5, 2010 at 4:56 PM, Freddie Cash <fjwcash@gmail.com> wrote:
>> > On Wed, May 5, 2010 at 8:44 AM, Tom Evans <tevans.uk@googlemail.com>
>> wrote:
>> >
>> >> When looking at the size of a pool, this information can be got from
>> >> both zpool list and zfs list:
>> >>
>> >> > $ zfs list
>> >> NAME                       USED  AVAIL  REFER  MOUNTPOINT
>> >> tank                      5.69T   982G  36.5K  /tank
>> >>
>> >> > $ zpool list
>> >> NAME   SIZE   USED  AVAIL    CAP  HEALTH  ALTROOT
>> >> tank  8.14T  6.86T  1.28T    84%  ONLINE  -
>> >>
>> >> Why the different sizes?
>> >> The pool is a raidz of 6 x 1.5 TB drives.
>> >>
>> >
>> > zpool lists the raw storage available to the pool.  Every single bit of
>> > every single drive is listed here.  This will be 6 x 1 TB.
>> >
>> > zfs lists only the amount of storage available to be used, after all
>> > redundancy is taken into account.  This will be 5 x 1 TB.
>>
>> Ah, that makes sense - also explains why the df output matches up
>> precisely with the zfs list output.
>>
>
> Things get really interesting once you enable compression on a filesystem,
> as then du, df, and zfs list will all be different.  :)
>
> There's a great post on the zfs-discuss mailing list that covers this.
> I'll see if I can dig it up.
>

>From a message by Will Murnane to zfs-discuss (in response to Harry Putnam):

------BEGIN QUOTE------

On Sun, Apr 18, 2010 at 20:08, Harry Putnam <reader@newsguy.com> wrote:
> Seems like you can get some pretty large discrepancies in sizes of
> pools. and directories.

They all answer different things, sure, but they're all things that an
administrator might want to know.

> zpool list
"How many bytes are in use on the storage device?  How many
unallocated bytes are there?"

> zfs list
"If I have to ship this filesystem to another box (uncompressed and
not deduped) how many bytes is that?"

> du
"How many bytes are used to store the contents of the files in this
directory?"

and "ls -l":
"How many bytes are addressable in this file?"

> Do no other administrators feel the
> need to know accurate sizes?

It's important to consider what you want this data for.  Considering
upgrading your storage to get more room?  Check out "zpool list".
Need to know whether accounting or engineering is using more space?
Look at "zfs list".  Looking at a sparse or compressed file, and want
to know how many bytes are allocated to it?  "du" does the trick.
Planning to email someone a file, and want to know if it'll fit in
their 10MB quota?  "ls -l" is the relevant command.

In short, there are many commands because there are many answers, and
many questions.  No single tool has all the information available to
it.

------END QUOTE------

IOW

zpool shows the total bytes of storage available in the pool.

zfs shows the total bytes of storage available to the filesystem, after
redundancy is taken into account.

du shows the total bytes of storage used by a directory, after compression
and dedupe is taken into account.

"ls -l" shows the total bytes of storage currently used to store a file,
after compression, dedupe, thin-provisioning, sparseness, etc.

-- 
Freddie Cash
fjwcash@gmail.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?w2qb269bc571005050935ne4eac24fr755019f7699997b4>