在 truenas 镜像启动中尝试更换磁盘时出现问题

在 truenas 镜像启动中尝试更换磁盘时出现问题

我有一个 TrueNAS 盒(TrueNAS-13.0-U5.3),我的启动池是镜像的 32GB 闪存驱动器。其中一个驱动器 da2 出现错误,所以我想更换它。我已经插入了一个新驱动器 da1,它不属于任何池(据我所知),但是当我使用 zpool replace 或 GUI 中的相同操作时,我收到此错误:"already in replacing/spare config; wait for completion or use 'zpool detach'"

% sudo zpool replace freenas-boot gptid/5fef18d4-8588-11e5-8e5d-d0509964c14c /dev/da1
cannot replace gptid/5fef18d4-8588-11e5-8e5d-d0509964c14c with /dev/da1: already in replacing/spare config; wait for completion or use 'zpool detach'

我不知道如何修复这个问题并继续使用我的 da1。我没有看到 da1 是任何东西的一部分(但我可能遗漏了一些东西;我不记得很久以前插入那个备用电源时我做了什么。)

我的zpool状态:

garyo@freenas ~ % zpool status -v freenas-boot                                                       
  pool: freenas-boot
 state: DEGRADED
status: One or more devices are faulted in response to persistent errors.
    Sufficient replicas exist for the pool to continue functioning in a
    degraded state.
action: Replace the faulted device, or use 'zpool clear' to mark the device
    repaired.
  scan: scrub repaired 0B in 00:07:03 with 0 errors on Wed Sep 27 03:52:03 2023
config:

    NAME                                            STATE     READ WRITE CKSUM
    freenas-boot                                    DEGRADED     0     0     0
      mirror-0                                      DEGRADED     0     0     0
        gptid/5fef18d4-8588-11e5-8e5d-d0509964c14c  FAULTED    360   784 1.25K  too many errors
        da0p2                                       ONLINE       0     0     0
garyo@freenas ~ % glabel status           
                                      Name  Status  Components
gptid/15d4bdc4-037a-11e8-a55f-0cc47ada24f0     N/A  ada1p2
gptid/c54977e0-a84a-11ec-afcf-0cc47ada24f0     N/A  ada2p2
gptid/e1ed945e-120b-11e5-a9c7-d0509964c14c     N/A  ada3p2
gptid/ea0b7cb6-b62d-11e8-ae87-0cc47ada24f0     N/A  ada4p2
gptid/e853ce91-d824-11e9-a2bf-0cc47ada24f0     N/A  ada0p2
gptid/9b05f414-a969-11e8-b9d0-0cc47ada24f0     N/A  ada5p2
gptid/64b18a04-428f-11ed-a6f7-0cc47ada24f0     N/A  da0p1
gptid/5fe47459-8588-11e5-8e5d-d0509964c14c     N/A  da2p1
gptid/5fef18d4-8588-11e5-8e5d-d0509964c14c     N/A  da2p2

根据评论,以下是完整zpool statusgpart show

garyo@freenas ~ % zpool status
  pool: freenas-boot
 state: DEGRADED
status: One or more devices are faulted in response to persistent errors.
    Sufficient replicas exist for the pool to continue functioning in a
    degraded state.
action: Replace the faulted device, or use 'zpool clear' to mark the device
    repaired.
  scan: scrub repaired 0B in 00:07:03 with 0 errors on Wed Sep 27 03:52:03 2023
config:

    NAME                                            STATE     READ WRITE CKSUM
    freenas-boot                                    DEGRADED     0     0     0
      mirror-0                                      DEGRADED     0     0     0
        gptid/5fef18d4-8588-11e5-8e5d-d0509964c14c  FAULTED    360   784 1.25K  too many errors
        da0p2                                       ONLINE       0     0     0

errors: No known data errors

  pool: volume1
 state: ONLINE
  scan: scrub repaired 0B in 07:18:41 with 0 errors on Sun Sep 24 07:19:13 2023
config:

    NAME                                            STATE     READ WRITE CKSUM
    volume1                                         ONLINE       0     0     0
      raidz2-0                                      ONLINE       0     0     0
        gptid/15d4bdc4-037a-11e8-a55f-0cc47ada24f0  ONLINE       0     0     0
        gptid/e853ce91-d824-11e9-a2bf-0cc47ada24f0  ONLINE       0     0     0
        gptid/e1ed945e-120b-11e5-a9c7-d0509964c14c  ONLINE       0     0     0
        gptid/c54977e0-a84a-11ec-afcf-0cc47ada24f0  ONLINE       0     0     0
        gptid/ea0b7cb6-b62d-11e8-ae87-0cc47ada24f0  ONLINE       0     0     0
        gptid/9b05f414-a969-11e8-b9d0-0cc47ada24f0  ONLINE       0     0     0

errors: No known data errors
garyo@freenas ~ % gpart show
=>        40  5860533088  ada1  GPT  (2.7T)
          40          88        - free -  (44K)
         128     4194304     1  freebsd-swap  (2.0G)
     4194432  5856338688     2  freebsd-zfs  (2.7T)
  5860533120           8        - free -  (4.0K)

=>        40  5860533088  ada2  GPT  (2.7T)
          40          88        - free -  (44K)
         128     4194304     1  freebsd-swap  (2.0G)
     4194432  5856338696     2  freebsd-zfs  (2.7T)

=>        34  5860533101  ada3  GPT  (2.7T)
          34          94        - free -  (47K)
         128     4194304     1  freebsd-swap  (2.0G)
     4194432  5856338696     2  freebsd-zfs  (2.7T)
  5860533128           7        - free -  (3.5K)

