将闪存设备添加为 ZFS 日志设备或高速缓存设备时请查看以下建议。
可使用 zpool add 命令将 ZFS 日志设备或高速缓存设备添加到现有的 ZFS 存储池。使用 zpool add 命令时请务必小心谨慎。如果将日志设备错误地添加为常规池设备,将会要求您销毁池然后从头开始恢复。可能会从池中删除各个日志设备本身。
在活动存储上尝试执行此操作之前,请熟悉 zpool add 命令。可以使用 zpool add –n 选项预览配置,而不创建此配置。例如,以下错误的 zpool add 预览语法会尝试将某个设备添加为日志设备:
# zpool add -n tank c4t1d0 vdev verification failed: use -f to override the following errors: mismatched replication level: pool uses mirror and new vdev is disk Unable to build pool from specified devices: invalid vdev configuration
以下是用于将某个日志设备添加到现有池的正确 zpool add 预览语法:
# zpool add -n tank log c4t1d0 would update 'tank' to the following configuration: tank mirror c4t0d0 c5t0d0 logs c4t1d0
如果指定了多个设备,它们将条带化到一起。有关更多信息,请参见下面的示例或 zpool(1M)。
闪存设备 c4t1d0 可添加为 ZFS 日志设备:
# zpool add pool log c4t1d0
如果有 2 个闪存设备,您可以添加镜像的日志设备:
# zpool add pool log mirror c4t1d0 c4t2d0
可用的闪存设备可添加为用于进行读取的高速缓存设备。
# zpool add pool cache c4t3d0
您不能镜像高速缓存设备,它们将条带化到一起。
# zpool add pool cache c4t3d0 c4t4d0