1 頁 (共 1 頁)

zpool 更換壞硬碟

發表於 : 2018-03-13 20:15:35
yehlu
https://askubuntu.com/questions/305830/ ... in-a-zpool

代碼: 選擇全部

root@pveh:~# zpool status
  pool: pvehzpool
 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 0B in 2h14m with 0 errors on Sun Feb 11 02:38:12 2018
config:

        NAME                        STATE     READ WRITE CKSUM
        pvehzpool                   DEGRADED     0     0     0
          raidz1-0                  DEGRADED     0     0     0
            wwn-0x50014ee6b04a3b69  ONLINE       0     0     0
            7798210659245819828     UNAVAIL      0     0     0  was /dev/sdb1
            wwn-0x50014ee25ae88a3a  ONLINE       0     0     0
            wwn-0x50014ee20dea354b  ONLINE       0     0     0

errors: No known data errors

zpool offline pvehzpool 7798210659245819828

root@pveh:~# ls  /dev/disk/by-id/ata-WDC_WD20E*
ata-WDC_WD20EARS-00MVWB0_WD-WCAZA4761616
ata-WDC_WD20EARS-00MVWB0_WD-WCAZA4761616-part1
ata-WDC_WD20EARS-00MVWB0_WD-WCAZA4761616-part9
ata-WDC_WD20EFRX-68EUZN0_WD-WCC4M1KVEY2F
ata-WDC_WD20EFRX-68EUZN0_WD-WCC4M1KVEY2F-part1
ata-WDC_WD20EFRX-68EUZN0_WD-WCC4M1KVEY2F-part9
ata-WDC_WD20EZRX-00D8PB0_WD-WMC4N0K2KNC8
ata-WDC_WD20EZRX-00D8PB0_WD-WMC4N0K2KNC8-part1
ata-WDC_WD20EZRX-00D8PB0_WD-WMC4N0K2KNC8-part9
[b][u]ata-WDC_WD20EZRZ-00Z5HB0_WD-WCC4M2AHF5PA[/u][/b]

zpool replace pvehzpool 7798210659245819828 /dev/disk/by-id/ata-WDC_WD20EZRZ-00Z5HB0_WD-WCC4M2AHF5PA
root@pveh:~# zpool status
  pool: pvehzpool
 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 Tue Mar 13 20:11:33 2018
        39.2M scanned out of 506G at 2.61M/s, 55h2m to go
        9.48M resilvered, 0.01% done
config:

        NAME                                            STATE     READ WRITE CKSUM
        pvehzpool                                       DEGRADED     0     0     0
          raidz1-0                                      DEGRADED     0     0     0
            wwn-0x50014ee6b04a3b69                      ONLINE       0     0     0
            replacing-1                                 DEGRADED     0     0     0
              7798210659245819828                       OFFLINE      0     0     0  was /dev/sdb1
              ata-WDC_WD20EZRZ-00Z5HB0_WD-WCC4M2AHF5PA  ONLINE       0     0     0  (resilvering)
            wwn-0x50014ee25ae88a3a                      ONLINE       0     0     0
            wwn-0x50014ee20dea354b                      ONLINE       0     0     0

errors: No known data errors

Re: zpool 更換壞硬碟

發表於 : 2018-03-13 22:09:27
yehlu

代碼: 選擇全部

root@pveh:~# zpool status
  pool: pvehzpool
 state: ONLINE
  scan: resilvered 66.0G in 1h7m with 0 errors on Tue Mar 13 21:18:50 2018
config:

	NAME                                          STATE     READ WRITE CKSUM
	pvehzpool                                     ONLINE       0     0     0
	  raidz1-0                                    ONLINE       0     0     0
	    wwn-0x50014ee6b04a3b69                    ONLINE       0     0     0
	    ata-WDC_WD20EZRZ-00Z5HB0_WD-WCC4M2AHF5PA  ONLINE       0     0     0
	    wwn-0x50014ee25ae88a3a                    ONLINE       0     0     0
	    wwn-0x50014ee20dea354b                    ONLINE       0     0     0

errors: No known data errors

Re: zpool 更換壞硬碟

