简述:某天TrueNAS无故宕机,经检查服务器内存检测失败(32G只识别了16G),除灰,重插内存,系统启动成功,登录后池error,手动导入报错。
- 问题
借图,本地报错与该图一致,导入池错误代码参考代码块
错误: 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',)
- 处理方法
命令方式导入池
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祝各位好运,天天发财。