重启后无法识别 ZFS 池 Raspberry PI 4 8Gb 上的服务器 20.10

重启后无法识别 ZFS 池 Raspberry PI 4 8Gb 上的服务器 20.10

vdefs尽管我使用with定义了扩展的 ZFS 池,但每次重启后我都会丢失 ZFS 池媒体池vdev 01 02 03 and 04。这些是 4x 2TB SSD。导入池后,一切又恢复正常。有人能帮忙吗?

请看这里了解全部详细信息:

ubuntu@RPIMarc:~$ sudo zpool list
no pools available
ubuntu@RPIMarc:~$ lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
loop0         7:0    0 48.8M  1 loop /snap/core18/1949
loop1         7:1    0 48.8M  1 loop /snap/core18/1936
loop2         7:2    0 62.8M  1 loop /snap/lxd/18775
loop3         7:3    0   27M  1 loop /snap/snapd/10494
loop4         7:4    0 26.9M  1 loop /snap/snapd/9730
loop5         7:5    0 62.8M  1 loop /snap/lxd/18679
sda           8:0    0  1.8T  0 disk
├─sda1        8:1    0  1.8T  0 part
└─sda9        8:9    0    8M  0 part
sdb           8:16   0  1.8T  0 disk
├─sdb1        8:17   0  1.8T  0 part
└─sdb9        8:25   0    8M  0 part
sdc           8:32   0  1.8T  0 disk
├─sdc1        8:33   0  1.8T  0 part
└─sdc9        8:41   0    8M  0 part
sdd           8:48   0  1.8T  0 disk
├─sdd1        8:49   0  1.8T  0 part
└─sdd9        8:57   0    8M  0 part
mmcblk0     179:0    0 29.7G  0 disk
├─mmcblk0p1 179:1    0  256M  0 part /boot/firmware
└─mmcblk0p2 179:2    0 29.5G  0 part /