發表於 : 2018-09-24 16:54:33
yehlu

代碼: 選擇全部

root@pveh:/var/log# cat /var/log/syslog | grep sd | grep WWN
Sep 24 17:03:40 pveh smartd[1101]: Device: /dev/sda [SAT], WDC WD20EZRX-00D8PB0, S/N:WD-WMC4N0K2KNC8, WWN:5-0014ee-6b04a3b69, FW:80.00A80, 2.00 TB
Sep 24 17:03:40 pveh smartd[1101]: Device: /dev/sdb [SAT], WDC WD20EZRZ-00Z5HB0, S/N:WD-WCC4N1LKKNX6, WWN:5-0014ee-059de36d9, FW:80.00A80, 2.00 TB
Sep 24 17:03:40 pveh smartd[1101]: Device: /dev/sdc [SAT], WDC WD20EARS-00MVWB0, S/N:WD-WCAZA4761616, WWN:5-0014ee-25ae88a3a, FW:51.0AB51, 2.00 TB
Sep 24 17:03:41 pveh smartd[1101]: Device: /dev/sdd [SAT], WDC WD20EFRX-68EUZN0, S/N:WD-WCC4M1KVEY2F, WWN:5-0014ee-20dea354b, FW:82.00A82, 2.00 TB
Sep 24 17:08:31 pveh smartd[4331]: Device: /dev/sda [SAT], WDC WD20EZRX-00D8PB0, S/N:WD-WMC4N0K2KNC8, WWN:5-0014ee-6b04a3b69, FW:80.00A80, 2.00 TB
Sep 24 17:08:31 pveh smartd[4331]: Device: /dev/sdb [SAT], WDC WD20EZRZ-00Z5HB0, S/N:WD-WCC4M2AHF5PA, WWN:5-0014ee-2ba7d5613, FW:80.00A80, 2.00 TB
Sep 24 17:08:31 pveh smartd[4331]: Device: /dev/sdc [SAT], WDC WD20EARS-00MVWB0, S/N:WD-WCAZA4761616, WWN:5-0014ee-25ae88a3a, FW:51.0AB51, 2.00 TB
Sep 24 17:08:32 pveh smartd[4331]: Device: /dev/sdd [SAT], WDC WD20EFRX-68EUZN0, S/N:WD-WCC4M1KVEY2F, WWN:5-0014ee-20dea354b, FW:82.00A82, 2.00 TB

代碼: 選擇全部

zpool online pvehzpool wwn-0x50014ee6b04a3b69
sda WDC WD20EZRX WD 綠標2TB WD20EZRX
sdb WDC WD20EZRZ WD 藍標2TB WD20EZRZ
sdc WDC WD20EARS WD 綠標2TB WD20EARS
sdd WDC WD20EFRX WD 紅標2TB WD20EFRX

Re: zpool 更換壞硬碟

發表於 : 2018-09-24 18:49:04
yehlu

代碼: 選擇全部

