恢复 Linux 上已删除的文件:extundelete 、PhotoRec (***)

为什么Linux的命令 rm 没有回收站呢?Trash-Cli:Linux 命令行回收站工具 (***) https://blog.csdn.net/ken2232/article/details/136981360

extundelete 直接 apt 安装,运行出现段错误,网络上给出的一种解决办法,是:下载源码,重新编译。

后悔药

使用回收站,这是第一次的后悔药;

使用 extundelete 等,这是第二次的后悔药。

在正常使用场景之下,吃一次后悔药、就可以了。
还要吃第二次的话,可能就是用户自己的问题了 ?
所以不论是 windows,还是 linux,OS官方都没有提供第二次的后悔药。

命令行回收站

对于 Linux 系统,如果需要用到 命令行,那么,最好是安装 Trash-Cli 命令行回收站工具。

使用 Trash-Cli 提供的删除命令,而不是使用内核提供的 rm 删除命令。因为默认的 rm 删除的东西,不会进入回收站。

有了图形界面和命令行界面的回收站,以及注意做好备份工作,就应该差不多了吧?

用户数据的日常备份

在日常使用场景里,不应该会使用到 extundelete 等工具,假如使用到了,那么,很可能是自己的使用方法不恰当吧 ?当然硬件,或者其他不可抗拒力因素所导致的故障问题,除外。

系统的备份与恢复

一个容易使用的工具:redorescue

备份 / 恢复工具使用方法 汇总:redorescue, TimeShift, Backups(** 笔记 **) https://blog.csdn.net/ken2232/article/details/134159030

如果磁盘空间足够的话,还可以使用 timeshot, snapshot 之美的。

如果是只是日常办公用途的话,使用 mxlinux 吧,这个发行版自带了更加完善的备份功能,还可以直接将当前系统制作成 Live CD. 方便迁移到其他电脑,甚至可以直接安装得到 U盘上,随身携带。

------

PhotoRec 无法恢复文件名? 目前还在更新。

extundelete 可以恢复文件名? << 优选,但没有测试成功 xx。很早就不更新了 ?

r-linux : OK ,但要收钱

PhotoRec:恢复的文件名,差不多可以看作是流水号

Linux下面误删除文件使用extundelete工具恢复介绍  https://www.cnblogs.com/bob-yanlibo/p/8412503.html

6.使用extundelete命令进行文件和目录的恢复。

(1)通过inode号恢复(文件名会有变更);

(2)通过文件名恢复;

(3)通过目录名称恢复(空目录是不会被恢复的);

(4)恢复所有文件和目录,不包括空文件和空目录;

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

要点:

1. 为什么要 umount ?

用户自己以只读方式挂载,也是可以的。

extundelete 之类的恢复工具,在运行过程中,也是需要以只读方式来自动挂载的。

但是,当用户以可写的方式来挂载需要恢复的磁盘时,已经被删除的数据,就存在有被覆盖的风险了。

2. 回收站 + 备份,这是好的解决方法。 extundelete 之类的,是迫不得已之后的麻烦解决方案。

Ubuntu 默认的文件备份工具,还是很好用的。这是 gnome 社区的功劳。

-----------

11款最棒的Linux数据恢复工具发布啦!  https://baijiahao.baidu.com/s?id=1762503882510932808&wfr=spider&for=pc

超全!Linux 误删文件恢复命令及方法  https://blog.csdn.net/mingongge/article/details/110675523

**  https://z.itpub.net/article/detail/F5855E848778618D302CAB2A8EC4CE74

如何在Linux上恢复误删除的文件或目录  https://zhuanlan.zhihu.com/p/172520958

Ext4magic 使用的是 extundelete 内核:https://ext4magic.sourceforge.net/ext4magic_en.html

It is based on ext3grep and extundelete, but was rewritten from scratch. In addition to the tools just mentioned ext4magic

How to Recover Deleted Files on Linux

  https://www.makeuseof.com/tag/recover-deleted-files-from-your-linux-system/

*** Linux 数据文件恢复 - 完全指南  https://zhuanlan.zhihu.com/p/206675714

*** File recovery  https://wiki.archlinuxcn.org/

