标签 ZFS 下的文章

之前写过一篇PVE ZFS更换故障盘的文章“Proxmox VE的ZFS如何更换故障盘”,有个大佬点评:

其实你这样替换会有些问题,因为是用一个新盘的整盘替换了一个旧盘的分区。随着不停替换,以后会影响启动的。目前看没问题。

我挺在意这个问题,所以去查了一下,在Reddit和一些论坛上确实有人分享这个经验,和大佬点评的一样:

如果像我之前那样直接把整盘当作新设备加入,而 ZFS 最初 pool 是以 “分区 (partition)” 作为 member(例如
p3)的话,可能造成分区结构和 GUID / 分区表不一致,长期累积多次替换,可能会影响启动 (boot),尤其是当 pool 包含系统盘
(boot pool / rpool) 的情况下。

也有人说如果新盘没有明确 copy 分区表 (partition layout) + 重建 boot 分区 (EFI/BIOS) + 安装
boot loader (如 grub 或 proxmox-boot-tool),系统可能无法从新盘启动。

可以看到,这些问题都是基于将ZFS作为系统盘启动会遇到的,如果你不是将ZFS作为系统盘,而是作为数据盘则我原文是没问题的。但如果将ZFS作为系统盘,则建议使用下文方法更换故障盘,避免潜在风险。在此谢谢大佬指正!

- 阅读剩余部分 -

巡检中发现PVE的zfs-raidz2坏了一个盘,查询显示:

~# zpool status rpool
  pool: rpool
 state: DEGRADED
status: One or more devices has been removed by the administrator.
        Sufficient replicas exist for the pool to continue functioning in a
        degraded state.
action: Online the device using zpool online' or replace the device with
        'zpool replace'.
  scan: scrub repaired 0B in 00:43:00 with 0 errors on Sun May 12 01:07:02 2024
config:

        NAME                                                  STATE     READ WRITE CKSUM
        rpool                                                 DEGRADED     0     0     0
          raidz2-0                                            DEGRADED     0     0     0
            ata-INTEL_SSDSC2KB019TZ_PHYI334000GD1P9DGN-part3  ONLINE       0     0     0
            ata-INTEL_SSDSC2KB019TZ_PHYI334000NS1P9DGN-part3  ONLINE       0     0     0
            ata-INTEL_SSDSC2KB019TZ_PHYI334000Q21P9DGN-part3  ONLINE       0     0     0
            ata-INTEL_SSDSC2KB019TZ_PHYI334000Y91P9DGN-part3  ONLINE       0     0     0
            ata-INTEL_SSDSC2KB019TZ_PHYI334000GE1P9DGN-part3  REMOVED      0     0     0

- 阅读剩余部分 -