I have a 2-drive ZFS mirror pool on Ubuntu. The drives for the pool were at /dev/sda and /dev/sdb. For various reasons, I had to physically move the drive at /dev/sda to a different slot in my server, so Ubuntu now recognizes it as being at /dev/sdc. It seems that, because of this, the zfs pool no longer recognizes that drive and hence marks my pool as degraded. zpool status -x
yields
pool: data
state: DEGRADED
status: One or more devices could not be used because the label is
missing or invalid. Sufficient replicas exist for the pool
to continue functioning in a degraded state.
action: Replace the device using 'zpool replace'.
see: http://zfsonlinux.org/msg/ZFS-8000-4J
scan: scrub repaired 0 in 12h56m with 0 errors on Sun Apr 9
13:20:15 2017
config:
NAME STATE READ WRITE CKSUM
data DEGRADED 0 0 0
mirror-0 DEGRADED 0 0 0
9406053825076090209 UNAVAIL 0 0 0 was /dev/sda1
sdb ONLINE 0 0 0
I tried running some commands I found online involving zpool replace
, but it seems to complain when I do this because it sees that /dev/sdc
(/dev/sdc1
) is a ZFS disk (partition).
Ideally I'd like to just tell ZFS that the missing drive is at /dev/sdc
-- that should get my pool back to a pristine state. Another idea might be to tell Linux to swap the labels /dev/sda
and /dev/sdc
-- don't know if that's a crazy idea or not. Worst case, maybe there is some zpool replace
command that more or less wipes what's on /dev/sdc
and rebuilds the mirror on that disk from scratch. Would really appreciate any advice on what's possible/recommend -- thanks!!