设为首页 收藏本站
查看: 2078|回复: 0

[经验分享] vsphere虚拟机下的Linux在线移除硬盘后的报错处理(基于LVM)

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2017-2-23 09:04:22 | 显示全部楼层 |阅读模式
1)故障描述( vmware虚拟机,在线移除一块被设置为pv格式的硬盘后,提示unknown device错误):
说明:/dev/sdb1 /dev/sdc1 /dev/sdd1是组成/dev/vg_test/lvm_test的PV,这里我们模拟/dev/sdd1硬盘被直接断电了
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
[iyunv@docker mnt]# pvdisplay
  /dev/sdd: read failed after 0 of 4096 at 0: Input/output error
  /dev/sdd: read failed after 0 of 4096 at 21474770944: Input/output error
  /dev/sdd: read failed after 0 of 4096 at 21474828288: Input/output error
  /dev/sdd: read failed after 0 of 4096 at 4096: Input/output error
  /dev/sdd1: read failed after 0 of 512 at 21467824128: Input/output error
  /dev/sdd1: read failed after 0 of 512 at 21467938816: Input/output error
  /dev/sdd1: read failed after 0 of 512 at 0: Input/output error
  /dev/sdd1: read failed after 0 of 512 at 4096: Input/output error
  /dev/sdd1: read failed after 0 of 2048 at 0: Input/output error
  Couldn't find device with uuid 166hLZ-2POl-GIsv-ELGh-8YVT-Zcoa-ZcLXzp.
  --- Physical volume ---
  PV Name               /dev/sdb1
  VG Name               vg_test
  PV Size               19.99 GiB / not usable 1.43 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              5118
  Free PE               0
  Allocated PE          5118
  PV UUID               fuQdIY-qkJw-fZJB-AauO-Zqpj-91RI-S1GG0X
   
  --- Physical volume ---
  PV Name               /dev/sdc1
  VG Name               vg_test
  PV Size               19.99 GiB / not usable 1.43 MiB
  Allocatable           yes
  PE Size               4.00 MiB
  Total PE              5118
  Free PE               5116
  Allocated PE          2
  PV UUID               TRlpMQ-snM6-u24f-cMHa-oiVt-XJ3w-6fjAbp
   
  --- Physical volume ---
  PV Name               unknown device
  VG Name               vg_test
  PV Size               19.99 GiB / not usable 1.43 MiB
  Allocatable           yes
  PE Size               4.00 MiB
  Total PE              5118
  Free PE               5118
  Allocated PE          0
  PV UUID               166hLZ-2POl-GIsv-ELGh-8YVT-Zcoa-ZcLXzp



2)处理步骤:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
[iyunv@docker mnt]# vgreduce --removemissing vg_test
  /dev/sdd: read failed after 0 of 4096 at 0: Input/output error
  /dev/sdd1: read failed after 0 of 2048 at 0: Input/output error
  /dev/sdd: read failed after 0 of 4096 at 21474770944: Input/output error
  /dev/sdd: read failed after 0 of 4096 at 21474828288: Input/output error
  /dev/sdd: read failed after 0 of 4096 at 4096: Input/output error
  /dev/sdd1: read failed after 0 of 512 at 21467824128: Input/output error
  /dev/sdd1: read failed after 0 of 512 at 21467938816: Input/output error
  /dev/sdd1: read failed after 0 of 512 at 0: Input/output error
  /dev/sdd1: read failed after 0 of 512 at 4096: Input/output error
  Couldn't find device with uuid 166hLZ-2POl-GIsv-ELGh-8YVT-Zcoa-ZcLXzp.
  Wrote out consistent volume group vg_test
[iyunv@docker mnt]# vgchange -a y
  /dev/sdd: read failed after 0 of 4096 at 0: Input/output error
  /dev/sdd1: read failed after 0 of 2048 at 0: Input/output error
  1 logical volume(s) in volume group "vg_test" now active
[iyunv@docker mnt]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3             193G   14G  170G   8% /
tmpfs                 1.9G  228K  1.9G   1% /dev/shm
/dev/sda1             190M   80M  100M  45% /boot
/dev/mapper/vg_test-lvm_test
                       20G   28M   19G   1% /mnt



测试表明:整个过程都不会影响/mnt中的数据运行
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
[iyunv@docker mnt]# pvdisplay
  /dev/sdd: read failed after 0 of 4096 at 0: Input/output error
  /dev/sdd: read failed after 0 of 4096 at 21474770944: Input/output error
  /dev/sdd: read failed after 0 of 4096 at 21474828288: Input/output error
  /dev/sdd: read failed after 0 of 4096 at 4096: Input/output error
  /dev/sdd1: read failed after 0 of 512 at 21467824128: Input/output error
  /dev/sdd1: read failed after 0 of 512 at 21467938816: Input/output error
  /dev/sdd1: read failed after 0 of 512 at 0: Input/output error
  /dev/sdd1: read failed after 0 of 512 at 4096: Input/output error
  /dev/sdd1: read failed after 0 of 2048 at 0: Input/output error
  --- Physical volume ---
  PV Name               /dev/sdb1
  VG Name               vg_test
  PV Size               19.99 GiB / not usable 1.43 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              5118
  Free PE               0
  Allocated PE          5118
  PV UUID               fuQdIY-qkJw-fZJB-AauO-Zqpj-91RI-S1GG0X
   
  --- Physical volume ---
  PV Name               /dev/sdc1
  VG Name               vg_test
  PV Size               19.99 GiB / not usable 1.43 MiB
  Allocatable           yes
  PE Size               4.00 MiB
  Total PE              5118
  Free PE               5116
  Allocated PE          2
  PV UUID               TRlpMQ-snM6-u24f-cMHa-oiVt-XJ3w-6fjAbp



发现仍旧有I/O的错误出现,找到合适停机窗口,重启了系统,故障得到解决(这里注意重启前检查fstab信息,看下mount -a是否有报错)。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
[iyunv@docker ~]# pvdisplay
  --- Physical volume ---
  PV Name               /dev/sdb1
  VG Name               vg_test
  PV Size               19.99 GiB / not usable 1.43 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              5118
  Free PE               0
  Allocated PE          5118
  PV UUID               fuQdIY-qkJw-fZJB-AauO-Zqpj-91RI-S1GG0X
   
  --- Physical volume ---
  PV Name               /dev/sdc1
  VG Name               vg_test
  PV Size               19.99 GiB / not usable 1.43 MiB
  Allocatable           yes
  PE Size               4.00 MiB
  Total PE              5118
  Free PE               5116
  Allocated PE          2
  PV UUID               TRlpMQ-snM6-u24f-cMHa-oiVt-XJ3w-6fjAbp



这样,系统就已经没有报错信息了。



运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-345943-1-1.html 上篇帖子: vmware MySQL 5.7.16 for linux 实施搭建 下篇帖子: ESXI 5.1/5.5 主机添加或映射USB设备(加密狗) 虚拟机 Linux 在线
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表