# mount
/dev/ad0s1a on / (ufs, local)
devfs on /dev (devfs, local)
/dev/ad0s1d on /usr (ufs, local, soft-updates)
example on /example (zfs, local)
example/compressed on /example/compressed (zfs, local)
创建 ZFS 数据集后,可以像任何文件系统一样使用。在需要时,可以为每个数据集设置其他可用功能。下面的示例创建一个名为 data 的新文件系统。它假定文件系统包含重要文件,并配置其以存储每个数据块的两份副本。
# zfs create example/data
# zfs set copies=2 example/data
每个软件 RAID 都有一种监视其 state 的方法。使用以下命令查看 RAID-Z 设备的状态:
# zpool status -x
如果所有池都是在线的,一切正常,消息将显示:
all pools are healthy
如果出现问题,也许是因为某个磁盘处于离线状态,池的状态看起来会是这样的:
pool: storage
state: DEGRADED
status: One or more devices has been taken offline by the administrator.
Sufficient replicas exist for the pool to continue functioning in a
degraded state.
action: Online the device using 'zpool online' or replace the device with
'zpool replace'.
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
storage DEGRADED 0 0 0
raidz1 DEGRADED 0 0 0
da0 ONLINE 0 0 0
da1 OFFLINE 0 0 0
da2 ONLINE 0 0 0
errors: No known data errors
"OFFLINE" 显示管理员使用 da1 下线:
# zpool offline storage da1
立即关闭计算机并更换 da1。打开计算机并将 da1 返回到池中:
# zpool replace storage da1
接下来,再次检查状态,这次不使用 -x 来显示所有池:
# zpool status storage
pool: storage
state: ONLINE
scrub: resilver completed with 0 errors on Sat Aug 30 19:44:11 2008
config:
NAME STATE READ WRITE CKSUM
storage ONLINE 0 0 0
raidz1 ONLINE 0 0 0
da0 ONLINE 0 0 0
da1 ONLINE 0 0 0
da2 ONLINE 0 0 0
errors: No known data errors