Oracle Solaris ZFS 管理指南

挂载 ZFS 文件系统

创建文件系统或系统引导时,ZFS 会自动挂载文件系统。仅当需要更改挂载选项,或者显式挂载或取消挂载文件系统时,才有必要使用 zfs mount 命令。

不带任何参数的 zfs mount 命令可以显示 ZFS 管理的当前已挂载的所有文件系统。传统管理的挂载点不会显示。例如:


# zfs mount
tank                            /tank
tank/home                       /tank/home
tank/home/bonwick               /tank/home/bonwick
tank/ws                         /tank/ws

可以使用 -a 选项挂载 ZFS 管理的所有文件系统。传统管理的文件系统不会挂载。例如:


# zfs mount -a

缺省情况下,ZFS 不允许在非空目录的顶层进行挂载。要强制在非空目录的顶层挂载,必须使用 -O 选项。例如:


# zfs mount tank/home/lalt
cannot mount '/export/home/lalt': directory is not empty
use legacy mountpoint to allow this behavior, or use the -O flag
# zfs mount -O tank/home/lalt

传统挂载点必须通过传统工具进行管理。尝试使用 ZFS 工具将产生错误。例如:


# zfs mount pool/home/billm
cannot mount 'pool/home/billm': legacy mountpoint
use mount(1M) to mount this filesystem
# mount -F zfs tank/home/billm

文件系统挂载时,将基于与数据集关联的属性值使用一组挂载选项。属性与挂载选项之间的相互关系如下:

表 6–4 ZFS 挂载相关的属性和挂载选项

属性 

挂载选项 

atime

atime/noatime

devices

devices/nodevices

exec

exec/noexec

nbmand

nbmand/nonbmand

readonly

ro/rw

setuid

setuid/nosetuid

xattr

xattr/noaxttr

挂载选项 nosuidnodevices,nosetuid 的别名。