场景:centos7.6系统崩溃,机房重新开一台机器后,将这个系统崩溃机器的硬盘挂载到了新机器上面,使用fdisk -l发现,新挂的硬盘标号为/dev/sdb2,使用mount /dev/sdb2 /data会出现,
mount: unknown filesystem type 'LVM2_member'
解决方案:
需要安装 lvm2: yum -y install lvm2
1、查看物理卷:pvs
PV VG Fmt Attr PSize PFree
/dev/sdb2 centos lvm2 a-- <446.13g 0
2、查看卷组:vgs
VG #PV #LV #SN Attr VSize VFree
centos 1 2 0 wz--n- <446.13g 0
3、查看逻辑卷:lvdisplay
--- Logical volume ---
LV Path /dev/centos/swap
LV Name swap
VG Name centos
LV UUID c7BNAU-KG6d-eQwu-dz9j-lX2M-76tA-iCN5dc
LV Write Access read/write
LV Creation host, time localhost, 2022-10-28 13:16:25 +0800
LV Status NOT available
LV Size 31.50 GiB
Current LE 8064
Segments 1
Allocation inherit
Read ahead sectors auto
--- Logical volume ---
LV Path /dev/centos/root
LV Name root
VG Name centos
LV UUID 2pT6RF-CvcT-osC7-G32G-zZF0-dqJ3-p63rhI
LV Write Access read/write
LV Creation host, time localhost, 2022-10-28 13:16:26 +0800
LV Status NOT available
LV Size <414.63 GiB
Current LE 106145
Segments 2
Allocation inherit
Read ahead sectors auto
4、会发现大容量的分区为/dev/centos/root,其LV Status为NOT available,是未激活状态,需要激活逻辑卷:vgchange -ay /dev/centos/root
重新使用lvdisplay会发现LV Status变为available
5、挂载逻辑卷:mount /dev/centos/root /data