vsphere虛擬機下的Linux在線移除硬盤后的報錯處理(基于LVM)

1)故障描述( vmware虛擬機,在線移除一塊被設置為pv格式的硬盤后,提示unknown device錯誤):

說明:/dev/sdb1 /dev/sdc1 /dev/sdd1是組成/dev/vg_test/lvm_test的PV,這里我們模擬/dev/sdd1硬盤被直接斷電了

[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)處理步驟:

[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中的數據運行

[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是否有報錯)。

[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

這樣,系統就已經沒有報錯信息了。

原創文章,作者:Net21-冰凍vs西瓜,如若轉載,請注明出處:http://www.www58058.com/26670

(1)
Net21-冰凍vs西瓜Net21-冰凍vs西瓜
上一篇 2016-07-29 15:23
下一篇 2016-07-29 15:23

相關推薦

  • 單引號,雙引號,反引號的作用(首篇)

    哈哈哈!這是我的博客生涯的開始,也是我學習Linux的開始,所以我將勵志成為一名老司機帶你裝X帶你飛。 1.首先是三兄弟中的單引號,它的作用只是單純的呈現出自己所包含的文字并不能執行其中的命令,所以它也是三兄弟中最笨的那個,作用單一,簡單。 2,再來介紹介紹雙引號,他的作用和單引號大同小異,它能包含單引號,反引號,以及除了執行以$和\的字符為首的函數能認識之…

    2017-07-11
  • 利用keepalived實現主/從和主/主模式的高性能負載均衡集群

    要求: 1、使用nginx的反向代理功能實現負載均衡 2、keepalived實現高可用 ???????第一組的虛擬地址為172.16.1.100 ????????????D設備的優先級高 ???????第二組的虛擬地址為172.16.1.110 ????????????E設備的優先級高 3、分別實現主/從和主/主兩種配置 集群拓撲: ? ? ? 第一種:主…

    2017-06-25
  • Linux網絡屬性配置,計算機基礎

    Linux網絡屬性配置,計算機基礎 Linux網絡屬性配置(1): 計算機網絡通信:TCP/IP 通過流式化數據相互通信,通過雙方一致的時鐘頻率來完成信號傳輸; 有兩種方式傳輸:同步傳輸,異步傳輸; 借助于介質傳輸:同軸電纜、網線、無線等; 要想相互通信,也要必須遵循一種(復雜)組織機制,就產生了協議; 通過把協議分層,來分別解決傳輸過程中各種復雜的操作; …

    Linux干貨 2016-09-05
  • 用戶、組及權限管理詳解

    用戶類別:Liunx中用戶標識范圍在0-65535之間; 超級用戶(管理員) —— 默認為root,擁有所有權限。UID與GID值為0, 普通用戶 系統用戶 —— CentOS6中UID與GID值為1~499,CentOS7中UID與GID值為1~999。默認不能登錄系統,存在主要是滿足系統進程對文件屬主的需求; 登錄用戶 —— CentOS6中UID與GI…

    2018-03-08
  • 馬哥教育網絡班22期+第13周課程練習

    1、建立samba共享,共享目錄為/data,要求:(描述完整的過程)   1)共享名為shared,工作組為magedu;   2)添加組develop,添加用戶gentoo,centos和ubuntu,其中gentoo和centos以develop為附加組,ubuntu不屬于develop組;密碼均為用戶名; &n…

    Linux干貨 2016-12-05
  • 初識Linux

    一,計算機的組成和功能 計算機主要由四個部分組成,內存、緩存、CPU和寄存器。其中緩存及其重要,為CPU和內存之間的緩存,寄存器存放指令,CPU負責執行指令。內存是與CPU進行溝通的橋梁。計算機中所有程序的運行都是在內存中進行的,因此內存的性能對計算機的影響非常大。 二,Linux的主流發行版本 Linux的發行版有數百種之多,其中主流的三種為: Debia…

    Linux干貨 2017-12-04
欧美性久久久久