如何恢复丢失的逻辑卷

由于clvmd拖延内核( https://serverfault.com/questions/226466/lvm-running-vgscan-causes-clvmd-to-block )我决定硬重启主机,因为软重启停滞。 但是启动时,无法在其中一个逻辑卷上运行e2fsck,然后无法启动。 下面的错误消息我手动input,因为我不能复制和粘贴,因为从串行控制台。

Checking filessytems /dev/mapper/vg_gothamdb1-lv_root: clean, 59708/5120000 files, 712853/20480000 blocks /dev/sda1: clean, 39/128016 files, 51688/512000 blocks fsck.ext4: No such files or directory while trying to open /dev/mapper/vg_gothamdb1-lv_home /dev/mapper/vg_gothamdb1-lvhome: The superblock could not be read or does not describe a correct ext2 filesystem. if the device is valid and it really contains an ext2 filesystem (and not swap or ufs or something else), then the superblock is corrupt, and you might try running e2fsck with and alternate superblock: 

请注意,我在此设置中有2个卷组。 其中之一是集群的一部分。 另一个包含home,root和swap的逻辑卷。 换句话说,布局看起来像这样:

 vg1: lv_root lv_home lv_swap vg2 (part of a cluster): lv_stuff 

奇怪的是,即使lv_home不在群集中的卷组中,它也会被塞满。

我怎样才能解决这个问题? lv_home应该作为逻辑卷存在。 我只想恢复lv_home。

我不敢回答,因为这听起来像是clvm特定的,我不知道clvm。 但是我不会认为即使是使用单个节点的情况下,与clvm层一起工作的东西也不会起作用。 (编辑:我看到这个VG是在集群之外)

现在,对于一些非特定的build议:保持一切只读(自然),如果您最近对卷进行了任何更改,则会在/etc/lvm/{backup,archive}find以前版式的/etc/lvm/{backup,archive} 。 这些应用与vgcfgrestore --file /path/to/backup vg 。 一个是你目前的configuration,其余的只有在lvm元数据丢失,擦除或不同步时才有用。 在尝试回滚之前,请检查date是否合理,并与您当前的configuration进行比较(对某个外部位置执行vgcfgbackup)。