linux ext3 ext4文件系统下 恢复 rm -rf 误删除文件

本文详细记录了一次误操作导致重要邮件目录被删除后,通过使用extundelete工具成功恢复文件的过程。包括准备工作、恢复流程及注意事项,为用户提供了一套完整的解决方案。
今天一时手快 rm -rf .* ,删除了一个重要邮件目录,幸好通过extundelete恢复了。
记下操作流程:
1.准备工作
主要通过
extundelete 0.2.0 完成恢复
需要依赖两个包

sudo aptitude install e2fsprogs e2fslibs-dev

下载页面http://extundelete.sourceforge.net/

快速下载: download extundelete

编译三部曲

./configure
make
sudo make install

2.如果分区已经挂载,先umount,并且在将要恢复的地方查看空间大小

df -h ./

如果你要恢复的是根目录或者系统目录就只有拿硬盘挂到另外一台电脑上操作了。

3.恢复制定分区下所有删除文件,默认恢复到执行命令的目录下,文件夹名字为RECOVERED_FILES,使用详情请参考:extundelete --help 运行的结果

sudo extundelete /dev/sda8 –restore-all

---------------------------------------------

$ extundelete --help

Usage: extundelete [options] [--] device-file

Options:

--version, -[vV] Print version and exit successfully.

--help, Print this help and exit successfully.

--superblock Print contents of superblock in addition to the rest.

If no action is specified then this option is implied.

--journal Show content of journal.

--after dtime Only process entries deleted on or after 'dtime'.

--before dtime Only process entries deleted before 'dtime'.

Actions:

--inode ino Show info on inode 'ino'.

--block blk Show info on block 'blk'.

--restore-inode ino[,ino,...]

Restore the file(s) with known inode number 'ino'.

The restored files are created in ./RESTORED_FILES

with their inode number as extension (ie, file.12345).

--restore-file 'path' Will restore file 'path'. 'path' is relative to root

of the partition and does not start with a '/' (it

must be one of the paths returned by --dump-names).

The restored file is created in the current

directory as 'RECOVERED_FILES/path'.

--restore-files 'path' Will restore files which are listed in the file 'path'.

Each filename should be in the same format as an option

to --restore-file, and there should be one per line.

--restore-all Attempts to restore everything.

-j journal Reads an external journal from the named file.

-b blocknumber Uses the backup superblock at blocknumber when opening

the file system.

-B blocksize Uses blocksize as the block size when opening the file

system. The number should be the number of bytes.

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值