很杯具的一个问题,一时手快,用rm -rf 删除了文件,所以有了这篇文章的痛苦过程。不是很完善,只是简单记录了过程。建议大家不用rm -rf 这个命令。否则有一天会后悔的。以下就是清洗杯具的一些记录:
yum -y install texinfo-tex
yum -y install lvm2
yum install e2fsprogs e2fsprogs-devel e2fsprogs-libs
遇到下面的问题,参考了:http://hi.baidu.com/williwill/item/7a36fdd92340b2ee55347f13 如下:
利用U盘系统,挂载硬盘出现:mount: unknown filesystem type 'LVM2_member'
解决办法:
需要安装 lvm2
然后按一下步骤:
1、查看物理卷:pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 VolGroup00 lvm2 a- 279.22G 32.00M
2、查看卷组:vgs
VG #PV #LV #SN Attr VSize VFree
VolGroup00 1 4 0 wz--n- 279.22G 32.00M
3、查看逻辑卷:lvdisplay
--- Logical volume ---
LV Name /dev/VolGroup00/LogVol03
VG Name VolGroup00
LV UUID YhG8Fu-ZGPk-qt8D-AxgC-DzOU-dg1F-z71feI
LV Write Access read/write
LV Status unenable
# open 1
LV Size 245.97 GB
Current LE 7871
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:2
4、如未激活,需要激活逻辑卷:vgchange -ay /dev/VolGroup00
LV Status available
5、挂载逻辑卷:mount /dev/VolGroup00/LogVol03 /home/lvm
ext3/4文件系统下用rm -rf 删除文件的恢复
准备工作
主要通过 extundelete 0.2.0完成恢复
官网:http://extundelete.sourceforge.net/
下载地址:http://sourceforge.net/projects/extundelete/files/extundelete/0.2.0/extundelete-0.2.0.tar.bz2/download
需要依赖两个包
下载地址:http://sourceforge.net/projects/e2fsprogs/files/e2fsprogs/1.41.14/e2fsprogs-1.41.14.tar.gz/download
下载地址:
http://sourceforge.net/projects/e2fsprogs/files/e2fsprogs/1.41.14/e2fsprogs-libs-1.41.14.tar.gz/download
按e2fsprogs--e2fsprogs-libs--extundelete的顺序逐一编译安装:
./configure
make
make install
必须先umount要恢复文件的分区或者把分区改为只读模式,命令:mount –o remout,ro 分区(例如:dev/hda1)
参数解析:
Below is an explanation of the command-line options recognized by extundelete 0.2.0.
--version
Prints the version number of extundelete.
--help
Prints a brief usage summary for extundelete.
Partition name
Name of the partition that has deleted files, such as /dev/sda3. Could also be the file name of a copy of the partition, such as that made with dd.
--superblock
Prints information about the filesystem from the superblock.
--journal --superblock
Prints information about the journal from the journal's superblock.
--inode #
Prints the information from the inode number of the filesystem given, such as "--inode 2".