本文主要是介绍linux服务器的LVM动态扩容时提示physical volumes missing,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
一.现象
公司数据库服务器磁盘空间不足,通过LVM动态扩容磁盘卷,提示physical volumes missing
二.问题处置
1.登录到服务器,通过pvs查看磁盘
[root@node1 ~]# pvsPV VG Fmt Attr PSize PFree /dev/sda2 centos lvm2 a-- 99.51g 0 /dev/sdb centos lvm2 a-m 100.00g 0 /dev/sdc centos lvm2 a-- 100.00g 0 /dev/sdd centos lvm2 a-- 30.00g 0 /dev/sde centos lvm2 a-m 100.00g 0 /dev/sdf centos lvm2 a-- 100.00g 100.00g
发现有/dev/sdb 和/dev/sde的Attr的值是a-m,磁盘missing。
2.通过pvdisplay /dev/sde查看详细信息
[root@node1 ~]# pvdisplay /dev/sde--- Physical volume ---PV Name /dev/sdeVG Name centosPV Size 100.00 GiB / not usable 4.00 MiBAllocatable yes (but full)PE Size 4.00 MiBTotal PE 25599Free PE 0Allocated PE 25599PV UUID Fb9pTJ-cTob-X3Ju-5PL8-rFVx-nP8P-kp2vcL
3.通过fdisk -l查看磁盘状态
[root@node1 ~]# fdisk -lDisk /dev/sda: 107.4 GB, 107374182400 bytes, 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000a2c52Device Boot Start End Blocks Id System
/dev/sda1 * 2048 1026047 512000 83 Linux
/dev/sda2 1026048 209715199 104344576 8e Linux LVMDisk /dev/sdc: 107.4 GB, 107374182400 bytes, 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/sdb: 107.4 GB, 107374182400 bytes, 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/sdd: 32.2 GB, 32212254720 bytes, 62914560 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/sde: 107.4 GB, 107374182400 bytes, 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/mapper/centos-swap: 8455 MB, 8455716864 bytes, 16515072 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/mapper/centos-root: 560.1 GB, 560077996032 bytes, 1093902336 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/sdf: 107.4 GB, 107374182400 bytes, 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
4.通过vgdisplay -v查看
[root@node1 ~]# vgdisplay -vUsing volume group(s) on command line.There are 2 physical volumes missing.There are 2 physical volumes missing.--- Volume group ---VG Name centosSystem ID Format lvm2Metadata Areas 6Metadata Sequence No 19VG Access read/writeVG Status resizableMAX LV 0Cur LV 2Open LV 2Max PV 0Cur PV 6Act PV 4VG Size 529.49 GiBPE Size 4.00 MiBTotal PE 135549Alloc PE / Size 109950 / 429.49 GiBFree PE / Size 25599 / 100.00 GiBVG UUID FnFLUR-njbM-M5Z6-W1A0-pere-aMaG-xRsan6--- Logical volume ---LV Path /dev/centos/swapLV Name swapVG Name centosLV UUID RHlFJS-dEz0-rTjI-SxuE-Ub8p-xcYg-Q4Idx3LV Write Access read/writeLV Creation host, time localhost, 2016-09-05 13:57:31 +0800LV Status available# open 2LV Size 7.88 GiBCurrent LE 2016Segments 1Allocation inheritRead ahead sectors auto- currently set to 8192Block device 253:0--- Logical volume ---LV Path /dev/centos/rootLV Name rootVG Name centosLV UUID TU3T6k-yIWf-DchY-fmaE-Bk00-fWEv-Uzk313LV Write Access read/writeLV Creation host, time localhost, 2016-09-05 13:57:31 +0800LV Status available# open 1LV Size 421.62 GiBCurrent LE 107934Segments 6Allocation inheritRead ahead sectors auto- currently set to 8192Block device 253:1--- Physical volumes ---PV Name /dev/sda2 PV UUID eptEUt-8gMK-iK6j-CAa2-Zue7-v4ik-gVlIGMPV Status allocatableTotal PE / Free PE 25474 / 0PV Name /dev/sdb PV UUID eH4HUJ-qYqw-aOsr-WZ5f-gIjn-mM1B-E3xpZSPV Status allocatableTotal PE / Free PE 25599 / 0PV Name /dev/sdc PV UUID 8sHF6m-gkoX-8Wrh-QEDL-nXY9-vXnc-alTSggPV Status allocatableTotal PE / Free PE 25599 / 0PV Name /dev/sdd PV UUID 07OA0J-VFL7-R5Ym-PbBx-3oHK-HYPI-8yXSg0PV Status allocatableTotal PE / Free PE 7679 / 0PV Name /dev/sde PV UUID Fb9pTJ-cTob-X3Ju-5PL8-rFVx-nP8P-kp2vcLPV Status allocatableTotal PE / Free PE 25599 / 0PV Name /dev/sdf PV UUID kGZf3L-s4xf-6X6G-6bUw-0knQ-bkJs-gtQ9kRPV Status allocatableTotal PE / Free PE 25599 / 25599
通过以上确认物理磁盘没有问题,只是LVM的VG认为磁盘丢失。
5.恢复处置
[root@node1 ~]# vgextend --restoremissing centos /dev/sdeVolume group "centos" successfully extended
通过vgextend --restoremissing centos /dev/sde即可恢复
6.使用pvs查看发现磁盘恢复正常,可以正常进行扩容LVM了
[root@node1 ~]# pvsPV VG Fmt Attr PSize PFree/dev/sda2 centos lvm2 a-- 99.51g 0 /dev/sdb centos lvm2 a-- 100.00g 0 /dev/sdc centos lvm2 a-- 100.00g 0 /dev/sdd centos lvm2 a-- 30.00g 0 /dev/sde centos lvm2 a-- 100.00g 0 /dev/sdf centos lvm2 a-- 100.00g 0
磁盘/dev/sde和/dev/sdb的Attr属性值的m已经不存在,恢复正常,可以正常针对lv进行处理了。
这篇关于linux服务器的LVM动态扩容时提示physical volumes missing的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!