编程开源技术交流,分享技术与知识

网站首页 > 开源技术 正文

如何修复 LVM I/O Errors ?运维常见问题收藏!

wxchong 2024-09-04 21:32:41 开源技术 11 ℃ 0 评论

我们大多数人在系统管理中都遇到过下面提到的错误,这主要与我们在 unix 服务器上使用的可移动存储介质有关。可能是移除 disk / LUN 或者从 LVM 上卸载磁盘时没有完全 shutdown / unmount 导致的。

/dev/sdf: read failed after 0 of 4096 at 0: Input/output error

/dev/sdf: read failed after 0 of 4096 at 3298534817792: Input/output error

/dev/sdf: read failed after 0 of 4096 at 3298534875136: Input/output error

/dev/sdf: read failed after 0 of 4096 at 4096: Input/output error

/dev/sdk: read failed after 0 of 4096 at 0: Input/output error

/dev/sdk: read failed after 0 of 4096 at 6442385408: Input/output error

/dev/sdk: read failed after 0 of 4096 at 6442442752: Input/output error

/dev/sdk: read failed after 0 of 4096 at 4096: Input/output error

解决方案

  1. 运行 vgscan 命令,检查哪个 Volume Group 有问题
  2. 找出与该 Volume Group 附加的 Logical Volume
  3. Inactive Logical Volume
# lvchange -an <lv-name>
  1. Inactive Volume group
#  vgchange -an <vg-name>
  1. 再次使用 vgscan 扫描 Volume Group
  2. Activate Volume Group
# vgchange -ay <volume-group-name>
  1. 运行 lvscan 命令
  2. Activate Logical Volume
# lvchange -ay <lv-name>

注意: 在某些情况下,如果我们想再次使用相同的媒体设备,但在连接后仍然给出错误,那么我们需要手动卸载可移动设备,一段时间后再次连接,稍后按照上述步骤操作。

我的开源项目

  • course-tencent-cloud(酷瓜云课堂 - gitee 仓库)
  • course-tencent-cloud(酷瓜云课堂 - github 仓库)

Tags:

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表