2

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!!

davewy
  • 165
  • 9

1 Answers1

1

It's important to use /dev/disk-by-id/ names instead of RAW SCSI names because something as simple as a USB disk insertion could cause the devices to be renamed.

Please see: Why did rebooting cause one side of my ZFS mirror to become UNAVAIL?

You may be able to zpool export data followed by zpool import data.


I'm also concerned there's an sda1. You should not have partitions when the other side of the mirror is /dev/sdb.

user
  • 4,267
  • 4
  • 32
  • 70
ewwhite
  • 194,921
  • 91
  • 434
  • 799