【发布时间】:2017-03-30 11:35:16
【问题描述】:
我有一台运行 FreeBSD 的 HP microserver gen8,带有镜像启动媒体:一个 USB 记忆棒 (16GB) 和一个 microSD 卡 (16GB)。棒子最近显示校验和错误,所以我更换了它,但我手头只有一个 32GB 的棒子。重新同步后,zpool 似乎很满意,但我无法编写引导代码,gpart 甚至无法识别媒体。
详细。
这是出现问题时的 zpool 状态:
Checking status of zfs pools:
NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
freenas-boot 14.5G 791M 13.7G - - 5% 1.00x ONLINE -
freising 928G 84.6G 843G - 6% 9% 1.00x ONLINE /mnt
pool: freenas-boot
state: ONLINE
status: One or more devices has experienced an unrecoverable error. An
attempt was made to correct the error. Applications are unaffected.
action: Determine if the device needs to be replaced, and clear the errors
using 'zpool clear' or replace the device with 'zpool replace'.
see: http://illumos.org/msg/ZFS-8000-9P
scan: scrub repaired 213K in 0h15m with 0 errors on Thu Mar 23 04:00:56 2017
config:
NAME STATE READ WRITE CKSUM
freenas-boot ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
da0p2 ONLINE 0 0 3
da1p2 ONLINE 0 0 0
errors: No known data errors
我关闭了机器电源,用 32GB 替换了记忆棒,然后重新启动。 zpool 状态产生:
NAME STATE READ WRITE CKSUM
freenas-boot DEGRADED 0 0 0
mirror-0 DEGRADED 0 0 0
3278622582862864884 UNAVAIL 0 0 0 was /dev/da0p2
da1p2 ONLINE 0 0 0
好的,所以我告诉 zpool 使用新媒体:
sudo zpool replace freenas-boot 3278622582862864884 /dev/da0
(zpool 不允许我使用 '/dev/da0p2')
重新同步这个东西花了大约 8 个小时,现在 zpool 似乎很高兴:
sudo zpool status -xv
all pools are healthy
但我无法编写引导代码:
sudo gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 da0
gpart: No such geom: da0.
gpart 甚至连新棍子都认不出来:
sudo gpart status
Name Status Components
ada0p1 OK ada0
ada0p2 OK ada0
ada1p1 OK ada1
ada1p2 OK ada1
da1p1 OK da1
da1p2 OK da1
最好的方法是什么?我很不确定我应该通过 gpart 控制什么,什么最好留给 zfs 及其魔力。
【问题讨论】: