如何从 ZFS 池中删除损坏的 ZIL 磁盘

如何从 ZFS 池中删除损坏的 ZIL 磁盘

我有一个 ZFS 池,其中包含两个镜像硬盘驱动器和用于日志的 ramdisk。在我的场景中,日志磁盘已损坏:

# zpool status -x tank
  pool: tank
 state: FAULTED
status: An intent log record could not be read.
    Waiting for adminstrator intervention to fix the faulted pool.
action: Either restore the affected device(s) and run 'zpool online',
    or ignore the intent log records by running 'zpool clear'.
   see: http://illumos.org/msg/ZFS-8000-K4
  scan: none requested
config:

    NAME                    STATE     READ WRITE CKSUM
    tank                    FAULTED      0     0     0
      mirror-0              ONLINE       0     0     0
        ada0                ONLINE       0     0     0
        ada1                ONLINE       0     0     0
    logs
      6324139563861643487   UNAVAIL      0     0     0  was /dev/md1

现在我想丢弃丢失的日志并从池中删除死设备,但我不能这样做:

# zpool clear -F tank 6324139563861643487
cannot clear errors for 6324139563861643487: one or more devices is currently unavailable

我也无法使池上线:

# zpool remove tank 6324139563861643487 
cannot open 'tank': pool is unavailable

如何忽略意向日志记录?

答案1

有一个选项允许导入损坏设备的池。她是我设法恢复泳池的方法:

# zpool export tank
# zpool import -m tank
# zpool status tank
  pool: tank
 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
tank                    DEGRADED     0     0     0
 mirror-0              ONLINE       0     0     0
   gpt/disk1           ONLINE       0     0     0
   gpt/disk2           ONLINE       0     0     0
logs
 6324139563861643487   UNAVAIL      0     0     0  was /dev/md1
cache
 gpt/disk3             ONLINE       0     0     0

errors: No known data errors
# zpool clear tank
# zpool remove tank 6324139563861643487
# zpool status tank
  pool: tank
 state: ONLINE
  scan: none requested
config:

NAME                    STATE     READ WRITE CKSUM
tank                    ONLINE       0     0     0
 mirror-0              ONLINE       0     0     0
   gpt/disk1           ONLINE       0     0     0
   gpt/disk2           ONLINE       0     0     0
cache
 gpt/disk3             ONLINE       0     0     0

errors: No known data errors

答案2

我认为您应该先更换有故障的设备,然后才能使池上线。

那么你可能会放弃使用日志磁盘。

相关内容