root@pveh:~# ls  /dev/disk/by-id/*
/dev/disk/by-id/ata-WDC_WD20EARS-00MVWB0_WD-WCAZA4761616 /dev/disk/by-id/nvme-eui.0023035630001140-part1
/dev/disk/by-id/ata-WDC_WD20EARS-00MVWB0_WD-WCAZA4761616-part1 /dev/disk/by-id/nvme-eui.0023035630001140-part2
/dev/disk/by-id/ata-WDC_WD20EARS-00MVWB0_WD-WCAZA4761616-part9 /dev/disk/by-id/nvme-eui.0023035630001140-part3
/dev/disk/by-id/ata-WDC_WD20EFRX-68EUZN0_WD-WCC4M1KVEY2F /dev/disk/by-id/nvme-PLEXTOR_PX-256M8PeG_P02630102980
/dev/disk/by-id/ata-WDC_WD20EFRX-68EUZN0_WD-WCC4M1KVEY2F-part1 /dev/disk/by-id/nvme-PLEXTOR_PX-256M8PeG_P02630102980-part1
/dev/disk/by-id/ata-WDC_WD20EFRX-68EUZN0_WD-WCC4M1KVEY2F-part9 /dev/disk/by-id/nvme-PLEXTOR_PX-256M8PeG_P02630102980-part2
/dev/disk/by-id/ata-WDC_WD20EZRZ-00Z5HB0_WD-WCC4M2AHF5PA /dev/disk/by-id/nvme-PLEXTOR_PX-256M8PeG_P02630102980-part3
/dev/disk/by-id/ata-WDC_WD20EZRZ-00Z5HB0_WD-WCC4M2AHF5PA-part1 /dev/disk/by-id/wwn-0x50014ee059de36d9
/dev/disk/by-id/ata-WDC_WD20EZRZ-00Z5HB0_WD-WCC4M2AHF5PA-part9 /dev/disk/by-id/wwn-0x50014ee20dea354b
/dev/disk/by-id/ata-WDC_WD20EZRZ-00Z5HB0_WD-WCC4N1LKKNX6 /dev/disk/by-id/wwn-0x50014ee20dea354b-part1
/dev/disk/by-id/dm-name-pve-root /dev/disk/by-id/wwn-0x50014ee20dea354b-part9
/dev/disk/by-id/dm-name-pve-swap /dev/disk/by-id/wwn-0x50014ee25ae88a3a
/dev/disk/by-id/dm-name-pve-vm--125--disk--1 /dev/disk/by-id/wwn-0x50014ee25ae88a3a-part1
/dev/disk/by-id/dm-uuid-LVM-q3XUKFltTBYmajLbfCDbI068yDBwm7qjEta0ayrDUpPkSG5ewXASzk2rPMWSkjJv /dev/disk/by-id/wwn-0x50014ee25ae88a3a-part9
/dev/disk/by-id/dm-uuid-LVM-q3XUKFltTBYmajLbfCDbI068yDBwm7qjHOiAKdfKRtqqsSyht61dNj2peFoNW0i7 /dev/disk/by-id/wwn-0x50014ee2ba7d5613
/dev/disk/by-id/dm-uuid-LVM-q3XUKFltTBYmajLbfCDbI068yDBwm7qjKz0AUxMQWzDcXCaf2WG5zKEn6ar3x7FJ /dev/disk/by-id/wwn-0x50014ee2ba7d5613-part1
/dev/disk/by-id/lvm-pv-uuid-Rl6w3g-f1ov-6FvA-0X8a-R8Jn-by6S-FE3j25 /dev/disk/by-id/wwn-0x50014ee2ba7d5613-part9
/dev/disk/by-id/nvme-eui.0023035630001140

代碼: 選擇全部

root@pveh:~# fdisk /dev/sda
Welcome to fdisk (util-linux 2.29.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x4f1688c6.

Command (m for help): p
Disk /dev/sda: 1.8 TiB, 2000398934016 bytes, 3907029168 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
Disklabel type: dos
Disk identifier: 0x4f1688c6

Command (m for help): q

代碼: 選擇全部

root@pveh:~# zpool replace pvehzpool wwn-0x50014ee6b04a3b69 /dev/disk/by-id/ata-WDC_WD20EZRZ-00Z5HB0_WD-WCC4N1LKKNX6

代碼: 選擇全部

root@pveh:~# zpool status
pool: pvehzpool
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 Sep 24 18:41:52 2018
24.9M scanned out of 705G at 1.13M/s, 177h10m to go
6.18M resilvered, 0.00% done
config:

NAME STATE READ WRITE CKSUM
pvehzpool DEGRADED 0 0 0
raidz1-0 DEGRADED 0 0 0
replacing-0 DEGRADED 0 0 0
wwn-0x50014ee6b04a3b69 OFFLINE 0 0 0
ata-WDC_WD20EZRZ-00Z5HB0_WD-WCC4N1LKKNX6 ONLINE 0 0 0 (resilvering)
ata-WDC_WD20EZRZ-00Z5HB0_WD-WCC4M2AHF5PA ONLINE 0 0 0
wwn-0x50014ee25ae88a3a ONLINE 0 0 0
wwn-0x50014ee20dea354b ONLINE 0 0 0

errors: No known data errors