ZFS dataset doesn't automatically mount

ctuffli asked:

Running on a FreeBSD 12.0 system, a dataset (my home directory) does not mount automatically at system boot. Manually mounting it (i.e. via zfs mount zroot/usr/home/username) works correctly.

This dataset originally was on a different disk and was moved to its current location via zfs send deskback/backup/usr/home/username | zfs receive -e zroot/usr/home.

Presumably, I could add an entry to /etc/fstab to mount this dataset, but it seems like this shouldn’t be necessary. How can I get ZFS to automatically mount this at boot time?

My answer:

Check that the canmount property is set to on, and not to noauto or off.

If you see this, you have a problem:

# zfs get canmount zroot/usr/home/<username>
NAME                       PROPERTY  VALUE     SOURCE
zroot/usr/home/<username>  canmount  noauto    default

Fix it with:

# zfs set canmount=on zroot/usr/home/<username>

You may also want to check the parent datasets.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.