zfs/raidz1のディスクを交換する(2ヶ月でorz…)

購入したHDDが2ヶ月ほどでお亡くなりに。ディスク自体は保証期間内なので何とかするとして、せっかく組んだzfsで早くもディスク交換を実行することに。手順は次の通り。

  1. ディスクをofflineに変更
  2. シャットダウン後にディスクを取り替える
  3. ディスクをonlineに変更
  4. 同期

状況確認。ada0がREMOVE状態になっている。ソフトウェア上はオンラインだがハードウェア上では「ディスクが外された」状態ということか。

# zpool status
  pool: zpool0
 state: DEGRADED
 scrub: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        zpool0      DEGRADED     0     0     0
          raidz1    DEGRADED     0     0     0
            ada0    REMOVED      0     0     0
            ada1    ONLINE       0     0     0
            ada2    ONLINE       0     0     0
            ada3    ONLINE       0     0     0

errors: No known data errors

ディスクをofflineに変更。ソフトウェアにも「外したよ」と伝える。

# zpool offline zpool0 ada0
# zpool status
  pool: zpool0
 state: DEGRADED
status: One or more devices has been taken offline by the administrator.
        Sufficient replicas exist for the pool to continue functioning in a
        degraded state.
action: Online the device using 'zpool online' or replace the device with
        'zpool replace'.
 scrub: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        zpool0      DEGRADED     0     0     0
          raidz1    DEGRADED     0     0     0
            ada0    OFFLINE      0     0     0
            ada1    ONLINE       0     0     0
            ada2    ONLINE       0     0     0
            ada3    ONLINE       0     0     0

errors: No known data errors

シャットダウン後にディスクを取り替えて状況確認。

# zpool status
  pool: zpool0
 state: DEGRADED
status: One or more devices has been taken offline by the administrator.
        Sufficient replicas exist for the pool to continue functioning in a
        degraded state.
action: Online the device using 'zpool online' or replace the device with
        'zpool replace'.
 scrub: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        zpool0      DEGRADED     0     0     0
          raidz1    DEGRADED     0     0     0
            ada0    OFFLINE      0     0     0
            ada1    ONLINE       0     0     0
            ada2    ONLINE       0     0     0
            ada3    ONLINE       0     0     0

errors: No known data errors

ディスクをonlineに変更。onlineにすること自体は成功するが状況がUNAVAILとなる(これは正常)。

# zpool online zpool0 ada0
warning: device 'ada0' onlined, but remains in faulted state
use 'zpool replace' to replace devices that are no longer present

# zpool status
  pool: zpool0
 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://www.sun.com/msg/ZFS-8000-4J
 scrub: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        zpool0      DEGRADED     0     0     0
          raidz1    DEGRADED     0     0     0
            ada0    UNAVAIL      0     0     0  corrupted data
            ada1    ONLINE       0     0     0
            ada2    ONLINE       0     0     0
            ada3    ONLINE       0     0     0

errors: No known data errors

データのリプレイス。

#zpool replace zpool0 ada0

リプレイスの途中経過。

# zpool status
  pool: zpool0
 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.
 scrub: resilver in progress for 0h0m, 1.04% done, 1h25m to go
config:

        NAME            STATE     READ WRITE CKSUM
        zpool0          DEGRADED     0     0     0
          raidz1        DEGRADED     0     0     0
            replacing   DEGRADED     0     0     0
              ada0/old  UNAVAIL      0     0     0  cannot open
              ada0      ONLINE       0     0     0  1.28G resilvered
            ada1        ONLINE       0     0     0
            ada2        ONLINE       0     0     0
            ada3        ONLINE       0     0     0

errors: No known data errors

1時間21分でで完了です。

# zpool status
  pool: zpool0
 state: ONLINE
 scrub: resilver completed after 1h21m with 0 errors on Tue Nov  1 00:27:20 2011
config:

        NAME        STATE     READ WRITE CKSUM
        zpool0      ONLINE       0     0     0
          raidz1    ONLINE       0     0     0
            ada0    ONLINE       0     0     0  123G resilvered
            ada1    ONLINE       0     0     0
            ada2    ONLINE       0     0     0
            ada3    ONLINE       0     0     0

errors: No known data errors

“zfs/raidz1のディスクを交換する(2ヶ月でorz…)” への2件の返信

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

CAPTCHA