Centos救援模式挂载lvm的方法

进入到系统救援模式的命令行界面,这时你可以遇到一个问题,就是 linux 系统自动无法挂载到 /mnt/sysroot/上面。

1
2
3
you don't have any Linux partitions,
Press return to get a shell.
Thesystem will reboot automatically when you exit from the shell.

手动挂载也会提示出错。

1
2
mount /dev/sdb1 /mnt/sysimage/
mount unknown filesystem type ‘lvm2_member’

查看当前逻辑卷。

1
lvdisplay | less

查看VG Name(激活逻辑卷用)和LV Name(挂载用)后面对应的值,我这里是vg_troubleshoot和/dev/vg_troubleshoot/lv_root。 激活逻辑卷(后面这个路径可能不存在,直接运行即可):

1
vgchange -ay /dev/vg_troubleshoot

重新挂载。

1
mount /dev/vg_troubleshoot/lv_root /mnt/sysimage/

挂载成功。