ubuntu@RPIMarc:~$ cd /dev/disk
ubuntu@RPIMarc:/dev/disk$ cd by-id
ubuntu@RPIMarc:/dev/disk/by-id$ ls -l
total 0
lrwxrwxrwx 1 root root 13 Sep 24 19:27 mmc-SP32G_0x0a17c290 -> ../../mmcblk0
lrwxrwxrwx 1 root root 15 Sep 24 19:27 mmc-SP32G_0x0a17c290-part1 -> ../../mmcblk0p1
lrwxrwxrwx 1 root root 15 Sep 24 19:27 mmc-SP32G_0x0a17c290-part2 -> ../../mmcblk0p2
lrwxrwxrwx 1 root root  9 Dec 28 14:52 scsi-1Samsung_SSD_870_QVO_2TB_1234567890123_0000 -> ../../sdc
lrwxrwxrwx 1 root root 10 Dec 28 15:19 scsi-1Samsung_SSD_870_QVO_2TB_1234567890123_0000-part1 -> ../../sdc1
lrwxrwxrwx 1 root root 10 Dec 28 15:19 scsi-1Samsung_SSD_870_QVO_2TB_1234567890123_0000-part9 -> ../../sdc9
lrwxrwxrwx 1 root root  9 Dec 28 14:52 scsi-1Samsung_SSD_870_QVO_2TB_1234567890123_0001 -> ../../sdd
lrwxrwxrwx 1 root root 10 Dec 28 15:19 scsi-1Samsung_SSD_870_QVO_2TB_1234567890123_0001-part1 -> ../../sdd1
lrwxrwxrwx 1 root root 10 Dec 28 15:19 scsi-1Samsung_SSD_870_QVO_2TB_1234567890123_0001-part9 -> ../../sdb9
lrwxrwxrwx 1 root root  9 Dec 28 14:52 scsi-SSamsung_SSD_870_QVO_2TB_1234567890123 -> ../../sdc
lrwxrwxrwx 1 root root 10 Dec 28 15:19 scsi-SSamsung_SSD_870_QVO_2TB_1234567890123-part1 -> ../../sdc1
lrwxrwxrwx 1 root root 10 Dec 28 15:19 scsi-SSamsung_SSD_870_QVO_2TB_1234567890123-part9 -> ../../sdc9
lrwxrwxrwx 1 root root  9 Dec 28 14:52 scsi-USB-S5SUNG0NB06680B -> ../../sdc
lrwxrwxrwx 1 root root 10 Dec 28 15:19 scsi-USB-S5SUNG0NB06680B-part1 -> ../../sdc1
lrwxrwxrwx 1 root root 10 Dec 28 15:19 scsi-USB-S5SUNG0NB06680B-part9 -> ../../sdc9
lrwxrwxrwx 1 root root  9 Dec 28 14:52 scsi-USB-S5SUNG0NB06720K -> ../../sdb
lrwxrwxrwx 1 root root 10 Dec 28 15:19 scsi-USB-S5SUNG0NB06720K-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Dec 28 15:19 scsi-USB-S5SUNG0NB06720K-part9 -> ../../sdb9
lrwxrwxrwx 1 root root  9 Dec 28 14:52 scsi-USB-S5SUNG0NB06727A -> ../../sda
lrwxrwxrwx 1 root root 10 Dec 28 15:19 scsi-USB-S5SUNG0NB06727A-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Dec 28 15:19 scsi-USB-S5SUNG0NB06727A-part9 -> ../../sda9
lrwxrwxrwx 1 root root  9 Dec 28 14:52 scsi-USB-S5SUNG0NB07228W -> ../../sdd
lrwxrwxrwx 1 root root 10 Dec 28 15:19 scsi-USB-S5SUNG0NB07228W-part1 -> ../../sdd1
lrwxrwxrwx 1 root root 10 Dec 28 15:19 scsi-USB-S5SUNG0NB07228W-part9 -> ../../sdd9
ubuntu@RPIMarc:/dev/disk/by-id$ cd ..
ubuntu@RPIMarc:/dev/disk$ ls -l
total 0
drwxr-xr-x 2 root root 520 Dec 28 15:19 by-id
drwxr-xr-x 2 root root 100 Dec 28 15:19 by-label
drwxr-xr-x 2 root root 120 Dec 28 15:19 by-partlabel
drwxr-xr-x 2 root root 240 Dec 28 15:19 by-partuuid
drwxr-xr-x 2 root root 340 Dec 28 15:19 by-path
drwxr-xr-x 2 root root 100 Dec 28 15:19 by-uuid
drwxr-xr-x 2 root root 280 Dec 28 15:19 by-vdev
ubuntu@RPIMarc:/dev/disk$ cd by-vdev
ubuntu@RPIMarc:/dev/disk/by-vdev$ ls -l
total 0
lrwxrwxrwx 1 root root  9 Dec 28 14:52 01 -> ../../sda
lrwxrwxrwx 1 root root 10 Dec 28 15:19 01-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Dec 28 15:19 01-part9 -> ../../sda9
lrwxrwxrwx 1 root root  9 Dec 28 14:52 02 -> ../../sdb
lrwxrwxrwx 1 root root 10 Dec 28 15:19 02-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Dec 28 15:19 02-part9 -> ../../sdb9
lrwxrwxrwx 1 root root  9 Dec 28 14:52 03 -> ../../sdc
lrwxrwxrwx 1 root root 10 Dec 28 15:19 03-part1 -> ../../sdc1
lrwxrwxrwx 1 root root 10 Dec 28 15:19 03-part9 -> ../../sdc9
lrwxrwxrwx 1 root root  9 Dec 28 14:52 04 -> ../../sdd
lrwxrwxrwx 1 root root 10 Dec 28 15:19 04-part1 -> ../../sdd1
lrwxrwxrwx 1 root root 10 Dec 28 15:19 04-part9 -> ../../sdd9

ubuntu@RPIMarc:/dev/disk/by-vdev$ sudo zpool status
no pools available

ubuntu@RPIMarc:/dev/disk/by-vdev$ sudo zpool import -f media-pool

ubuntu@RPIMarc:/dev/disk/by-vdev$ sudo zpool status
  pool: media-pool
 state: ONLINE
status: One or more devices has experienced an error resulting in data
corruption.  Applications may be affected.
action: Restore the file in question if possible.  Otherwise restore the
entire pool from backup.
   see: http://zfsonlinux.org/msg/ZFS-8000-8A
  scan: scrub repaired 0B in 0 days 00:57:14 with 0 errors on Sun Dec 13 01:21:15 2020
