Mounting ZFS File Systems

ZFS automatically mounts file systems when file systems are created or when the system boots. Use of the zfs mount command is necessary only when you need to change mount options, or explicitly mount or unmount file systems.

The zfs mount command with no arguments shows all currently mounted file systems that are managed by ZFS. Legacy managed mount points are not displayed. For example:

$ zfs mount | grep tank/home
zfs mount | grep tank/home
tank/home                       /tank/home
tank/home/sueb                  /tank/home/sueb

You can use the -a option to mount all ZFS managed file systems. Legacy managed file systems are not mounted. For example:

$ zfs mount -a

By default, ZFS does not allow mounting on top of a nonempty directory. For example:

$ zfs mount tank/home/glori
cannot mount 'tank/home/glori': filesystem already mounted

Legacy mount points must be managed through legacy tools. An attempt to use ZFS tools results in an error. For example:

$ zfs mount tank/home/bhall
cannot mount 'tank/home/bhall': legacy mountpoint
use mount(8) to mount this filesystem
$ mount -F zfs tank/home/bhallm

When a file system is mounted, it uses a set of mount options based on the property values associated with the file system. The correlation between ZFS properties and mount options is as follows:

atime

atime/noatime

devices

devices/nodevices

exec

exec/noexec

nbmand

nbmand/nonbmand

readonly

ro/rw

setuid

setuid/nosetuid

xattr

xattr/noaxttr

The mount option nosuid is an alias for nodevices,nosetuid.

You can use the NFSv4 mirror mount features to help you better manage NFS-mounted ZFS home directories.

When file systems are created on the NFS server, the NFS client can automatically discover these newly created file systems within their existing mount of a parent file system.

For example, if the server neo already shares the tank file system and client zee has it mounted, /tank/baz is automatically visible on the client after it is created on the server.

zee$ mount neo:/tank /mnt
zee$ ls /mnt
baa    bar

neo$ zfs create tank/baz

zee% ls /mnt
baa    bar    baz
zee% ls /mnt/baz
file1    file2