PhotoRec 无法恢复文件名(R-linux 可以,但好用的需要收钱。) << 恢复回来的是一大堆文件 ?不实用 ?

  https://zhuanlan.zhihu.com/p/206675714

恢复好的文件安装 directory(非文件夹) 分类, 按照 logical sector number 和 dot extension 另名.

Linux (by default)没有关于删除 logical sector 的记录所以无法通过日志取回文件名与目录信息.

你只能用文件内容获取文件名[4]

=====================================

11款最棒的Linux数据恢复工具发布啦!

  https://baijiahao.baidu.com/s?id=1762503882510932808&wfr=spider&for=pc

1.Knoppix

Knoppix是从损坏的机器中恢复数据的最佳工具之一。它有一个可引导的CD版本,友好的用户界面。它可以让你轻松安装驱动器,然后复制数据。 Knoppix自身携带了一整套的Linux命令。

官方网站:http://www.knopper.net/knoppix/index-en.html

7.System rescue CD  << 还在维护

SystemrescueCD能帮助你修复系统和数据,并且它也是一种Linux系统急救盘,可作为可引导的CD ROM和USB存储器用于管理。该软件提供了处理各种任务的工具,例如分区操作、文件恢复、硬盘测试以及硬盘格式化。此数据恢复工具还可以用于Linux和Windows电脑,无论是台式机还是服务器。

官方网站:http://www.sysresccd.org/SystemRescueCd_Homepage

8.Ubuntu rescue remix  << 很久没有维护了

Ubuntu Rescue Remix是最好的Linux数据恢复工具之一,是一种GNU/ Linux的实时系统。它简直就是数据恢复专家,配置了免费的开源数据恢复和取证工具的命令行界面环境。这个工具在恢复和救援文件、系统文件,以及修复来自非标准外部驱动器的数据时,非常有用。它可以用一种非常简单的方法恢复删除的文件。

官方网站:http://ubuntu-rescue-remix.org/

11.F-Secure Rescue CD

此Linux数据恢复工具基于Linux OS的Knnopix衍生产品,可以帮助用户从CD运行软件,并检查已安装了的应用程序的完整性。F-Secure Rescue安能让你轻松地执行高级数据修复和恢复操作。

官方网站:https://www.f-secure.com/en/web/labs_global/rescue-cd

11款最佳的Linux数据恢复工具就介绍到这里了,你的看法是什么呢?

更多Linux资讯请查看:https://www.linuxprobe.com/

extundelete

extundelete 安装

  https://wiki.archlinuxcn.org/wiki/File_recovery

能够通过official repositories安装extundeleteAUR .

Usage

Derived from the post on Linux Poison.

To recover data from a specific partition, the device name for the partition, which will be in the format /dev/sdXN (X is a letter and N is a number.), must be known. The example used here is /dev/sda4, but your system might use something different (For example, MMC card readers use /dev/mmcblkNpN as their naming scheme.) depending on your filesystem and device configuration. If you are unsure, run df, which prints currently mounted partitions.

Once which partition data is to be recovered from has been determined, simply run:

# extundelete /dev/sda4 --restore-file directory/file

Any subdirectories must be specified, and the command runs from the highest level of the partition, so, to recover a file in /home/SomeUserName/, assuming /home is on its own partition, run:

# extundelete /dev/sda4 restore-file SomeUserName/SomeFile

To speed up multi-file recovery, extundelete has a --restore-files option as well.

To recover an entire directory, run:

# extundelete /dev/sda4 --restore-directory SomeUserName/SomeDirectory

For advanced users, to manually recover blocks or inodes with extundelete, debugfs can be used to find the inode to be recovered; then, run:

# extundelete --restore-inode inode

inode stands for any valid inode. Additional inodes to recover can be listed in an unspaced, comma-separated fashion.

Finally, to recover all deleted files from an entire partition, run:

# extundelete /dev/sda4 --restore-all

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

How to use PhotoRec to Recover Deleted Files in Linux/Ubuntu  https://www.digitalocean.com/community/tutorials/photorec-recover-deleted-files-in-linux-ubuntu

安装 testdisk 时,也默认同时安装了 PhotoRec。只有 PhotoRec 才支持 ext4 ?

sudo apt -y install testdisk

  

   https://www.cgsecurity.org/wiki/PhotoRec_CN

