linux – Rescue disk无法看到lvm物理卷

前端之家收集整理的这篇文章主要介绍了linux – Rescue disk无法看到lvm物理卷前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我们有一个系统设置为具有冗余文件系统,包括启动分区.我们现在处于这一点,系统无法在任何启动分区上正确启动.启动时,它说无法找到卷组.

在CentOS救援磁盘上启动时,fdisk -l会看到所有分区:

第一次袭击有
/ dev / sda1启动
/ dev / sda2 swap
/ dev / sda3 LVM

第二次袭击有
/ dev / sdc1启动
/ dev / sdc2 swap
/ dev / sdc3 LVM

raid磁盘上还有第3个LVM,仅用于存储数据.这也没有被阅读.

运行pvscan时,它显示“找不到匹配的物理卷”.有没有办法看到为什么它不能识别LVM物理卷?

解决方法

vgscan -vvvv

将为您提供非常广泛的输出,说明为什么vgscan会将任何特定卷视为卷组的一部分.您还可以运行pvs -a来查看物理卷的摘要以及卷组分配.

vgscan -vvvv output for one of the partitions:

Opened /dev/sdc3 RO /dev/sdc3: size is 3772817055 sectors 
Closed /dev/sdc3 /dev/sdc3: size is 3772817055 sectors 
Opened /dev/sdc3 RO O_DIRECT /dev/sdc3: block size is 512 bytes 
Closed /dev/sdc3 Using /dev/sdc3 
Opened /dev/sdc3 RO O_DIRECT /dev/sdc3: block size is 512 bytes 
/dev/sdc3: No label detected
Closed /dev/sdc3

pvs -a didn’t reveal anything. All physical volumes listed without a volume group assignment

“没有检测到标签”听起来很可悲.您确定它是LVM2分区而不是md-raid使用的分区吗?您可以使用mdadm –examine / dev / sdc3进行检查.请发布fdisk -l / dev / sdc

Yes I’m sure it is an LVM2 partition. The mdadm command gives “No md superblock detectd on /dev/sdc3”
The fdisk says /dev/sdc3 is a Linux LVM partition.

啊,那么你将处于幸运的位置(这里很讽刺,对不起)尝试LVM恢复,因为可能会损坏数据结构.有一个howto about LVM recovery可能会给你一个起点 – 尝试从磁盘本身(使用dd if = / dev / sdc3 bs = 512 count = 255 skip = 1)或从/ etc / lvm / backup加载VG配置您以前的根文件系统的文件夹(我理解在/ dev / sdc1上)到/ etc / lvm / backup /并重新发出vgscan命令.

I tried that on both sda3 and sdc3 (as you can see,I have 3 lvm partitions to do this too) and they all result in binary files in the output text file.
Ok,correction. There is some lvm Meta data in the file,but it’s several bytes into the file. I’m looking through the data,but it looks correct. I will keep trying to go through that restore process.

这是预期的 – VG和LV配置都是二进制结构中的明文.

I ended up using a slightly modified process than what was outlined here. I ended up making a cfgbackup file from the byte data in the LVM,do a pvcreate,then a vgcfgrestore. After that,it worked. Thanks for the help.

原文链接:https://www.f2er.com/linux/398527.html

猜你在找的Linux相关文章