ZFS Understanding ZFS mounting order

Hi folks.

It's just a question: how understand the ZFS mounting order? On a FreeBSD 14.0-RELEASE, here what I get with a df -h:
Code:
Filesystem                         Size    Used   Avail Capacity  Mounted on

zroot/ROOT/default                 201G    733M    200G     0%    /
devfs                              1.0K      0B    1.0K     0%    /dev
zroot/tmp                          200G    112K    200G     0%    /tmp
zroot/home                         202G    2.2G    200G     1%    /home
zroot/var/log                      200G    1.5M    200G     0%    /var/log
zroot/poudriere/data               200G    128K    200G     0%    /poudriere/data
zroot                              200G     96K    200G     0%    /zroot
zroot/usr/src                      200G     96K    200G     0%    /usr/src
zroot/poudriere/ports/default      201G    910M    200G     0%    /poudriere/ports/default
zroot/usr/local                    200G    331M    200G     0%    /usr/local
zroot/poudriere/jails/132Ramd64    202G    1.5G    200G     1%    /poudriere/jails/132Ramd64
zroot/poudriere/jails/140Ramd64    201G    1.3G    200G     1%    /poudriere/jails/140Ramd64
zroot/var/mail                     200G    136K    200G     0%    /var/mail
zroot/var/tmp                      200G    112K    200G     0%    /var/tmp
zroot/poudriere/distfiles          201G    1.3G    200G     1%    /poudriere/distfiles
zroot/usr/local/plexdata           203G    3.0G    200G     1%    /usr/local/plexdata
zroot/poudriere                    200G     96K    200G     0%    /zroot/poudriere
zroot/poudriere/data/packages      201G    1.0G    200G     1%    /poudriere/data/packages
zroot/poudriere/data/logs          200G     47M    200G     0%    /poudriere/data/logs
zroot/poudriere/data/wrkdirs       200G     96K    200G     0%    /poudriere/data/wrkdirs
zroot/poudriere/data/.m            200G     96K    200G     0%    /poudriere/data/.m
zroot/poudriere/data/cache         200G    8.8M    200G     0%    /poudriere/data/cache
zroot/poudriere/data/images        200G     96K    200G     0%    /poudriere/data/images
zroot/poudriere/jails              200G     96K    200G     0%    /zroot/poudriere/jails
zroot/poudriere/ports              200G     96K    200G     0%    /zroot/poudriere/ports

Why the zroot mountpoint isn't on top? Why zroot/poudriere/distfiles appears before zroot/poudriere? Etc... The order is not by hierarchy, and not by alphabetical order.
It's probably a futile and dumb question, it does not affect my system, but I would like to understand. More, there's nothing on my /etc/fstab. Did I miss some information in the handbook?

Thanks a lot.

Regards,
 
What does "zfs list" show you? Some of the traditional commands like "df" work but aren't as accurate as the correct zfs commands.
 
What does "zfs list" show you? Some of the traditional commands like "df" work but aren't as accurate as the correct zfs commands.
Yeah, zfs list shows my datasets in a correct order! I'll use it from now on.
I used df because it was the command of an example from handbook (22.2.1).


df(1) sorts on mountpoint, not mount order.
How the mountpoints are managed with ZFS and df?


Thanks a lot.

Regards,
 
As SirDice says, "df" sorts on mountpoint, so if you look at your df -h output, look at the last column. That is the sort order.
If it wasn't ZFS, the first column would be whatever partition corresponded to that mountpoint.
 
Yes, however, I don't understand how the df -h sorts the last column ("Mounted on"). Ex: /var/mail appears after /var/log, etc... it's not alphabetical, not by hierarchy, etc. My /etc/fstab is empty.

Anyway, it's not important, zfs list shows my datasets in a correct and more logical order!

Regards,
 
Indeed, bad example 😅
There are /poudriere/ports/default or /usr/local between them. I don’t understand how the last column of the df -h is sorted. Everything’s ok with zfs list.
 
