rationale for default ZFS datasets: /usr /var and /tmp

From: Graham Perrin <grahamperrin_at_freebsd.org>
Date: Sun, 17 Jul 2022 16:54:56 UTC
On 17/07/2022 17:28, Taceant Omnes wrote:


> …
>
> /var and /usr both merit a dataset of their own, and under them there
> are a few other nested datasets. What is not clear to me is why only
> these particular folders merit their own datasets, likewise with /tmp.
> …


For /usr I chose to have an aggressive level of compression, one that's 
not appropriate for /usr/home:

% zfs get compression,compressratio august/usr august/usr/home
NAME             PROPERTY       VALUE           SOURCE
august/usr       compression    zstd-19         received
august/usr       compressratio  1.30x           -
august/usr/home  compression    zstd-15         received
august/usr/home  compressratio  1.31x           -
%

That's just one example. Someone with a less powerful computer might 
find zstd-15 excessive for home directories, and so on.

Not just compression. People will find other benefits to having 
/usr/home separate from /usr.

Having /tmp as a separate dataset makes it easy for a person to choose 
tmpfs instead of zfs, for example:

% zfs get canmount august/tmp
NAME        PROPERTY  VALUE     SOURCE
august/tmp  canmount  off       received
% grep tmpfs /etc/fstab
# tmpfs         /compat/linux/dev/shm   tmpfs      rw,mode=1777 
               0     0
tmpfs           /tmp                    tmpfs      rw,mode=01777 
              0     0
# tmpfs         /compat/ubuntu/dev/shm  tmpfs 
      rw,late,size=1g,mode=1777  0     0
%