config:

NAME        STATE     READ WRITE CKSUM
media-pool  ONLINE       0     0     0
 01        ONLINE       0     0     0
 02        ONLINE       0     0     0
 03        ONLINE       0     0     0
 04        ONLINE       0     0     0

errors: 1 data errors, use '-v' for a list
ubuntu@RPIMarc:/dev/disk/by-vdev$ lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
loop0         7:0    0 48.8M  1 loop /snap/core18/1949
loop1         7:1    0 48.8M  1 loop /snap/core18/1936
loop2         7:2    0 62.8M  1 loop /snap/lxd/18775
loop3         7:3    0   27M  1 loop /snap/snapd/10494
loop4         7:4    0 26.9M  1 loop /snap/snapd/9730
loop5         7:5    0 62.8M  1 loop /snap/lxd/18679
sda           8:0    0  1.8T  0 disk
├─sda1        8:1    0  1.8T  0 part
└─sda9        8:9    0    8M  0 part
sdb           8:16   0  1.8T  0 disk
├─sdb1        8:17   0  1.8T  0 part
└─sdb9        8:25   0    8M  0 part
sdc           8:32   0  1.8T  0 disk
├─sdc1        8:33   0  1.8T  0 part
└─sdc9        8:41   0    8M  0 part
sdd           8:48   0  1.8T  0 disk
├─sdd1        8:49   0  1.8T  0 part
└─sdd9        8:57   0    8M  0 part
mmcblk0     179:0    0 29.7G  0 disk
├─mmcblk0p1 179:1    0  256M  0 part /boot/firmware
└─mmcblk0p2 179:2    0 29.5G  0 part /
ubuntu@RPIMarc:/dev/disk/by-vdev$ cd /mnt/media-pool
-bash: cd: /mnt/media-pool: No such file or directory
ubuntu@RPIMarc:/dev/disk/by-vdev$ ls -l
total 0
lrwxrwxrwx 1 root root  9 Dec 28 14:52 01 -> ../../sda
lrwxrwxrwx 1 root root 10 Dec 28 15:19 01-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Dec 28 15:19 01-part9 -> ../../sda9
lrwxrwxrwx 1 root root  9 Dec 28 14:52 02 -> ../../sdb
lrwxrwxrwx 1 root root 10 Dec 28 15:19 02-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Dec 28 15:19 02-part9 -> ../../sdb9
lrwxrwxrwx 1 root root  9 Dec 28 14:52 03 -> ../../sdc
lrwxrwxrwx 1 root root 10 Dec 28 15:19 03-part1 -> ../../sdc1
lrwxrwxrwx 1 root root 10 Dec 28 15:19 03-part9 -> ../../sdc9
lrwxrwxrwx 1 root root  9 Dec 28 14:52 04 -> ../../sdd
lrwxrwxrwx 1 root root 10 Dec 28 15:19 04-part1 -> ../../sdd1
lrwxrwxrwx 1 root root 10 Dec 28 15:19 04-part9 -> ../../sdd9
ubuntu@RPIMarc:/dev/disk/by-vdev$ cd /media-pool
ubuntu@RPIMarc:/media-pool$ ls -l
total 2
drwxrwxr-- 4 ubuntu ubuntu 6 Dec 28 10:10 marcshare

答案1

我遇到了同样的问题。我也刚开始使用 zfs 和 homeservers 等。Raspberry Pi,Ubuntu 20.10 为我解决问题的方法是导出池,然后使用 ID 而不是池名称重新导入它。您可以通过输入以下内容来获取 ID

sudo zpool import 

我认为发生错误是因为在初始设置中我尝试了几个不同的 SATA 到 USB 适配器,所以我认为某个地方 zfs 创建了错误的连接或其他问题。请注意,我读到过,最好先使用设备 ID 而不是 dev/sdx 名称来创建池... 我将来也会这样做。当然,对于 pi 来说,因为它在 USB 端口上都是即插即用的,所以 /sdx 符号可能有点不稳定... 例如,我不知道如果我在另一个 USB 端口上添加另一个驱动器会发生什么...

不管怎样,闲话说得够多了。希望我的解决方案也能帮到你……

相关内容