Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Apr 2016 12:40:05 -0500
From:      Brandon J. Wandersee <brandon.wandersee@gmail.com>
To:        Aleksander Alekseev <afiskon@devzen.ru>
Cc:        "Dean E. Weimer" <dweimer@dweimer.net>, freebsd-questions@freebsd.org
Subject:   Re: Stupid question regarding ZFS and `df -h` output
Message-ID:  <86a8l1bbwq.fsf@WorkBox.Home>
In-Reply-To: <20160410155756.06c88114@portege>
References:  <20160410150013.4d34a49b@portege> <f86919eb99b7da70ca387ad40ff4a6c6@dweimer.net> <20160410155756.06c88114@portege>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help

Aleksander Alekseev writes:
> $ sudo gpart show
> Password:
> =>       34  250069613  ada0  GPT  (119G)
>          34          6        - free -  (3.0K)
>          40       1024     1  freebsd-boot  (512K)
>        1064        984        - free -  (492K)
>        2048    4194304     2  freebsd-swap  (2.0G)
>     4196352  245872640     3  freebsd-zfs  (117G)
>   250068992        655        - free -  (328K)
>
> $ sudo zpool status
>   pool: zroot
>  state: ONLINE
>   scan: none requested
> config:
>
> 	NAME        STATE     READ WRITE CKSUM
> 	zroot       ONLINE       0     0     0
> 	  ada0p3    ONLINE       0     0     0
>
> errors: No known data errors
> ```
>
> Right, there is a swap partition. But I personally still don't
> understand why ZFS partitions size is 117G and `df` shows weird numbers
> like 95G and 74G. 

`df` will show you the correct amount of consumed and available space on
a ZFS filesystem, but not the correct "size" of a filesystem, because
(unless you've set a quota on a ZFS filesystem) there is no real "size."
ZFS handles space differently than traditional filesystems, and since a
ZFS pool fills the entirety of a disk partition, the "size" output of
`df` doesn't really matter. If it were to display the "size" accurately,
it would still show every "partition" as having the same size, totalling
several times the size of your disk.

The built-in equivalent `zfs list` doesn't even bother listing size,
because it's irrelevant.

-- 

::  Brandon J. Wandersee
::  brandon.wandersee@gmail.com
::  --------------------------------------------------
::  'The best design is as little design as possible.'
::  --- Dieter Rams ----------------------------------



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?86a8l1bbwq.fsf>