ZFS 오류 복구
HDD 6개로 이뤄진 RAID-Z2 볼륨에서 HDD 하나가 죽어서 DEGRADED 상태에 빠졌다.
재부팅을 했더니 이후부터 뜬금없이 ZFS 모듈 로드 오류가 발생했다.

[1] ZFS 모듈 로드 오류 처리

$ zpool status
Failed to load ZFS module stack.
Load the module manually by running 'insmod <location>/zfs.ko' as root.

$ sudo apt-get install --reinstall zfs-dkms


zfs-0.6.3 이 제거되고 zfs-0.6.4.1 이 설치되었고 위의 오류가 사라졌다.


[2] 사라진 zpool 을 찾아 복구하는 과정

ZFS 모듈 재설치 뒤에 기존의 ZFS 볼륨이 인식되지 않는 문제가 생겼다.
아래와 같이 import 시켰더니 볼륨이 인식되었고 이후 새 HDD를 넣어 볼륨을 재건했다.

$ sudo zpool status
no pools available

$ sudo zpool import tank
$ sudo zpool status
NAME       SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
tank      16.2T  7.49T  8.76T    46%  1.00x  DEGRADED  -
$ sudo zpool status
  pool: tank
 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 9h40m with 0 errors on Sun Jun 14 10:40:57 2015
config:

        NAME                      STATE     READ WRITE CKSUM
        tank                      DEGRADED     0     0     0
          raidz2-0                DEGRADED     0     0     0
            sda                   ONLINE       0     0     0
            sdb                   ONLINE       0     0     0
            sdc                   ONLINE       0     0     0
            sdd                   ONLINE       0     0     0
            sde                   ONLINE       0     0     0
            18374600283086822621  UNAVAIL      0     0     0  was /dev/sdf1

errors: No known data errors

$ sudo zpool replace tank /dev/sdf
invalid vdev specification
use '-f' to override the following errors:
/dev/sdf does not contain an EFI label but it may contain partition
information in the MBR.

$ sudo sgdisk -R /dev/sdf /dev/sda

The program 'sgdisk' is currently not installed.  You can install it by typing:
$ sudo apt-get install gdisk
  [ 로그 생략 ]
$ sudo sgdisk -R /dev/sdf /dev/sda
The operation has completed successfully.
$ sudo sgdisk -G /dev/sdf

The operation has completed successfully.

--> 20161205 수정 :
    sgdisk 실행할 때, -R 옵션실행뒤에 -G 옵션으로 RUID random 재생성.
    -R은 각종 GUID까지 복제되므로 -G 옵션으로 GUID ramdomize
.

$ sudo zpool replace tank /dev/sdf
$ sudo zpool status
  pool: tank
 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 15 12:36:15 2015
    248M scanned out of 7.49T at 10.8M/s, 202h40m to go
    39.8M resilvered, 0.00% done
config:

        NAME                        STATE     READ WRITE CKSUM
       
tank                        DEGRADED     0     0     0
          raidz2-0                  DEGRADED     0     0     0
            sda                     ONLINE       0     0     0
            sdb                     ONLINE       0     0     0
            sdc                     ONLINE       0     0     0
            sdd                     ONLINE       0     0     0
            sde                     ONLINE       0     0     0
            replacing-5             UNAVAIL      0     0     0
              18374600283086822621  UNAVAIL      0     0     0  was /dev/sdf1/old
              sdf                   ONLINE       0     0     0  (resilvering)

errors: No known data errors

[ 몇 시간 뒤 ]

$ sudo apt-get update
$ sudo apt-get upgrade

[ ... ]

Setting up libuutil1 (0.6.4.1-1~precise) ...
Setting up libnvpair1 (0.6.4.1-1~precise) ...
Setting up libzpool2 (0.6.4.1-1~precise) ...
Setting up libzfs2 (0.6.4.1-1~precise) ...
Setting up zfsutils (0.6.4.1-1~precise) ...

[ ... ]

$ sudo zpool status
  pool: tank
 state: ONLINE
status: Some supported features are not enabled on the pool. The pool can
        still be used, but some features are unavailable.
action: Enable all features using 'zpool upgrade'. Once this is done,
        the pool may no longer be accessible by software that does not support
        the features. See zpool-features(5) for details.
  scan: resilvered 1.24T in 5h23m with 0 errors on Mon Jun 15 17:59:20 2015
config:

        NAME        STATE     READ WRITE CKSUM
        tank        ONLINE       0     0     0
          raidz2-0  ONLINE       0     0     0
            sda     ONLINE       0     0     0
            sdb     ONLINE       0     0     0
            sdc     ONLINE       0     0     0
            sdd     ONLINE       0     0     0
            sde     ONLINE       0     0     0
            sdf     ONLINE       0     0     0

errors: No known data errors


죽은 하드디스크는 보증기간이 이미 지나서 쓰레기통으로..


$ sudo zpool status
  pool: tank
 state: ONLINE
status: Some supported features are not enabled on the pool. The pool can
        still be used, but some features are unavailable.
action: Enable all features using 'zpool upgrade'. Once this is done,
        the pool may no longer be accessible by software that does not support
        the features. See zpool-features(5) for details.
  scan: resilvered 1.24T in 5h23m with 0 errors on Mon Jun 15 17:59:20 2015
config:

        NAME        STATE     READ WRITE CKSUM
        tank        ONLINE       0     0     0
          raidz2-0  ONLINE       0     0     0
            sda     ONLINE       0     0     0
            sdb     ONLINE       0     0     0
            sdc     ONLINE       0     0     0
            sdd     ONLINE       0     0     0
            sde     ONLINE       0     0     0
            sdf     ONLINE       0     0     0

errors: No known data errors
$ sudo zpool upgrade
This system supports ZFS pool feature flags.

All pools are formatted using feature flags.


Some supported features are not enabled on the following pools. Once a
feature is enabled the pool may become incompatible with software
that does not support the feature. See zpool-features(5) for details.

POOL  FEATURE
---------------
tank
      spacemap_histogram
      enabled_txg
      hole_birth
      extensible_dataset
      embedded_data
      bookmarks

$ sudo zpool upgrade tank
This system supports ZFS pool feature flags.

Enabled the following features on 'tank':
  spacemap_histogram
  enabled_txg
  hole_birth
  extensible_dataset
  embedded_data
  bookmarks

$ sudo zpool status
  pool: tank
 state: ONLINE
  scan: resilvered 1.24T in 5h23m with 0 errors on Mon Jun 15 17:59:20 2015
config:

        NAME        STATE     READ WRITE CKSUM
        tank        ONLINE       0     0     0
          raidz2-0  ONLINE       0     0     0
            sda     ONLINE       0     0     0
            sdb     ONLINE       0     0     0
            sdc     ONLINE       0     0     0
            sdd     ONLINE       0     0     0
            sde     ONLINE       0     0     0
            sdf     ONLINE       0     0     0

errors: No known data errors
by 시험さま | 2015/06/15 12:07 | 컴퓨터 | 트랙백 | 덧글(0)
트랙백 주소 : http://chanik.egloos.com/tb/4087149
☞ 내 이글루에 이 글과 관련된 글 쓰기 (트랙백 보내기) [도움말]

:         :

:

비공개 덧글

< 이전페이지 다음페이지 >