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,如需转载请自行联系原作者
目录
相关文章
|
7月前
|
Linux 虚拟化 iOS开发
VMware Remote Console 13.0.1 for macOS, Linux, Windows - vSphere 虚拟机控制台的桌面客户端
VMware Remote Console 13.0.1 for macOS, Linux, Windows - vSphere 虚拟机控制台的桌面客户端
1678 0
VMware Remote Console 13.0.1 for macOS, Linux, Windows - vSphere 虚拟机控制台的桌面客户端
|
12月前
|
Linux 虚拟化 iOS开发
Rocky Linux 10 x86_64 OVF (sysin) - VMware 虚拟机模板
Rocky Linux 10 x86_64 OVF (sysin) - VMware 虚拟机模板
798 35
Rocky Linux 10 x86_64 OVF (sysin) - VMware 虚拟机模板
|
12月前
|
Linux 虚拟化 iOS开发
Rocky Linux 10 aarch64 OVF (sysin) - Apple silicon VMware 虚拟机模板
Rocky Linux 10 aarch64 OVF (sysin) - Apple silicon VMware 虚拟机模板
503 34
Rocky Linux 10 aarch64 OVF (sysin) - Apple silicon VMware 虚拟机模板
|
10月前
|
Linux 虚拟化 iOS开发
VMware Remote Console 13.0.0 for macOS, Linux, Windows - vSphere 虚拟机控制台的桌面客户端
VMware Remote Console 13.0.0 for macOS, Linux, Windows - vSphere 虚拟机控制台的桌面客户端
2653 0
VMware Remote Console 13.0.0 for macOS, Linux, Windows - vSphere 虚拟机控制台的桌面客户端
|
11月前
|
存储 Linux 内存技术
linux系统查看硬盘序列号
本文介绍在Linux系统中查看硬盘信息的三种方法:1) 使用`hdparm`工具,通过`sudo hdparm -i /dev/sda`获取硬盘序列号和型号;2) 使用`smartctl`工具,不仅可查序列号和型号,还能了解硬盘健康状态;3) 使用`lshw`命令显示存储设备拓扑信息。此外,提供通用技巧如用`lsblk`确认磁盘标识,及注意事项,例如管理员权限和云主机可能隐藏物理序列号等。
|
存储 Linux 5G
Linux 基于 LVM 逻辑卷的磁盘管理【简明教程】
这篇文章介绍了LVM(逻辑卷管理)如何提供灵活的磁盘管理方式,允许动态调整逻辑卷的大小而不会丢失数据。
Linux 基于 LVM 逻辑卷的磁盘管理【简明教程】
|
存储 监控 Linux
在Linux中,如何使用LVM管理逻辑卷?
在Linux中,如何使用LVM管理逻辑卷?
|
存储 数据挖掘 Linux
在Linux中,LVM(逻辑卷管理)的主要优势是什么?如何扩展LVM卷?
在Linux中,LVM(逻辑卷管理)的主要优势是什么?如何扩展LVM卷?
|
Linux KVM 虚拟化
【Linux系统KVM虚拟机实战】LVM逻辑卷之扩展Swap交换分区
【Linux系统KVM虚拟机实战】LVM逻辑卷之扩展Swap交换分区
760 1