Bug 227523 - df regression when on zfs: not all the datasets are shown
Summary: df regression when on zfs: not all the datasets are shown
Status: Closed Not A Bug
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 11.1-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
Keywords: regression
Depends on:
Reported: 2018-04-15 13:01 UTC by emz
Modified: 2018-04-16 07:18 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description emz 2018-04-15 13:01:45 UTC
Notice that /var space isn't showing, however /var is full-fledged dataset, thus it's a filesystem from df's point of view:

[root@db1:/etc]# df -h
Filesystem            Size    Used   Avail Capacity  Mounted on
zroot/ROOT/default    126G    1,2G    124G     1%    /
devfs                 1,0K    1,0K      0B   100%    /dev
zroot/tmp             124G    160K    124G     0%    /tmp
zroot/usr/home        124G    2,1M    124G     0%    /usr/home
zroot/usr/ports       126G    1,7G    124G     1%    /usr/ports
zroot/usr/src         124G     88K    124G     0%    /usr/src
zroot/var/audit       124G     88K    124G     0%    /var/audit
zroot/var/crash       124G     88K    124G     0%    /var/crash
zroot/var/db          125G    136M    124G     0%    /var/db
zroot/var/db/mysql    362G    238G    124G    66%    /var/db/mysql
zroot/var/log         124G    692K    124G     0%    /var/log
zroot/var/mail        124G    332K    124G     0%    /var/mail
zroot/var/tmp         124G     88K    124G     0%    /var/tmp
zroot                 124G     88K    124G     0%    /zroot
zroot/public          173G     48G    124G    28%    /usr/local/public
[root@db1:/etc]# zfs list
zroot                290G   124G    88K  /zroot
zroot/ROOT          1,18G   124G    88K  none
zroot/ROOT/default  1,18G   124G  1,18G  /
zroot/public        48,1G   124G  48,1G  /usr/local/public
zroot/tmp            160K   124G   160K  /tmp
zroot/usr           1,73G   124G    88K  /usr
zroot/usr/home      2,12M   124G  2,12M  /usr/home
zroot/usr/ports     1,73G   124G  1,73G  /usr/ports
zroot/usr/src         88K   124G    88K  /usr/src
zroot/var            239G   124G    88K  /var
zroot/var/audit       88K   124G    88K  /var/audit
zroot/var/crash       88K   124G    88K  /var/crash
zroot/var/db         239G   124G   136M  /var/db
zroot/var/db/mysql   238G   124G   238G  /var/db/mysql
zroot/var/log        692K   124G   692K  /var/log
zroot/var/mail       332K   124G   332K  /var/mail
zroot/var/tmp         88K   124G    88K  /var/tmp
Comment 1 Andriy Gapon freebsd_committer 2018-04-16 05:50:18 UTC
df reports only mounted filesystems.
I am certain that your zroot/var is not mounted.
Comment 2 emz 2018-04-16 06:46:39 UTC
You're right, it is not  mounted indeed.
But then this merely isn't logical: canmount is set to off by basdinstall, and zroot/var does exist, thus  /var in reality appears to be a directory inside zroot/ROOT/default. Concluding: bsdinstall creates the zroot/var dataset, but doesn't mount it and /var is a zroot/ROOT/default directory.

Why ?
Comment 3 Andriy Gapon freebsd_committer 2018-04-16 07:17:37 UTC
I guess it's so that there can be a finer control over what goes to /var directory in a boot environment and what goes to shared datasets created as children of zroot/var.  Also, the children inherit properties from the parent, so that's also a convenience.