11

zpool の状態を degraded に設定している vdev の 1 つでドライブに障害が発生しました: root@mediaserver:~# zpool status pool: zfsraid state: DEGRADED

そこで、ドライブを交換するための手順を開始しました。

これは古いディスクの ID です: wwn-0x5000cca225f459d5 これは交換用ディスクの ID です: wwn-0x5000c5006e38bc61

1) オフラインの古いディスク:

 zpool offline zfsraid wwn-0x5000cca225f459d5

2) 古いディスクを新しいディスクに物理的に交換する

3) 置換コマンドを発行します。

 zpool replace -o ashift=12 zfsraid wwn-0x5000cca225f459d5 wwn-0x5000c5006e38bc61

置換コマンドは次のエラーで失敗します。

root@mediaserver:~# zpool replace -o ashift=12 zfsraid wwn-0x5000cca225f459d5 wwn-0x5000c5006e38bc61
**invalid vdev specification
use '-f' to override the following errors:
/dev/disk/by-id/wwn-0x5000c5006e38bc61 does not contain an EFI label but it may contain partition
information in the MBR.**

参考になる情報が見つからないようです。いくつかのフォーラムで -f オプションを使用するように言われましたが、それは大雑把に思えます。新しいドライブにリストされているパーティションはありません

root@mediaserver:~# fdisk -l /dev/disk/by-id/wwn-0x5000c5006e38bc61

Disk /dev/disk/by-id/wwn-0x5000c5006e38bc61: 3000.6 GB, 3000592982016 bytes
255 heads, 63 sectors/track, 364801 cylinders, total 5860533168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

Disk /dev/disk/by-id/wwn-0x5000c5006e38bc61 doesn't contain a valid partition table
root@mediaserver:~#

新しいドライブを消去するには、コマンドを実行する必要がありますか?

これらは、ドライブに関連する dmesg の最後の数行です。

[420274.400024] scsi 11:0:8:0: Direct-Access     ATA      ST3000DM001-1CH1 CC29 PQ: 0 ANSI: 6
[420274.400036] scsi 11:0:8:0: SATA: handle(0x000f), sas_addr(0x4433221107000000), phy(7), device_name(0x0000000000000000)
[420274.400039] scsi 11:0:8:0: SATA: enclosure_logical_id(0x5000000080000000), slot(4)
[420274.400130] scsi 11:0:8:0: atapi(n), ncq(y), asyn_notify(n), smart(y), fua(y), sw_preserve(y)
[420274.400134] scsi 11:0:8:0: qdepth(32), tagged(1), simple(0), ordered(0), scsi_level(7), cmd_que(1)
[420274.400502] sd 11:0:8:0: Attached scsi generic sg17 type 0
[420274.401375] sd 11:0:8:0: [sdr] 5860533168 512-byte logical blocks: (3.00 TB/2.72 TiB)
[420274.401377] sd 11:0:8:0: [sdr] 4096-byte physical blocks
[420274.475163] sd 11:0:8:0: [sdr] Write Protect is off
[420274.475166] sd 11:0:8:0: [sdr] Mode Sense: 7f 00 10 08
[420274.475966] sd 11:0:8:0: [sdr] Write cache: enabled, read cache: enabled, supports DPO and FUA
[420274.554649]  sdr: unknown partition table
[420274.646245] sd 11:0:8:0: [sdr] Attached SCSI disk

これは私が実行しているubuntuのバージョンです:

Ubuntu 12.04.3 LTS \n \l

root@mediaserver:~# uname -a

Linux mediaserver 3.5.0-44-generic #67~precise1-Ubuntu SMP Wed Nov 13 16:16:57 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
4

3 に答える 3

17

@マット、ここに詳細があります。

TL;DR:

故障したドライブを交換するために新しいドライブを使用できるようにするには、parted

mklabel GPT

拡張ダンス リミックス バージョン:

私はこの正確な問題を抱えていて、今夜解決しました。Linux (0.6.0-1) と 3 x 1TB ドライブで zfs を使用して Debian Squeeze (6.0.10) を使用しています。

root@host:~# zpool status
  pool: dead_pool
 state: DEGRADED
status: One or more devices are faulted in response to persistent errors.
    Sufficient replicas exist for the pool to continue functioning in a
    degraded state.
action: Replace the faulted device, or use 'zpool clear' to mark the device
    repaired.
 scan: resilvered 6.09G in 3h10m with 0 errors on Tue Sep  1 11:15:24 2015
config:

NAME                                    STATE     READ WRITE CKSUM
dead_pool                               DEGRADED     0     0     0
  raidz1-0                              DEGRADED     0     0     0
    scsi-SATA_<orig_device_1>           ONLINE       0     0     0
    scsi-SATA_<orig_device_2>           ONLINE       0     0     0
    scsi-SATA_<orig_device_3>           FAULTED      0     3     0  too many errors

うわぁ。私は今日の午後出かけて、同じサイズ (異なるメーカー/モデル) の新しいドライブを購入し、電源を切って、既存の 3 台の zfs ドライブと一緒にインストールしました。再び電源を入れると、システムの起動時に古いドライブで大量の I/O エラーが発生するのを見ました。恐ろしいもの。

zfs で古いものを新しいものに置き換えるには:

  • 古いディスク ID: 1784233895253655477 (「zdb」を使用して検出)
  • 新しいディスク デバイス: /dev/disk/by-id/scsi-SATA_

    root@host:~# zpool offline dead_pool 1784233895253655477
    root@host:~# zpool replace dead_pool 1784233895253655477 /dev/disk/by-id/scsi-SATA_<new_device_id>
    invalid vdev specification
    use '-f' to override the following errors:
    /dev/disk/by-id/scsi-SATA_<new_device_id> does not contain an EFI label but it may contain partition
    information in the MBR.
    

これは、@Matt の質問の出番です。parted を使用して GPT をセットアップします ( systutorials.comに感謝します):

root@host:~# parted /dev/disk/by-id/scsi-SATA_<new_device_id>
GNU Parted 2.3
Using /dev/sde
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel GPT                                                      
(parted) q                                                                
Information: You may need to update /etc/fstab.  

置換を再試行します。

root@host:~# zpool replace dead_pool 1784233895253655477 /dev/disk/by-id/scsi-SATA_<new_device_id>
root@host:~# 

見事、無事帰還。zpool を再度確認します。

root@host:~# zpool status
  pool: dead_pool
 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 Thu Sep  3 22:31:25 2015
    23.8G scanned out of 690G at 19.7M/s, 9h35m to go
    7.93G resilvered, 3.45% done
config:

    NAME                                    STATE     READ WRITE CKSUM
    dead_pool                               DEGRADED     0     0     0
      raidz1-0                              DEGRADED     0     0     0
        scsi-SATA_<orig_device_1>           ONLINE       0     0     0
        scsi-SATA_<orig_device_2>           ONLINE       0     0     0
        replacing-2                         OFFLINE      0     0     0
          scsi-SATA_<orig_device_3>         OFFLINE      0     0     0
          scsi-SATA_<new_device_id>         ONLINE       0     0     0  (resilvering)

お役に立てれば。

于 2015-09-04T06:08:57.613 に答える
0

交換する前に、ドライブに GPT パーティション テーブルを作成する必要があります。

于 2015-06-21T23:25:31.777 に答える