Problem Description: Company data hadoop2 large cloud server server using telecommunications, and later failures, telecommunication recover the server, you need to re-deploy the program, the need to expand lvm partition, but the use of pvsan command found in the error message, you need to solve the case after the restart, because mount the problem can not be started
Before failure: the machine is a 2, 3, and other data servers disposed NTU as large as a data server, there are mounted two hard disks, VDA and VDB.
Wherein vda500g, vdb10T. As used are as lvm, VDA five partitions wherein vda2, vda3, vda5, vdb are as pv, vg added to the named centos, lvm partition table, and the table is as follows:
[root@hadoop1 ~]# fdisk -l /dev/vda
Disk /dev/vda: 536.9 GB, 536870912000 bytes, 1048576000 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: 0x000c27c8
Device Boot Start End Blocks Id System
/dev/vda1 2048 1026047 512000 83 Linux
/dev/vda2 1028096 105885695 52428800 83 Linux
/dev/vda3 105886718 1015935546 455024414+ 83 Linux
/dev/vda4 1015937024 1048575999 16319488 f W95 Ext'd (LBA)
/dev/vda5 1015939072 1048575999 16318464 83 Linux
[root@hadoop1 ~]# fdisk -l /dev/vdb
Disk /dev/vdb: 10737.4 GB, 10737418240000 bytes, 20971520000 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
[root@hadoop1 ~]# vgs
VG #PV #LV #SN Attr VSize VFree
centos 4 3 0 wz--n- 10.25t 0
[root@hadoop1 ~]# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
home centos -wi-ao---- 2.38t
root centos -wi-ao---- 7.86t
swap centos -wi-ao---- 15.50g
[root@hadoop1 ~]# vgs
VG #PV #LV #SN Attr VSize VFree
centos 4 3 0 wz--n- 10.25t 0
[root@hadoop1 ~]# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
home centos -wi-ao---- 2.38t
root centos -wi-ao---- 7.86t
swap centos -wi-ao---- 15.50g
But after hadoop2 telecom recovery, we found vda hard disk becomes small as 100g, while only two partitions vda1, vda2, actually, only vda2, vdb added as pv to the centos vg group, but the original lvm table has not changed, and in resulting in an error. As follows:
[root@hadoop2 ~]# fdisk -l
Disk /dev/vda: 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: 0x0003b4ac
Device Boot Start End Blocks Id System
/dev/vda1 * 2048 1026047 512000 83 Linux
/dev/vda2 1026048 209715199 104344576 8e Linux LVM
Disk /dev/vdb: 10737.4 GB, 10737418240000 bytes, 20971520000 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
Because the system is new, and no business data, so it is relatively easy to solve. (Data backup if the production environment, before the operation)
vgreduce --removemissing --force centos centos group vg forced to delete errors in the information pv
vgscan --partial vg repair information table
lvscan --partial lv repair information table
Then restart the server
And then found lvm table information has been normal
[root@hadoop2 ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/vda2 centos lvm2 a-- 99.51g 0
/dev/vdb centos lvm2 a-- 9.77t 100.06g
Then complete expansion lvm system mount according to step