• slider image 168
:::
條列式新聞
新聞載入中,請稍後...

9-2-3-7 更換運作中的裝置

參考出處:https://www.freebsd.org/doc/zh_TW/books/handbook/zfs-zpool.html

以下是原文:

19.3.6. 處理故障裝置

當儲存池中的磁碟故障,該故障硬碟所屬的 vdev 便會進入降級 (Degraded) 狀態,所有的資料仍可使用,但效能可能會降低,因為遺失的資料必須從可用的備援資料計算才能取得。要將 vdev 恢復完整運作的狀態必須更換故障的實體裝置。然後 ZFS 便會開始修復 (Resilver,古代鏡子的修復稱 Resilver) 作業,會從可用的備援資料計算出故障磁碟中的資料並寫入到替換的裝置上。完成後 vdev 便會重新返回上線 (Online) 的狀態。

若 vdev 沒有任何備援資料或有多個裝置故障,沒有足夠的備援資料可以補償,儲存池便會進入故障 (Faulted) 的狀態。

更換故障的磁碟時,故障磁碟的名稱會更換為裝置的 GUID,若替換裝置要使用相同的裝置名稱,則在 zpool replace 不須加上新裝置名稱參數。

使用 zpool replace 更換故障的磁碟:

# zpool status
  pool: mypool
 state: DEGRADED
status: One or more devices could not be opened.  Sufficient replicas exist for
        the pool to continue functioning in a degraded state.
action: Attach the missing device and online it using 'zpool online'.
   see: http://illumos.org/msg/ZFS-8000-2Q
  scan: none requested
config:

        NAME                    STATE     READ WRITE CKSUM
        mypool                  DEGRADED     0     0     0
          mirror-0              DEGRADED     0     0     0
            ada0p3              ONLINE       0     0     0
            316502962686821739  UNAVAIL      0     0     0  was /dev/ada1p3

errors: No known data errors
# zpool replace mypool 316502962686821739 ada2p3
# zpool status
  pool: mypool
 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.
  scan: resilver in progress since Mon Jun  2 14:52:21 2014
        641M scanned out of 781M at 49.3M/s, 0h0m to go
        640M resilvered, 82.04% done
config:

        NAME                        STATE     READ WRITE CKSUM
        mypool                      DEGRADED     0     0     0
          mirror-0                  DEGRADED     0     0     0
            ada0p3                  ONLINE       0     0     0
            replacing-1             UNAVAIL      0     0     0
              15732067398082357289  UNAVAIL      0     0     0  was /dev/ada1p3/old
              ada2p3                ONLINE       0     0     0  (resilvering)

errors: No known data errors
# zpool status
  pool: mypool
 state: ONLINE
  scan: resilvered 781M in 0h0m with 0 errors on Mon Jun  2 14:52:38 2014
config:

        NAME        STATE     READ WRITE CKSUM
        mypool      ONLINE       0     0     0
          mirror-0  ONLINE       0     0     0
            ada0p3  ONLINE       0     0     0
            ada2p3  ONLINE       0     0     0

errors: No known data errors

:::
展開 | 闔起

文章類別

書籍目錄

展開 | 闔起

線上使用者

6人線上 (6人在瀏覽線上書籍)

會員: 0

訪客: 6

更多…