Chinaunix首页 | 论坛 | 博客
  • 博客访问: 10197776
  • 博文数量: 1669
  • 博客积分: 16831
  • 博客等级: 上将
  • 技术积分: 12594
  • 用 户 组: 普通用户
  • 注册时间: 2011-02-25 07:23
个人简介

柔中带刚,刚中带柔,淫荡中富含柔和,刚猛中荡漾风骚,无坚不摧,无孔不入!

文章分类

全部博文(1669)

文章存档

2023年(4)

2022年(1)

2021年(10)

2020年(24)

2019年(4)

2018年(19)

2017年(66)

2016年(60)

2015年(49)

2014年(201)

2013年(221)

2012年(638)

2011年(372)

分类:

2012-11-30 11:30:34

RHEL 6中的 lvm恢复  

2012-11-30 11:04:20|  分类: RH133raid+lvm |  标签: |字号 


系统情况:Red Hat Enterprise Linux Server release 6.0,lvm2,ext4
原来有一个lvm分区/dev/data/ftproot挂载到/work目录下的。 周一的时候由于调休,不知道那个BT直接关机造成data_ftproot的lvm丢失

下是记录下的处理过程:
[root@localhost lvm]# vgcfgrestore -f /etc/lvm/backup/data       -t /dev/sda3
Test mode: Metadata will NOT be updated.
Couldn't find device with uuid h6t9V2-Oi08-F5kw-U2G5-vRDW-1WdJ-1awgnU.
'/etc/lvm/backup/data' does not contain volume group 'sda3'.
Restore failed.
[root@localhost lvm]# pvcreate -u h6t9V2-Oi08-F5kw-U2G5-vRDW-1WdJ-1awgnU --restorefile /etc/lvm/archive/data_00002.vg  /dev/sda3
Couldn't find device with uuid h6t9V2-Oi08-F5kw-U2G5-vRDW-1WdJ-1awgnU.
Physical volume "/dev/sda3" successfully created


[root@localhost lvm]# vgcfgrestore data
Restored volume group data


[root@localhost lvm]# vgscan && vgscan && lvscan
Reading all physical volumes. This may take a while...
Found volume group "data" using metadata type lvm2
Found volume group "vg_localhost" using metadata type lvm2
Reading all physical volumes. This may take a while...
Found volume group "data" using metadata type lvm2
Found volume group "vg_localhost" using metadata type lvm2
inactive '/dev/data/ftproot' [70.00 GiB] inherit
ACTIVE '/dev/vg_localhost/lv_root' [21.55 GiB] inherit
ACTIVE '/dev/vg_localhost/lv_swap' [1.97 GiB] inherit
You can now display the logical volumes.


[root@localhost ~]# lvs -a -o +devices
LV VG Attr LSize Origin Snap% Move Log Copy% Convert Devices
ftproot data -wi--- 70.00g /dev/sda3(0)
lv_root vg_localhost -wi-ao 21.55g /dev/sda2(0)
lv_swap vg_localhost -wi-ao 1.97g /dev/sda2(5518)


[root@link-07 backup]# lvchange -ay /dev/VG/stripe
[root@localhost ~]# lvchange -ay /dev/data/ftproot
[root@localhost ~]# lvs -a -o +devices
LV VG Attr LSize Origin Snap% Move Log Copy% Convert Devices
ftproot data -wi-a- 70.00g /dev/sda3(0)
lv_root vg_localhost -wi-ao 21.55g /dev/sda2(0)
lv_swap vg_localhost -wi-ao 1.97g /dev/sda2(5518)
[root@localhost ~]# mount -t ext4 /dev/data/ftproot /work/
mount: wrong fs type, bad option, bad superblock on /dev/mapper/data-ftproot,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so


[root@localhost ~]# dmesg | tail -10
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
SELinux: initialized (dev rpc_pipefs, type rpc_pipefs), uses genfs_contexts
SELinux: initialized (dev autofs, type autofs), uses genfs_contexts
SELinux: initialized (dev autofs, type autofs), uses genfs_contexts
SELinux: initialized (dev autofs, type autofs), uses genfs_contexts
eth3: no IPv6 routers present
eth1: no IPv6 routers present
EXT4-fs (dm-2): VFS: Can't find ext4 filesystem

至此,lvm是恢复了,但文件系统看样子是没有办法恢复了。

参考“ext3 文件系统超级块损坏的修复”对ext4不起作用,我觉得对ext3/ext2估计都差不多。

阅读(1894) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~