我对 zfs 池有重复的问题,其中 zfs 停止识别自己的、正确标记(或看起来如此)的物理设备。
Ubuntu 20.04.2 LTS
5.11.0-44-generic #48~20.04.2-Ubuntu SMP Tue Dec 14 15:36:44 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
libzfs2linux/now 0.8.3-1ubuntu12.11 amd64 [installed,upgradable to: 0.8.3-1ubuntu12.13]
zfs-zed/now 0.8.3-1ubuntu12.11 amd64 [installed,upgradable to: 0.8.3-1ubuntu12.13]
zfsutils-linux/now 0.8.3-1ubuntu12.11 amd64 [installed,upgradable to: 0.8.3-1ubuntu12.13]
模型示例。
- 我可以创建一个池,连接完全不相关的磁盘(例如 USB、外部),并在重新启动时(使用 USB 磁盘)zfs 报告其池中的一个磁盘丢失。
- 更改一个(或多个)驱动器的控制器似乎也会发生同样的情况。所有物理磁盘都在那里,所有标签/uuid 似乎都在那里,改变的是设备号分配。
很难相信 zfs 会根据系统设备分配顺序组装池而忽略其标签/uuid,但这就是它的简单外观。
agatek@mmstorage:~$ zpool status
pool: mmdata
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 in progress since Sun Jan 9 13:03:23 2022
650G scanned at 1.58G/s, 188G issued at 468M/s, 22.7T total
0B repaired, 0.81% done, 0 days 14:00:27 to go
config:
NAME STATE READ WRITE CKSUM
mmdata DEGRADED 0 0 0
raidz1-0 DEGRADED 0 0 0
ata-HGST_HDN726040ALE614_K7HJG8HL ONLINE 0 0 0
6348126275544519230 FAULTED 0 0 0 was /dev/sdb1
ata-HGST_HDN726040ALE614_K3H14ZAL ONLINE 0 0 0
ata-HGST_HDN726040ALE614_K4K721RB ONLINE 0 0 0
ata-WDC_WD40EZAZ-00SF3B0_WD-WX12D514858P ONLINE 0 0 0
ata-ST4000DM004-2CV104_ZTT24X5R ONLINE 0 0 0
ata-WDC_WD40EZAZ-00SF3B0_WD-WX62D711SHF4 ONLINE 0 0 0
sdi ONLINE 0 0 0
errors: No known data errors
agatek@mmstorage:~$ blkid
/dev/sda1: UUID="E0FD-8D4F" TYPE="vfat" PARTUUID="7600a192-967b-417f-b726-7f5524be71a5"
/dev/sda2: UUID="9d8774ec-051f-4c60-aaa7-82f37dbaa4a4" TYPE="ext4" PARTUUID="425f31b2-f289-496a-911b-a2f8a9bb5c25"
/dev/sda3: UUID="e0b8852d-f781-4891-8e77-d8651f39a55b" TYPE="ext4" PARTUUID="a750bae3-c6ea-40a0-bdfa-0523e358018b"
/dev/sdb1: LABEL="mmdata" UUID="16683979255455566941" UUID_SUB="13253481390530831214" TYPE="zfs_member" PARTLABEL="zfs-5360ecc220877e69" PARTUUID="57fe2215-aa69-2f46-b626-0f2057a2e4a7"
/dev/sdd1: LABEL="mmdata" UUID="16683979255455566941" UUID_SUB="17929921080902463088" TYPE="zfs_member" PARTLABEL="zfs-f6ef14df86c7a6e1" PARTUUID="31a074a3-300d-db45-b9e2-3495f49c4bee"
/dev/sde1: LABEL="mmdata" UUID="16683979255455566941" UUID_SUB="505855664557329830" TYPE="zfs_member" PARTLABEL="zfs-6326993c142e4a03" PARTUUID="37f4954d-67fd-8945-82e6-d0db1f2af12e"
/dev/sdg1: LABEL="mmdata" UUID="16683979255455566941" UUID_SUB="1905592300789522892" TYPE="zfs_member" PARTLABEL="zfs-9d379d5bfd432a2b" PARTUUID="185eff00-196a-a642-9360-0d4532d54ec0"
/dev/sdi1: LABEL="mmdata" UUID="16683979255455566941" UUID_SUB="15862525770363300383" TYPE="zfs_member" PARTLABEL="zfs-3c99aa22a45c59bf" PARTUUID="89f1600a-b58e-c74c-8d5e-6fdd186a6db0"
/dev/sdh1: LABEL="mmdata" UUID="16683979255455566941" UUID_SUB="15292769945216849639" TYPE="zfs_member" PARTLABEL="zfs-ee9e1c9a5bde878c" PARTUUID="2e70d63b-00ba-f842-b82d-4dba33314dd5"
/dev/sdf1: LABEL="mmdata" UUID="16683979255455566941" UUID_SUB="5773484836304595337" TYPE="zfs_member" PARTLABEL="zfs-ee40cf2140012e24" PARTUUID="e5cc3e2a-f7c9-d54e-96de-e62a723a9c3f"
/dev/sdc1: LABEL="mmdata" UUID="16683979255455566941" UUID_SUB="6348126275544519230" TYPE="zfs_member" PARTLABEL="zfs-0d28f0d2715eaff8" PARTUUID="a328981a-7569-294a-bbf6-9d26660e2aad"`
对于上述池,发生了什么,其中一个设备早先发生了故障。我将替换磁盘连接到第二个控制器并执行了替换。它是成功的。游泳池还可以。接下来,故障设备从池中移除并由替换磁盘物理替换(控制器更改)。重新启动后,我将其置于降级状态,其中一个设备报告丢失。清理是由命令 zpool clear 触发的。
因此,正如 blkid 所示,有 8 个磁盘,所有磁盘都正确分区和标记(我认为),但其中一个设备未被识别为池的一部分。在这种情况下该怎么办?这非常烦人。重新同步池需要几天时间。
如果您使用
/dev/sdX
路径将任何设备添加到池中,它可能会发生变化,因为 Linux 内核不保证这些驱动器条目的任何顺序。在您的输出中,您
/dev/sdi
是池的成员。这可以随时改变。您应该尝试
zpool export mmdata
使阵列脱机,然后zpool import mmdata -d /dev/disk/by-id
使用驱动器的永久 ID 再次导入它。