Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1592947
  • 博文数量: 317
  • 博客积分: 10283
  • 博客等级: 上将
  • 技术积分: 3566
  • 用 户 组: 普通用户
  • 注册时间: 2007-09-04 11:38
个人简介

哥使用Linux

文章分类

全部博文(317)

分类: LINUX

2011-08-05 16:07:49

系统情况:Red Hat Enterprise Linux Server release 6.0,lvm2,ext4
原来有一个lvm分区/dev/data/ftproot挂载到/work目录下的。 周一的时候由于调休,不知道那个BT直接关机造成data_ftproot的lvm丢失
 
下是记录下的处理过程:
 
  1. [root@localhost lvm]# vgcfgrestore -f /etc/lvm/backup/data -t /dev/sda3
  2.   Test mode: Metadata will NOT be updated.
  3.   Couldn't find device with uuid h6t9V2-Oi08-F5kw-U2G5-vRDW-1WdJ-1awgnU.
  4.   '/etc/lvm/backup/data' does not contain volume group 'sda3'.
  5.   Restore failed.

  6. [root@localhost lvm]# pvcreate -u h6t9V2-Oi08-F5kw-U2G5-vRDW-1WdJ-1awgnU --restorefile /etc/lvm/archive/data_00002.vg /dev/sda3
  7.   Couldn't find device with uuid h6t9V2-Oi08-F5kw-U2G5-vRDW-1WdJ-1awgnU.
  8.   Physical volume "/dev/sda3" successfully created

  9. [root@localhost lvm]# vgcfgrestore data
  10.   Restored volume group data
  11. [root@localhost lvm]# vgscan && vgscan && lvscan
  12.   Reading all physical volumes. This may take a while...
  13.   Found volume group "data" using metadata type lvm2
  14.   Found volume group "vg_localhost" using metadata type lvm2
  15.   Reading all physical volumes. This may take a while...
  16.   Found volume group "data" using metadata type lvm2
  17.   Found volume group "vg_localhost" using metadata type lvm2
  18.   inactive '/dev/data/ftproot' [70.00 GiB] inherit
  19.   ACTIVE '/dev/vg_localhost/lv_root' [21.55 GiB] inherit
  20.   ACTIVE '/dev/vg_localhost/lv_swap' [1.97 GiB] inherit


  21. You can now display the logical volumes.

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


  27. [root@link-07 backup]# lvchange -ay /dev/VG/stripe
  28. [root@localhost ~]# lvchange -ay /dev/data/ftproot
  29. [root@localhost ~]# lvs -a -o +devices
  30.   LV VG Attr LSize Origin Snap% Move Log Copy% Convert Devices
  31.   ftproot data -wi-a- 70.00g /dev/sda3(0)
  32.   lv_root vg_localhost -wi-ao 21.55g /dev/sda2(0)
  33.   lv_swap vg_localhost -wi-ao 1.97g /dev/sda2(5518)


  34. [root@localhost ~]# mount -t ext4 /dev/data/ftproot /work/
  35. mount: wrong fs type, bad option, bad superblock on /dev/mapper/data-ftproot,
  36.        missing codepage or helper program, or other error
  37.        In some cases useful info is found in syslog - try
  38.        dmesg | tail or so

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


至此,lvm是恢复了,但文件系统看样子是没有办法恢复了。参考“ext3 文件系统超级块损坏的修复”对ext4不起作用,我觉得对ext3/ext2估计都差不多。

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