linux - 如何从linux系统中恢复已删除的文件?

标签 linux command-line terminal linux-kernel

我在本地使用centos7。我错误地使用 rm 从/etc/httpd/conf.d 目录中删除了文本文件 (keystone.conf.disabled),如何恢复此文件。这个文件对我来说非常重要。请帮助我..

我尝试但徒劳无功 它正在给消息 Filesystem n

[vagrant@localhost conf.d]$ debugfs -w /dev/mapper/wks01-root
debugfs 1.42.9 (28-Dec-2013)
/dev/mapper/wks01-root: No such file or directory while opening filesystem
debugfs:  lsdel
lsdel: Filesystem not open
debugfs:  

我也尝试使用 root 用户

[vagrant@localhost conf.d]$ su
Password: 
[root@localhost conf.d]# debugfs -w /dev/mapper/wks01-root
debugfs 1.42.9 (28-Dec-2013)
/dev/mapper/wks01-root: No such file or directory while opening filesystem
debugfs:  lsdel
lsdel: Filesystem not open
debugfs:  

最佳答案

确保系统重新挂载为只读以防止释放的磁盘空间被覆盖并尝试extundelete如果您使用的是 ext3/4

为了 future ,etckeeper可能有用(从 etc 中创建一个 git 仓库并提交更改 /etc/ 的安装)

关于linux - 如何从linux系统中恢复已删除的文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30864099/

相关文章:

iphone - 使用终端/bash 更改目录中多个文件的文件扩展名?

html - 通过html运行linux命令

linux - 突触无法访问存储库

c - Linux 服务器套接字 - 错误的文件描述符

Python,并行运行命令行工具

node.js - 如何隐藏mongo终端的输出(Node.Js)

linux - 从无线设备驱动程序获取比特率的值。

linux - BASH:- 将字符串解析为单独的命令行参数

svn - 如何使 svn diff 显示远程更改?

python - 如何在 linux 终端中运行更新的 python 脚本