PhotoRec 是一款用于恢复硬盘、光盘中丢失的视频、文档、压缩包等文件,或从数码相机存储卡中恢复丢失图片的数据恢复软件(因此,该软件命名为Photo Recovery这个名字)。 PhotoRec忽略文件系统,能直接从介质底层恢复数据,因此,在介质的文件系统严重破坏或被重新格式化后,它也能进行数据恢复。

PhotoRec是一款免费的开源、跨多平台的数据恢复软件,受GNU General Public License (GPLV v2+) 的保护. PhotoRec 是TestDisk的伴侣程序, Testdisk是一款支持多种文件系统的丢失分区恢复,并能修复不可启动的磁盘的数据恢复软件。 您可以从链接下载该程序.

出于安全考虑, PhotoRec以只读方式来访问您要恢复数据所在的磁盘或存储卡介质。

重要提示: 一旦发现丢失或意外删除了某个图片、文件, 请不要继续往该存储设备或磁盘保存新文件;否则您可能会覆盖原来的数据。 这意味着您在使用PhotoRec时,您千万不要将恢复的文件写入到原数据所存储的同一分区。

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

从 Ext4magic 得到的被删除文件,文件名是流水号。

从 R-Linux 得到的被删除文件,文件名的原文件名。

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

R-Linux for Linux:免费,但只能恢复磁盘根目录下的删除文件?限制了只能恢复在根目录下的被删除文件 ?

R-Undelete $54.99  << 好用。

R-Undelete 是 R-Studio 的简化版,适用于经验较少的用户。它有一个向导式用户界面和一个小的特征集。它同样也使用 IntelligentScan 技术,可以完成大多数日常数据恢复任务。您可以在反删除软件页面上查看 R-Studio 和 R-Undelete 的比较。

  https://www.r-studio.com/zhcn/free-linux-recovery/Download.shtml

请不要在已删除文件所在的同一逻辑磁盘上安装任何安装程序、保存镜像文件、写入任何信息或恢复已删除文件。如果您只有一块硬盘和逻辑分区,请访问常见问题部分,查找技术人员的建议。

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

记得删除一定要后 umount哦,不然二次写入谁也帮不了你呢。

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

要点:

1. 需要恢复数据的盘,要 umount。然后,可能是 extundelete会执行只读式的挂载操作?

2. 当一个硬盘,还不能确定其挂载在哪里时,可先执行只读挂载,然后,再卸载;之后,再执行 extundelete。

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

testdisk

How to Recover Deleted Files on Linux with testdisk

  https://www.howtogeek.com/700310/how-to-recover-deleted-files-on-linux-with-testdisk/ 

undelect 功能,好像不适合于 Linux OS,但适合 win OS。

  https://www.cgsecurity.org/wiki/TestDisk_CN

Undelete files and directories from FAT12, FAT16, FAT32 and exFAT filesystem. FAT file systems are commonly found on flash memory cards, digital cameras, and many other portable devices.

无法恢复 ext4

14 Best Free and Open Source Linux Data Recovery Tools

  https://www.linuxlinks.com/DataRecovery/

Data Recovery Tools
ddrescueGNU data recovery tool
Mondo RescueTool for configuring and maintaining network machines
Trinity Rescue KitLive distro that aims specifically at recovery and repair operations
SystemRescueSystem rescue disk
TestDiskPartition scanner and disk recovery tool
FinnixSmall, self-contained, bootable CD distro
PhotoRecDigital Picture and File Recovery
RescuezillaComplete disaster recovery solution
KnoppixNoteworthy for its collection of utilities for system repair
safecopyCopy utility ignoring errors
Redo RescueBackup and recovery solution
ForemostRecover files based on their headers, footers, and internal data structures
ScalpelData carving tool
ext4magicRecover deleted or overwritten files

This article has been revamped in line with our recent announcement.

摘录: Linux文件恢复神器:救回你的珍贵文档

  Linux文件恢复神器:救回你的珍贵文档 | 《Linux就该这么学》

市场上存在诸多Linux的文件恢复工具,根据个人的经验,我向您推荐TestDisk和PhotoRec这两类工具。TestDisk擅长于修复受损的磁盘分区表与引导记录等问题,而PhotoRec的专长在于能有效地恢复各类丢失文件。

  • 16
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值