vsphere虚拟机下的Linux在线移除硬盘后的报错处理(基于LVM)

简介:

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
[root@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
[root@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
[root@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
[root@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
[root@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
[root@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

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











本文转自 冰冻vs西瓜 51CTO博客,原文链接:http://blog.51cto.com/molewan/1900161,如需转载请自行联系原作者
目录
相关文章
|
8月前
|
Linux 虚拟化 iOS开发
VMware Remote Console 13.0.1 for macOS, Linux, Windows - vSphere 虚拟机控制台的桌面客户端
VMware Remote Console 13.0.1 for macOS, Linux, Windows - vSphere 虚拟机控制台的桌面客户端
1851 0
VMware Remote Console 13.0.1 for macOS, Linux, Windows - vSphere 虚拟机控制台的桌面客户端
|
8月前
|
存储 Linux 文件存储
VMware vSphere Replication 9.0.4 - 虚拟机复制和数据保护
VMware vSphere Replication 9.0.4 - 虚拟机复制和数据保护
397 2
|
监控 Linux 应用服务中间件
Linux多节点多硬盘部署MinIO:分布式MinIO集群部署指南搭建高可用架构实践
通过以上步骤,已成功基于已有的 MinIO 服务,扩展为一个 MinIO 集群。该集群具有高可用性和容错性,适合生产环境使用。如果有任何问题,请检查日志或参考MinIO 官方文档。作者联系方式vx:2743642415。
4011 57
|
11月前
|
Linux 虚拟化 iOS开发
VMware Remote Console 13.0.0 for macOS, Linux, Windows - vSphere 虚拟机控制台的桌面客户端
VMware Remote Console 13.0.0 for macOS, Linux, Windows - vSphere 虚拟机控制台的桌面客户端
3013 1
VMware Remote Console 13.0.0 for macOS, Linux, Windows - vSphere 虚拟机控制台的桌面客户端
|
存储 Linux 内存技术
linux系统查看硬盘序列号
本文介绍在Linux系统中查看硬盘信息的三种方法:1) 使用`hdparm`工具,通过`sudo hdparm -i /dev/sda`获取硬盘序列号和型号;2) 使用`smartctl`工具,不仅可查序列号和型号,还能了解硬盘健康状态;3) 使用`lshw`命令显示存储设备拓扑信息。此外,提供通用技巧如用`lsblk`确认磁盘标识,及注意事项,例如管理员权限和云主机可能隐藏物理序列号等。
|
存储 API 虚拟化
VMware vSphere Replication 9.0.2.2 发布 - 虚拟机复制和数据保护
VMware vSphere Replication 9.0.2.2 发布 - 虚拟机复制和数据保护
462 2
VMware vSphere Replication 9.0.2.2 发布 - 虚拟机复制和数据保护
|
Linux 数据库
Linux中第一次使用locate命令报错?????
在Linux CentOS7系统中,使用`locate`命令时出现“command not found”错误,原因是缺少`mlocate`包。解决方法是通过`yum install mlocate -y`或`apt-get install mlocate`安装该包,并执行`updatedb`更新数据库以解决后续的“can not stat”错误。
464 9
|
存储 Linux 5G
Linux 基于 LVM 逻辑卷的磁盘管理【简明教程】
这篇文章介绍了LVM(逻辑卷管理)如何提供灵活的磁盘管理方式,允许动态调整逻辑卷的大小而不会丢失数据。
Linux 基于 LVM 逻辑卷的磁盘管理【简明教程】