ZFS What's the role of /zroot?

When you create a ZFS pool the "top" dataset will get mounted on a directory with the same name as the pool. The /zroot directory is because a zroot pool was created.
 
is there a "canmount" property for pools? if so can you set that to false or set the mountpoint for a pool to none?
I know those properties exist for datasets and setting mountpoint to none makes the dataset not mounted
 
Theoretically, you could configure your system to not mount zroot (so you don't have an empty directory), but I wouldn't recommend it because it's the typical thing nobody does so it can have a lot of unintended consequences.
 
is there a "canmount" property for pools?
Not on the pool itself, but it also creates a "top" level dataset, that does have the canmount, mountpoint etc properties.

Code:
dice@maelcum:~ % zpool list
NAME    SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
zroot   444G   135G   309G        -         -    57%    30%  1.00x    ONLINE  -
dice@maelcum:~ % zfs list zroot
NAME    USED  AVAIL  REFER  MOUNTPOINT
zroot   135G   295G    96K  /zroot
dice@maelcum:~ % zfs list -o canmount,mounted,mountpoint zroot
CANMOUNT  MOUNTED  MOUNTPOINT
on        yes      /zroot
 
Actual root "directory" is the dataset which is mounted to "/". Not the top level dataset of the pool.

Basically nonsense, but if you create dataset
zroot/here/is/where/I/intend/to/mount/root (means, 9th level of datasets hierarchy) and set its mountpoint as "/", it's the root directory, even if there's a dataset zroot/local (means, 2nd level of datasets hierarchy) to be mounted to /usr/local. Just no one would want to try, but theoretically possible.
 
is the name of the ZFS pool name of your system, if in the installer you call it "Annalesa" the will be in /Annalesa
in the OS , selected pool name directory is empty
but when you creat a ZFS dataset manualy not, for example:
Code:
zfs create zroot/test
first is empty, because you dount save any content there of course on /zroot/test
 
In the "traditional" way you have a disk, a disk is typically split up in partitions, and each partition contains a filesystem. The "disk" isn't empty, but one or more of its partitions might be. The size of the partition is static, an 'empty' partition (no files) takes up the same space as a 'full' partition.

With ZFS you don't have a "disk", you have a pool. The pool is split up into datasets and each dataset has filesystem. Think of a dataset as a 'flexible' or 'dynamic' partition, it automatically grows or shrinks depending on the amount of data that's stored in it.
 
Kind of a follow up on my earlier question:
Does the top level dataset of a pool need to be mounted? Does anything break if you set the mountpoint to none or canmount to false?
I've not tried, the empty directory doesn't bother me because I don't spend a lot of time looking at the "/" directory, hence the question.
 
Datasets are datasets, which can "contain" directories, files and links.

A dataset Itself becomes directory once any mountpoints are "assigned".
Without the assignment, dataset is just like a container.

Maybe this concept would be one of the large hurdles to understand ZFS.

Well, as a synonym, dataset is like a blank, unpartitioned and unformatted HDDs.

Datasets can contain another datasets in multiple layer just like partitions including DOS Extended partitions (seen in pre-GPT, legacy MBR partitioning scheme) that can contain child partitions.

Datasets (including child datasets) cannot be accessed as parts of filesystems unless per dataset mountpoints are assigned, just like HDDs/partitions cannot be used as parts of filesystems unless it is formatted with recognizable-to-the-OS filesystem and mounted. Only specific tools like gpart, fdisk or newfs can handle it.
 
The top level dataset of the pool is empty.
It is only empty because when the zroot pool datasets were created by zfs, they were given mountpoints outside the /zroot directory.

So FreeBSD chose a different approach than the "upstream." On Solaris, that's where the boot configuration is:

Code:
# ls -lR /rpool
/rpool:
total 3
drwxr-xr-x 3 root staff 3 2025-10-07 11:06 boot
drwxr-xr-x 2 root staff 3 2025-10-07 11:30 etc

/rpool/boot:
total 2
drwxr-xr-x 3 root staff 6 2026-02-14 13:38 grub

/rpool/boot/grub:
total 59
drwxr-xr-x 2 root staff     3 2025-10-07 11:30 bootsign
-r--r--r-- 1 root staff  1844 2010-11-05 16:02 capability
-rw-r--r-- 1 root staff  1607 2026-01-24 08:17 menu.lst
-rw-r--r-- 1 root staff 52812 2025-10-07 11:30 splash.xpm.gz

/rpool/boot/grub/bootsign:
total 1
-r--r--r-- 1 root staff 0 2025-10-07 11:30 pool_rpool

/rpool/etc:
total 1
-rw-r--r-- 1 root staff 11 2025-10-07 11:30 bootsign
 
Back
Top