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,如需转载请自行联系原作者
目录
相关文章
【YashanDB知识库】虚拟机重启后启动YMP报错
在虚拟机重启后,使用 `ymp.sh` 启动 YMP 时出现 8093 端口报错。经分析,8093 端口为 yasom 使用端口,报错原因为 yasom 进程未启动。解决方法为启动 yasom 和 yasagent 进程,命令分别为:`yasboot process yasom start -c ymp` 和 `yasboot process yasagent start -c ymp`。若提示 `yasboot` 无法识别,需先通过 `source yashan-migrate-platform/db/conf/ymp.bashrc` 设置环境变量。
|
1月前
【YashanDB 知识库】虚拟机重启后启动 YMP 报错
**标题:虚拟机重启后启动 YMP 报错** 使用 `ymp.sh` 启动 YMP 时,报 8093 端口错误。经分析,8093 端口为 yasom 使用端口,提示 yasom 进程未启动。解决方法为启动 yasom 和 yasagent 进程:`yasboot process yasom start -c ymp` 和 `yasboot process yasagent start -c ymp`。若 `yasboot` 无法识别,需先执行 `source yashan-migrate-platform/db/conf/ymp.bashrc` 设置环境变量。
|
7月前
|
存储 监控 安全
在Linux中,⼀个EXT3的文件分区,当使用touch test.file命令创建⼀个新文件时报错,报错的信息是提示磁盘已满,但是采用df -h命令查看磁盘大小时,只使用了,60%的磁盘空间,为什么会出现这个情况?
在Linux中,⼀个EXT3的文件分区,当使用touch test.file命令创建⼀个新文件时报错,报错的信息是提示磁盘已满,但是采用df -h命令查看磁盘大小时,只使用了,60%的磁盘空间,为什么会出现这个情况?
|
4月前
|
Linux 数据库
Linux中第一次使用locate命令报错?????
在Linux CentOS7系统中,使用`locate`命令时出现“command not found”错误,原因是缺少`mlocate`包。解决方法是通过`yum install mlocate -y`或`apt-get install mlocate`安装该包,并执行`updatedb`更新数据库以解决后续的“can not stat”错误。
83 9
|
5月前
|
Ubuntu Linux Windows
linux 挂载硬盘报错 "mount: unknown filesystem type 'ntfs'"
【10月更文挑战第7天】在Linux系统中挂载硬盘时遇到“mount: unknown filesystem type 'ntfs'”错误,是因为Linux默认可能不支持NTFS文件系统。本文提供了解决方案:安装NTFS-3G软件包以支持NTFS,并检查内核是否已加载NTFS模块。对于Ubuntu/Debian系统,可使用`sudo apt-get install ntfs-3g`命令;对于CentOS/RHEL系统,则需先安装EPEL仓库再安装NTFS-3G。此外,还需确认硬盘设备名正确无误,并创建合适的挂载点目录。
1311 2
|
5月前
|
Linux 测试技术 虚拟化
解决虚拟机文件因快照占用硬盘空间较多的情况(压缩虚拟机文件,节省硬盘空间)
解决虚拟机文件因快照占用硬盘空间较多的情况(压缩虚拟机文件,节省硬盘空间)
324 1
|
6月前
|
消息中间件 分布式计算 Java
Linux环境下 java程序提交spark任务到Yarn报错
Linux环境下 java程序提交spark任务到Yarn报错
77 5
|
6月前
|
Linux 编译器 开发工具
快速在linux上配置python3.x的环境以及可能报错的解决方案(python其它版本可同样方式安装)
这篇文章介绍了在Linux系统上配置Python 3.x环境的步骤,包括安装系统依赖、下载和解压Python源码、编译安装、修改环境变量,以及常见安装错误的解决方案。
629 1
|
7月前
|
虚拟化
VM虚拟机只有一个C盘怎么添加硬盘新分区盘符
关于如何在VMware虚拟机中解决只有一个C盘的问题,介绍了增加硬盘和创建新分区的方法。
VM虚拟机只有一个C盘怎么添加硬盘新分区盘符
|
7月前
|
Linux KVM 数据库
虚拟机数据恢复—Linux系统下误删除KVM虚拟机的数据恢复案例
虚拟机数据恢复环境: Linux操作系统服务器,EXT4文件系统。服务器中有数台KVM虚拟机。 虚拟机故障: KVM虚拟机被删除,需要恢复raw格式的磁盘文件。
虚拟机数据恢复—Linux系统下误删除KVM虚拟机的数据恢复案例