=>        40  5860533088  ada4  GPT  (2.7T)
          40          88        - free -  (44K)
         128     4194304     1  freebsd-swap  (2.0G)
     4194432  5856338688     2  freebsd-zfs  (2.7T)
  5860533120           8        - free -  (4.0K)

=>        40  5860533088  ada0  GPT  (2.7T)
          40          88        - free -  (44K)
         128     4194304     1  freebsd-swap  (2.0G)
     4194432  5856338696     2  freebsd-zfs  (2.7T)

=>        40  5860533088  ada5  GPT  (2.7T)
          40          88        - free -  (44K)
         128     4194304     1  freebsd-swap  (2.0G)
     4194432  5856338688     2  freebsd-zfs  (2.7T)
  5860533120           8        - free -  (4.0K)

=>      40  60088240  da0  GPT  (29G)
        40      1024    1  freebsd-boot  (512K)
      1064  60087216    2  freebsd-zfs  (29G)

=>      34  31260605  da2  GPT  (15G)
        34      1024    1  freebsd-boot  (512K)
      1058         6       - free -  (3.0K)
      1064  31259568    2  freebsd-zfs  (15G)
  31260632         7       - free -  (3.5K)

正如您所见,da1其中任何一个都没有列出。

这里是geom disk list

garyo@freenas ~ % geom disk list
Geom name: ada1
Providers:
1. Name: ada1
   Mediasize: 3000592982016 (2.7T)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r2w2e5
   descr: WDC WD30EFRX-68EUZN0
   lunid: 50014ee2b94bee1c
   ident: WD-WCC4N0FZ3NH7
   rotationrate: 5400
   fwsectors: 63
   fwheads: 16

Geom name: ada2
Providers:
1. Name: ada2
   Mediasize: 3000592982016 (2.7T)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r2w2e5
   descr: ST3000VN007-2AH16M
   lunid: 5000c500dd0879ef
   ident: ZGYA0B7L
   rotationrate: 5980
   fwsectors: 63
   fwheads: 16

Geom name: ada3
Providers:
1. Name: ada3
   Mediasize: 3000592982016 (2.7T)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r2w2e5
   descr: WDC WD30EFRX-68EUZN0
   lunid: 50014ee20bbb2625
   ident: WD-WCC4N5UTA8PK
   rotationrate: 5400
   fwsectors: 63
   fwheads: 16

Geom name: ada4
Providers:
1. Name: ada4
   Mediasize: 3000592982016 (2.7T)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r2w2e5
   descr: WDC WD30EFRX-68N32N0
   lunid: 50014ee26543ab32
   ident: WD-WCC7K0CTHAAH
   rotationrate: 5400
   fwsectors: 63
   fwheads: 16

Geom name: ada0
Providers:
1. Name: ada0
   Mediasize: 3000592982016 (2.7T)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r2w2e5
   descr: ST3000VN007-2E4166
   lunid: 5000c500b4c1d6dc
   ident: Z731DW8S
   rotationrate: 5900
   fwsectors: 63
   fwheads: 16

Geom name: ada5
Providers:
1. Name: ada5
   Mediasize: 3000592982016 (2.7T)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r2w2e5
   descr: ST3000VN007-2E4166
   lunid: 5000c500b14c80da
   ident: Z730VD95
   rotationrate: 5900
   fwsectors: 63
   fwheads: 16

Geom name: da0
Providers:
1. Name: da0
   Mediasize: 30765219840 (29G)
   Sectorsize: 512
   Mode: r1w1e2
   descr: USB SanDisk 3.2Gen1
   lunname: USB     SanDisk 3.2Gen1040103a910eedcc1a6d4
   lunid: USB     SanDisk 3.2Gen1040103a910eedcc1a6d4
   ident: 040103a910eedcc1a6d45a2a6e838a4e4714cab19e8b6afb4d329bce64703205b94e000000000000000000007d363e77001a55188155810715ad1af9
   rotationrate: unknown
   fwsectors: 63
   fwheads: 255

Geom name: da1
Providers:
1. Name: da1
   Mediasize: 31458328576 (29G)
   Sectorsize: 512
   Mode: r0w0e0
   descr: Generic Flash Disk
   lunname: ALCOR   ALCOR
   lunid: 200049454505080f
   ident: CD32FA3E
   rotationrate: unknown
   fwsectors: 63
   fwheads: 255

Geom name: da2
Providers:
1. Name: da2
   Mediasize: 16005464064 (15G)
   Sectorsize: 512
   Mode: r0w0e0
   descr: SanDisk Cruzer Fit
   lunname: SanDisk Cruzer Fit      4C530012850910111431
   lunid: SanDisk Cruzer Fit      4C530012850910111431
   ident: 4C530012850910111431
   rotationrate: unknown
   fwsectors: 63
   fwheads: 255

答案1

首先,您不能用整个设备替换作为分区的 vdev 成员。我的意思是,正式地说,你可以, 但这会让事情变得复杂此外,因为当您尝试从第二个驱动器启动时,您会突然得到一个无法启动的服务器。

您需要正确标记您的替换磁盘,然后创建适当数量且大小合适的分区,然后再替换故障驱动器。

目前,您的初始帖子缺少gpart show输出以及未剪切的输出zpool status,导致您无法接收进一步的指示。

更新:

首先,您试图用较小的驱动器替换较大的驱动器:da0 已经是活动镜像的一部分,并且它比 da2 大。无论采用哪种方法,这在技术上都是不可能的。

第二,关于它的大小,它们是什么?USB 记忆棒?在镜像中使用 USB 记忆棒的系统驱动器可能是一个完全坏主意。

相关内容