Indeed, bad example 😅
There are /poudriere/ports/default or /use/local between them. I don’t understand how the last column of the df -h is sorted. Everything’s ok with zfs list.
I was just going to point this out. I think the only way to figure it out would be to look at the df source and see how it processes ZFS datasets. I wonder if properties like "canmount" play into the df sorting order.
 
Code:
% df -h
Filesystem                                                    Size    Used   Avail Capacity  Mounted on
august/ROOT/n266797-0a958aa16fed-b                            134G     64G     70G    47%    /
devfs                                                         1.0K      0B    1.0K     0%    /dev
tmpfs                                                          17G     11M     17G     0%    /tmp
fdescfs                                                       1.0K      0B    1.0K     0%    /dev/fd
procfs                                                        8.0K      0B    8.0K     0%    /proc
august/var/log                                                 70G     28M     70G     0%    /var/log
august/var/audit                                               70G     88K     70G     0%    /var/audit
august/vm-bhyve                                                70G    116K     70G     0%    /vm-bhyve
august/VirtualBox                                              78G    7.1G     70G     9%    /usr/local/VirtualBox
august/usr/src                                                 74G    3.6G     70G     5%    /usr/src
august/var/mail                                                70G    272K     70G     0%    /var/mail
august/var/crash                                               76G    5.9G     70G     8%    /var/crash
august/iocage                                                  70G    104K     70G     0%    /iocage
august/jails                                                   70G    104K     70G     0%    /jails
august/var/tmp                                                 70G    4.1M     70G     0%    /var/tmp
august/iocage/templates                                        70G     88K     70G     0%    /iocage/templates
august/iocage/jails                                            70G     88K     70G     0%    /iocage/jails
august/iocage/log                                              70G    100K     70G     0%    /iocage/log
august/iocage/releases                                         70G     88K     70G     0%    /iocage/releases
august/iocage/jails/jbrowsers                                  70G     92K     70G     0%    /iocage/jails/jbrowsers
august/iocage/images                                           70G     88K     70G     0%    /iocage/images
august/iocage/releases/12.0-RELEASE                            70G     88K     70G     0%    /iocage/releases/12.0-RELEASE
august/iocage/download                                         70G     88K     70G     0%    /iocage/download
august/iocage/download/12.0-RELEASE                            71G    359M     70G     0%    /iocage/download/12.0-RELEASE
august/usr/ports                                               88G     18G     70G    20%    /usr/ports
august/poudriere                                               70G     96K     70G     0%    /usr/local/poudriere
august/jails/13                                                71G    506M     70G     1%    /jails/thirteen
august/iocage/releases/12.0-RELEASE/root                       71G    901M     70G     1%    /iocage/releases/12.0-RELEASE/root
august/iocage/jails/jbrowsers/root                             74G    3.2G     70G     4%    /iocage/jails/jbrowsers/root
august/poudriere/ports                                         70G     88K     70G     0%    /usr/local/poudriere/ports
august/poudriere/data                                          70G     96K     70G     0%    /usr/local/poudriere/data
august/poudriere/jails                                         70G     88K     70G     0%    /usr/local/poudriere/jails
august/jails/12                                                71G    441M     70G     1%    /jails/twelve
august/poudriere/data/wrkdirs                                  70G     88K     70G     0%    /usr/local/poudriere/data/wrkdirs
august/poudriere/data/cache                                    70G    5.6M     70G     0%    /usr/local/poudriere/data/cache
august/poudriere/ports/portoverlay                             70G    5.0M     70G     0%    /usr/local/poudriere/ports/portoverlay
august/poudriere/data/packages                                 72G    2.1G     70G     3%    /usr/local/poudriere/data/packages
august/poudriere/data/.m                                       70G     96K     70G     0%    /usr/local/poudriere/data/.m
august/poudriere/jails/main                                    72G    1.7G     70G     2%    /usr/local/poudriere/jails/main
august/poudriere/ports/default                                 72G    1.2G     70G     2%    /usr/local/poudriere/ports/default
august/poudriere/data/logs                                     71G    231M     70G     0%    /usr/local/poudriere/data/logs
august/usr/home                                               236G    166G     70G    70%    /usr/home
linprocfs                                                     8.0K      0B    8.0K     0%    /compat/linux/proc
linsysfs                                                      8.0K      0B    8.0K     0%    /compat/linux/sys
devfs                                                         1.0K      0B    1.0K     0%    /compat/linux/dev
fdescfs                                                       1.0K      0B    1.0K     0%    /compat/linux/dev/fd
tmpfs                                                          17G    4.0K     17G     0%    /compat/linux/dev/shm
Transcend                                                     150G     18G    132G    12%    /media/t1000
Transcend/VirtualBox                                          811G    679G    132G    84%    /media/t1000/VirtualBox
august/poudriere/jails/main-default-ref                        72G    1.7G     70G     2%    /usr/local/poudriere/data/.m/main-default/ref
/usr/local/poudriere/jails/main/rescue                         72G    1.7G     70G     2%    /usr/local/poudriere/data/.m/main-default/ref/rescue
/usr/local/poudriere/jails/main/usr/lib32                      72G    1.7G     70G     2%    /usr/local/poudriere/data/.m/main-default/ref/usr/lib32
/usr/local/poudriere/jails/main/usr/share                      72G    1.7G     70G     2%    /usr/local/poudriere/data/.m/main-default/ref/usr/share
/usr/local/poudriere/jails/main/usr/tests                      72G    1.7G     70G     2%    /usr/local/poudriere/data/.m/main-default/ref/usr/tests
/usr/local/poudriere/jails/main/usr/src                        72G    1.7G     70G     2%    /usr/local/poudriere/data/.m/main-default/ref/usr/src
devfs                                                         1.0K      0B    1.0K     0%    /usr/local/poudriere/data/.m/main-default/ref/dev
fdescfs                                                       1.0K      0B    1.0K     0%    /usr/local/poudriere/data/.m/main-default/ref/dev/fd
procfs                                                        8.0K      0B    8.0K     0%    /usr/local/poudriere/data/.m/main-default/ref/proc
linprocfs                                                     8.0K      0B    8.0K     0%    /usr/local/poudriere/data/.m/main-default/ref/compat/linux/proc
tmpfs                                                         1.0G     37M    987M     4%    /usr/local/poudriere/data/.m/main-default/ref/.p
/usr/.ccache                                                  134G     64G     70G    47%    /usr/local/poudriere/data/.m/main-default/ref/root/.ccache
tmpfs                                                          17G    4.0K     17G     0%    /usr/local/poudriere/data/.m/main-default/ref/wrkdirs
/usr/local/poudriere/ports/default                             72G    1.2G     70G     2%    /usr/local/poudriere/data/.m/main-default/ref/usr/ports
/usr/local/poudriere/data/packages/main-default/.building      72G    2.1G     70G     3%    /usr/local/poudriere/data/.m/main-default/ref/packages
/usr/ports/distfiles                                           88G     18G     70G    20%    /usr/local/poudriere/data/.m/main-default/ref/distfiles
tmpfs                                                          17G    4.0K     17G     0%    /usr/local/poudriere/data/.m/main-default/ref/var/db/ports
august/poudriere/jails/main-default-ref/01                     73G    2.7G     70G     4%    /usr/local/poudriere/data/.m/main-default/01
august/poudriere/jails/main-default-ref/02                     72G    2.0G     70G     3%    /usr/local/poudriere/data/.m/main-default/02
/usr/local/poudriere/data/.m/main-default/ref/rescue           72G    1.7G     70G     2%    /usr/local/poudriere/data/.m/main-default/02/rescue
/usr/local/poudriere/data/.m/main-default/ref/usr/lib32        72G    1.7G     70G     2%    /usr/local/poudriere/data/.m/main-default/02/usr/lib32
/usr/local/poudriere/data/.m/main-default/ref/usr/share        72G    1.7G     70G     2%    /usr/local/poudriere/data/.m/main-default/02/usr/share
/usr/local/poudriere/data/.m/main-default/ref/usr/tests        72G    1.7G     70G     2%    /usr/local/poudriere/data/.m/main-default/02/usr/tests
/usr/local/poudriere/data/.m/main-default/ref/usr/src          72G    1.7G     70G     2%    /usr/local/poudriere/data/.m/main-default/02/usr/src
devfs                                                         1.0K      0B    1.0K     0%    /usr/local/poudriere/data/.m/main-default/02/dev
fdescfs                                                       1.0K      0B    1.0K     0%    /usr/local/poudriere/data/.m/main-default/02/dev/fd
procfs                                                        8.0K      0B    8.0K     0%    /usr/local/poudriere/data/.m/main-default/02/proc
linprocfs                                                     8.0K      0B    8.0K     0%    /usr/local/poudriere/data/.m/main-default/02/compat/linux/proc
tmpfs                                                         1.0G    4.0K    1.0G     0%    /usr/local/poudriere/data/.m/main-default/02/.p
/usr/.ccache                                                  134G     64G     70G    47%    /usr/local/poudriere/data/.m/main-default/02/root/.ccache
tmpfs                                                          18G    629M     17G     3%    /usr/local/poudriere/data/.m/main-default/02/wrkdirs
/usr/local/poudriere/ports/default                             72G    1.2G     70G     2%    /usr/local/poudriere/data/.m/main-default/02/usr/ports
/usr/local/poudriere/data/packages/main-default/.building      72G    2.1G     70G     3%    /usr/local/poudriere/data/.m/main-default/02/packages
/usr/ports/distfiles                                           88G     18G     70G    20%    /usr/local/poudriere/data/.m/main-default/02/distfiles
/usr/local/poudriere/data/.m/main-default/ref/var/db/ports     17G    4.0K     17G     0%    /usr/local/poudriere/data/.m/main-default/02/var/db/ports
/usr/local/poudriere/data/.m/main-default/ref/rescue           72G    1.7G     70G     2%    /usr/local/poudriere/data/.m/main-default/01/rescue
/usr/local/poudriere/data/.m/main-default/ref/usr/lib32        72G    1.7G     70G     2%    /usr/local/poudriere/data/.m/main-default/01/usr/lib32
/usr/local/poudriere/data/.m/main-default/ref/usr/share        72G    1.7G     70G     2%    /usr/local/poudriere/data/.m/main-default/01/usr/share
/usr/local/poudriere/data/.m/main-default/ref/usr/tests        72G    1.7G     70G     2%    /usr/local/poudriere/data/.m/main-default/01/usr/tests
/usr/local/poudriere/data/.m/main-default/ref/usr/src          72G    1.7G     70G     2%    /usr/local/poudriere/data/.m/main-default/01/usr/src
devfs                                                         1.0K      0B    1.0K     0%    /usr/local/poudriere/data/.m/main-default/01/dev
fdescfs                                                       1.0K      0B    1.0K     0%    /usr/local/poudriere/data/.m/main-default/01/dev/fd
procfs                                                        8.0K      0B    8.0K     0%    /usr/local/poudriere/data/.m/main-default/01/proc
linprocfs                                                     8.0K      0B    8.0K     0%    /usr/local/poudriere/data/.m/main-default/01/compat/linux/proc
tmpfs                                                         1.0G    8.0K    1.0G     0%    /usr/local/poudriere/data/.m/main-default/01/.p
/usr/.ccache                                                  134G     64G     70G    47%    /usr/local/poudriere/data/.m/main-default/01/root/.ccache
tmpfs                                                          18G    531M     17G     3%    /usr/local/poudriere/data/.m/main-default/01/wrkdirs
/usr/local/poudriere/ports/default                             72G    1.2G     70G     2%    /usr/local/poudriere/data/.m/main-default/01/usr/ports
/usr/local/poudriere/data/packages/main-default/.building      72G    2.1G     70G     3%    /usr/local/poudriere/data/.m/main-default/01/packages
/usr/ports/distfiles                                           88G     18G     70G    20%    /usr/local/poudriere/data/.m/main-default/01/distfiles
/usr/local/poudriere/data/.m/main-default/ref/var/db/ports     17G    4.0K     17G     0%    /usr/local/poudriere/data/.m/main-default/01/var/db/ports
%

Transcend is the pool that I imported after I got home from work.
 
Back
Top