大网数据广告活动
服务器运维问答

ZFS Ubuntu - Physically moved drive and no longer recognized by pool

· 52CE 我爱测

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 …

问题原文

原帖链接 · davewy · CC BY-SA 3.0

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

已采纳解答

原帖链接 · ewwhite · CC BY-SA 3.0

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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-04-27)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。