1
2
3
4
5
6
7
8
9 [root@node4 ~]# mkdir /lvmTest
[root@node4 ~]# mount /dev/vgTest/lvTest /lvmTest/
[root@node4 ~]# cd /lvmTest/
[root@node4 lvmTest]# ls
lost+found
[root@node4 lvmTest]# echo "ac" > ac
[root@node4 lvmTest]# cat ac
ac
[root@node4 lvmTest]#
将卷组中坏掉的物理卷(/dev/sdc)移除:
[root@node4 lvmTest]# vgdisplay
Couldn't find device with uuid zecO8D-2Suc-rnmK-a2Z7-6613-Zy1X-whVS0X.
--- Volume group ---
VG Name vgTest
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 3
Act PV 2
VG Size 5.99 GiB
PE Size 4.00 MiB
Total PE 1533
Alloc PE / Size 513 / 2.00 GiB
Free PE / Size 1020 / 3.98 GiB
VG UUID 1qzO3A-Tjvi-by9l-Oq49-byz3-tIkx-rfSqex
[root@node4 lvmTest]# vgreduce --removemissing --force vgTest
Couldn't find device with uuid zecO8D-2Suc-rnmK-a2Z7-6613-Zy1X-whVS0X.
Wrote out consistent volume group vgTest
[root@node4 lvmTest]#
5、向卷组中加入新的物理卷(/dev/sde):
[root@node4 lvmTest]# vgextend vgTest /dev/sde
Volume group "vgTest" successfully extended
[root@node4 lvmTest]#
6、进行数据恢复(过程中无须解除逻辑卷的挂载)