首页 > 其他分享 >TruneNAS导入池时出错[ libzfs.ZFSException: ('IO error',) ]

TruneNAS导入池时出错[ libzfs.ZFSException: ('IO error',) ]

时间:2024-10-24 18:00:32浏览次数:7  
标签:IO lib ZFSException 池时 usr File line local pool

简述:某天TrueNAS无故宕机,经检查服务器内存检测失败(32G只识别了16G),除灰,重插内存,系统启动成功,登录后池error,手动导入报错。

  1. 问题

借图,本地报错与该图一致,导入池错误代码参考代码块
image

错误: concurrent.futures.process._RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/concurrent/futures/process.py", line 246, in _process_worker
    r = call_item.fn(*call_item.args, **call_item.kwargs)
  File "/usr/local/lib/python3.9/site-packages/middlewared/worker.py", line 111, in main_worker
    res = MIDDLEWARE._run(*call_args)
  File "/usr/local/lib/python3.9/site-packages/middlewared/worker.py", line 45, in _run
    return self._call(name, serviceobj, methodobj, args, job=job)
  File "/usr/local/lib/python3.9/site-packages/middlewared/worker.py", line 39, in _call
    return methodobj(*params)
  File "/usr/local/lib/python3.9/site-packages/middlewared/worker.py", line 39, in _call
    return methodobj(*params)
  File "/usr/local/lib/python3.9/site-packages/middlewared/schema.py", line 979, in nf
    return f(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/middlewared/plugins/zfs.py", line 352, in import_pool
    self.logger.error(
  File "libzfs.pyx", line 392, in libzfs.ZFS.__exit__
  File "/usr/local/lib/python3.9/site-packages/middlewared/plugins/zfs.py", line 346, in import_pool
    zfs.import_pool(found, new_name or found.name, options, any_host=any_host)
  File "libzfs.pyx", line 1151, in libzfs.ZFS.import_pool
  File "libzfs.pyx", line 1179, in libzfs.ZFS.__import_pool
libzfs.ZFSException: I/O error
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/middlewared/job.py", line 355, in run
    await self.future
  File "/usr/local/lib/python3.9/site-packages/middlewared/job.py", line 391, in __run_body
    rv = await self.method(*([self] + args))
  File "/usr/local/lib/python3.9/site-packages/middlewared/schema.py", line 975, in nf
    return await f(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/middlewared/plugins/pool.py", line 1464, in import_pool
    await self.middleware.call('zfs.pool.import_pool', pool['guid'], {
  File "/usr/local/lib/python3.9/site-packages/middlewared/main.py", line 1278, in call
    return await self._call(
  File "/usr/local/lib/python3.9/site-packages/middlewared/main.py", line 1243, in _call
    return await self._call_worker(name, *prepared_call.args)
  File "/usr/local/lib/python3.9/site-packages/middlewared/main.py", line 1249, in _call_worker
    return await self.run_in_proc(main_worker, name, args, job)
  File "/usr/local/lib/python3.9/site-packages/middlewared/main.py", line 1168, in run_in_proc
    return await self.run_in_executor(self.__procpool, method, *args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/middlewared/main.py", line 1151, in run_in_executor
    return await loop.run_in_executor(pool, functools.partial(method, *args, **kwargs))
libzfs.ZFSException: ('I/O error',)
  1. 处理方法
    命令方式导入池
root@truenas[~]# zpool import
   pool: iscsi03
     id: 15425028190627763416
  state: ONLINE
 action: The pool can be imported using its name or numeric identifier.
 config:

        iscsi03                                       ONLINE
          gptid/50376465-531c-11ef-8d12-e0db55058c66  ONLINE
root@truenas[~]# zpool import iscsi03
cannot import 'iscsi03': I/O error
        Recovery is possible, but will result in some data loss.
        Returning the pool to its state as of Mon Oct 21 13:58:54 2024
        should correct the problem.  Approximately 5 seconds of data
        must be discarded, irreversibly.  Recovery can be attempted
        by executing 'zpool import -F iscsi03'.  A scrub of the pool
        is strongly recommended after recovery.

# 强制导入
root@truenas[~]# zpool import -F iscsi03
# 数据校验
root@truenas[~]# zpool scrub iscsi03
# 监控系统日志: 在执行 scrub 的同时,可以查看系统日志(如 /var/log/messages 或 dmesg),以确保没有出现新的硬件或 I/O 错误。
# 检查存储池状态
# 间隔一段时间运行 zpool status iscsi03 查看进度。
root@truenas[~]# zpool status iscsi03
  pool: iscsi03
 state: ONLINE
  scan: scrub in progress since Tue Oct 22 08:49:17 2024
        232G scanned at 1.61G/s, 50.3G issued at 358M/s, 580G total
        0B repaired, 8.67% done, 00:25:16 to go
config:

        NAME                                          STATE     READ WRITE CKSUM
        iscsi03                                       ONLINE       0     0     0
          gptid/50376465-531c-11ef-8d12-e0db55058c66  ONLINE       0     0     0

errors: No known data errors
# errors: No known data errors” 表示当前没有检测到数据错误。这意味着在 scrub 操作过程中,没有发现数据损坏或校验错误,存储池的状态是正常的。

# 重复执行该命令可以查看导入进度,导入成功状态如下。
root@truenas[~]# zpool status iscsi03
  pool: iscsi03
 state: ONLINE
  scan: scrub repaired 0B in 00:31:52 with 0 errors on Tue Oct 22 09:21:09 2024
config:

        NAME                                          STATE     READ WRITE CKSUM
        iscsi03                                       ONLINE       0     0     0
          gptid/50376465-531c-11ef-8d12-e0db55058c66  ONLINE       0     0     0

errors: No known data errors
  • 重启TrueNAS,重启完成后重新登陆,然后点storage下面的pools点add ,在创建或导入pool阶段选择导入pool,下一步,下一步,然后选择要导入的pool,下一步,等待导入完成就可以去dashboard查看pool的状态了
    恢复成功

ps:虚拟化常规来说会自动识别存储配置,无需其它操作

此处预想了三个方法,1.原系统恢复;2. 重装系统,导入原有池;3.将系统换成windows,然后取数据盘虚拟机,导入现有虚拟化。

1)初始查阅资料在原有系统上恢复未成功。

2)紧急操作,重新安装TrueNAS系统,导入现有池,失败。

3)二次查阅资料,命令方式导入池进行恢复,导入成功,数据恢复成功。
池导入完成后,重启系统,然后手动添加现有池succese。

一套流程下来其实并不需要重装系统,在原有系统上使用命令方式导入池即可,另,由于重新安装TrueNAS系统共享服务需要重新配置,最好是与原配置相同,启动成功后vsphere自动连接,否则vsphere存储需要重新添加。
windows方法未尝试,由于文件分散,未必会成功。

参考:bili上有个人遇到了类同的问题但注明了禁止转载,没写具体处理步骤,没太懂,可能是我太菜了ing。
https://www.bilibili.com/read/cv16451174/
https://blog.csdn.net/qq_37696855/article/details/123200440
https://www.truenas.com/community/threads/cant-import-pool-i-o-error.97369/

祝各位好运,天天发财。

标签:IO,lib,ZFSException,池时,usr,File,line,local,pool
From: https://www.cnblogs.com/2287keybord/p/18500073

相关文章

  • Genymotion 模拟器上安装最新版本的微信并正常运行
    安装Genymotion安装步骤1安装虚拟机VirtualBox https://www.virtualbox.org/wiki/Downloads2注册Genymotion帐号 https://www.genymotion.com/account/create/3登录,下载并安装Genymotion https://www.genymotion.com/download/ android9版本的:  Genymotion-ARM-Tran......
  • 计算机视觉库supervision学习-day(2)-Detections类
    对于day-1,算是一个简要的supervision的使用方法,但对于大部分内容本人还是一知半解,因此我查看官方文档,对照着官方文档来进行supervision的详细学习,并对其中一些重要的方法和属性进行解释DetectionsandSegmentation-检测与分割一、Detections类supervision是这样描述Detection......
  • CF1800E2. Unforgivable Curse (hard version) 题解 并查集
    题目链接:https://codeforces.com/contest/1800/problem/E2视频讲解:https://www.bilibili.com/video/BV1tZ1FYPELp?p=2把下标\(i\)对应到图中编号为\(i\)的节点。节点\(i\)和\(i+k\)之间连一条边,节点\(i\)和\(i+k+1\)之间也连一条边。同一个连通块里的节点对应的字......
  • ReactOS系统中平衡二叉树。给定地址超导其所属区块MmFindRegion()
    系列文章目录PMM_REGIONNTAPIMmFindRegion(PVOIDBaseAddress,PLIST_ENTRYRegionListHead,PVOIDAddress,PVOID*RegionBaseAddress);宏函数//给定地址找到其中所属区块#defineCONTAINING_RECORD(address,type,field)((typeFAR*\(PCHAR)(address)-(PCH......
  • 【NLP自然语言处理】Attention机制原理揭秘:赋予神经网络‘聚焦’与‘理解’的神奇力量
    目录......
  • Windows Image Acquisition (WIA) 是 Microsoft Windows 操作系统中的一项服务,用于支
    WindowsImageAcquisition(WIA)是MicrosoftWindows操作系统中的一项服务,用于支持与图像设备(如扫描仪、数码相机和其他图像捕捉设备)的交互。WIA提供了一种标准化的接口,使应用程序能够从这些设备获取图像,并进行处理或存储。以下是关于WIA服务的详细信息:主要功能图像设......
  • InternVL-1.0: Scaling up Vision Foundation Models and Aligningfor Generic Visual
    论文:https://arxiv.org/abs/2312.14238代码:https://github.com/OpenGVLab/InternVL背景在LLM时代,视觉基础模型通常通过一些轻量级的“粘合”层(如QFormer或线性投影)与LLMs连接。然而,这些模型主要源自ImageNet或JFT等纯视觉数据集,或使用图像文本对与BERT系列对齐,缺乏与L......
  • 实现CJ188转profinet IO项目案例
    目录1 案例说明 12 VFBOX网关工作原理 13 准备工作 24 配置VFBOX网关 25 用PROFINETIO协议转发数据 56 案例总结 71 案例说明设置网关采集CJ188数据把采集的数据转成profinetIO协议转发给其他系统。2 VFBOX网关工作原理VFBOX网关是协议转换网关,是把一种协议转换成......
  • 内存压力及IO压力调整方法
    adbshellstopthermaldadbshellstopthermal-engineadbshell"echo4>/sys/devices/system/cpu/cpu0/core_ctl/min_cpus"adbshell"echo4>/sys/devices/system/cpu/cpu4/core_ctl/min_cpus"adbshell"echo1>/sys/device......
  • FEE-Frontiers in Ecology and Evolution
    @目录一、征稿简介二、重要信息三、服务简述四、投稿须知一、征稿简介二、重要信息期刊官网:https://ais.cn/u/3eEJNv三、服务简述FrontiersinEcologyandEvolution是一本经同行评议的基础科学和应用科学研究期刊,为自然和人类世界提供生态学和进化的见解。四、投稿须......