6

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?

Edit

The canmount property for these datasets are:

# zfs get -r canmount zroot/usr
NAME                             PROPERTY  VALUE     SOURCE
zroot/usr                        canmount  off       local
zroot/usr/home                   canmount  on        default
zroot/usr/home/username          canmount  on        default
zroot/usr/home/username@--head-- canmount  -         -
ctuffli
  • 302
  • 1
  • 4
  • 11

3 Answers3

3

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.

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
3

You have 'zfs_enable="YES"' in /etc/rc.conf right? This is what mounts all datasets at boot, it basically runs zfs mount -a to mount all ZFS datasets

Allan Jude
  • 1,286
  • 9
  • 13
0

to mount automatically zdata pool run:

zpool set cachefile=/boot/zfs/zpool.cache zdata

It will save currently mounted pools to cache and when reboot import this pool automatically.

Of course, zfs parameter canmount for this pool has to be set to on

zfs set canmount=on zdata
Igor
  • 101
  • 2