我想通过发出以下命令来replace我的zpool中的磁盘:
zpool replace -o ashift=12 pool /dev/mapper/transport /dev/mapper/data2
ZFS开始工作,并重新调整了池。 在这个过程中,旧磁盘上出现了一些读取错误,并在完成之后, zpool status -v如下所示:
pool: pool state: ONLINE status: One or more devices has experienced an error resulting in data corruption. Applications may be affected. action: Restore the file in question if possible. Otherwise restore the entire pool from backup. see: http://zfsonlinux.org/msg/ZFS-8000-8A scan: resilvered 6,30T in 147h38m with 6929 errors on Sat Feb 11 13:31:05 2017 config: NAME STATE READ WRITE CKSUM pool ONLINE 0 0 16,0K raidz1-0 ONLINE 0 0 32,0K data1 ONLINE 0 0 0 replacing-1 ONLINE 0 0 0 transport ONLINE 14,5K 0 0 data2 ONLINE 0 0 0 data3 ONLINE 0 0 0 logs data-slog ONLINE 0 0 0 cache data-cache ONLINE 0 0 0 errors: Permanent errors have been detected in the following files: <list of 3 files>
我希望老磁盘从池中分离出来,但事实并非如此。 我试图手动分离它:
# zpool detach pool /dev/mapper/transport cannot detach /dev/mapper/transport: no valid replicas
但是,当我导出池,删除旧的驱动器,并再次导入池,它似乎完美地工作:它重新开始重新同步,但它是降解,而不是失败:
pool: pool state: DEGRADED status: One or more devices is currently being resilvered. The pool will continue to function, possibly in a degraded state. action: Wait for the resilver to complete. scan: resilver in progress since Sat Feb 11 17:28:50 2017 42,7G scanned out of 9,94T at 104M/s, 27h43m to go 1,68G resilvered, 0,42% done config: NAME STATE READ WRITE CKSUM pool DEGRADED 0 0 9 raidz1-0 DEGRADED 0 0 18 data1 ONLINE 0 0 0 replacing-1 DEGRADED 0 0 0 15119075650261564517 UNAVAIL 0 0 0 was /dev/mapper/transport data2 ONLINE 0 0 0 (resilvering) data3 ONLINE 0 0 0 (resilvering) logs data-slog ONLINE 0 0 0 cache data-cache ONLINE 0 0 0 errors: Permanent errors have been detected in the following files: <list of 3 files>
尽pipe游泳池的全部function显然不是必须的,但我不能拆卸旧的驱动器:
# zpool offline pool 15119075650261564517 cannot offline 15119075650261564517: no valid replicas
到底是怎么回事?
更新:显然,ZoL还没有放弃那些失败的设备。 replace3个永久性错误的文件(其中之一是zvol,这意味着我必须创build另一个dd conv=noerror ,对内容进行dd conv=noerror ,并销毁旧的文件),并让最终重新启动,最终移除旧的驱动器。
我还是对ZoL的想法感兴趣。 我的意思是,所有不会导致读取或校验和错误的内容都被复制到新设备上,并且已经标记导致错误的扇区永久失败。 那么为什么要挂在ZoL显然不想再获取任何信息的旧设备上呢?