pvdisplay pvname显示[unknown] 问题解决
问题描述
lv挂载目录消失,lvs查看
lvs
WARNING: Couldn't find device with uuid oKD1Yo-I8Oe-6KX4-AsUJ-zrdJ-rhGP-QL9viO.
WARNING: VG VolGroup01 is missing PV oKD1Yo-I8Oe-6KX4-AsUJ-zrdJ-rhGP-QL9viO (last written to [unknown]).
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
LVdata VolGroup01 -wi-----p- 699.99g
vgs
WARNING: Couldn't find device with uuid oKD1Yo-I8Oe-6KX4-AsUJ-zrdJ-rhGP-QL9viO.
WARNING: VG VolGroup01 is missing PV oKD1Yo-I8Oe-6KX4-AsUJ-zrdJ-rhGP-QL9viO (last written to [unknown]).
VG #PV #LV #SN Attr VSize VFree
VolGroup01 3 1 0 wz-pn- <999.99g <300.00g
pvs
WARNING: Couldn't find device with uuid oKD1Yo-I8Oe-6KX4-AsUJ-zrdJ-rhGP-QL9viO.
WARNING: VG VolGroup01 is missing PV oKD1Yo-I8Oe-6KX4-AsUJ-zrdJ-rhGP-QL9viO (last written to [unknown]).
PV VG Fmt Attr PSize PFree
/dev/vdb VolGroup01 lvm2 a-- <200.00g 0
/dev/vdd VolGroup01 lvm2 a-- <300.00g <300.00g
[unknown] VolGroup01 lvm2 a-m <500.00g 0
lsblk,vdc原本是500G,由于直接增加vdc磁盘,导致pv加载失败
vdb 252:16 0 200G 0 disk
vdc 252:32 0 800G 0 disk
vdd 252:48 0 300G 0 disk
原因分析:
大概可知由于在vdc上直接增加了磁盘容量,而vdc又是整盘加载到vg的,所以导致vg中有一个vdc相关pv无法识别,导致lv挂载失败
解决方案:
- 根据pv文件重新创建pv,pv文件一般存储在/etc/lvm/backup/下面
- 刷新vg卷组
- 重新挂载lv
## 重新创建pv
pvcreate /dev/vdc -u oKD1Yo-I8Oe-6KX4-AsUJ-zrdJ-rhGP-QL9viO --restorefile /etc/lvm/backup/VolGroup01
## 刷新pv卷组
vgchange -ay VolGroup01 --activationmode partial
## lv挂载到/data目录
mount /dev/mapper/VolGroup01-LVdata /data
结论:
经过上述方法,数据恢复,未有丢失。恢复过程建议停止相关业务避免数据差异。恢复过程大概5分钟。