ddrescue_如何使用ddrescue命令恢复数据?

ddrescue

ddrescue

ddrescue is a GNU provided data recovery tool.It can copy and recover file, directory or whole hard drive. The best part of the ddrescue is it can prevent or solve read errors.

ddrescue是GNU提供的数据恢复工具,它可以复制和恢复文件,目录或整个硬盘驱动器。 ddrescue最好的部分是它可以防止或解决读取错误。

为Ubuntu,Debian,Kali和Mint安装 (Install For Ubuntu, Debian, Kali and Mint)

We can install ddrescue tool for deb based distributions like below. ddrescue command is provided with package name gddrescue.

我们可以为基于deb的发行版安装ddrescue工具,如下所示。 ddrescue命令与软件包名称gddrescue

$ sudo apt install gddrescue
Install For Ubuntu, Debian, Kali and Mint
Install For Ubuntu, Debian, Kali and Mint
为Ubuntu,Debian,Kali和Mint安装

列出硬盘(List Hard Drives)

Before rescuing or copying files and directories we generally need to list hard drives so we will be sure that which is the source and which is the destination drive with its path. We will list drives with fdisk command.

在抢救或复制文件和目录之前,我们通常需要列出硬盘驱动器,以便我们确定哪个是源驱动器,哪个是目标驱动器及其路径。 我们将使用fdisk命令列出驱动器。

$ sudo fdisk -l
List Hard Drives
List Hard Drives
列出硬盘

复制单个文件(Copy Single File)

We will start with a simple copying file example we will copy file named Data. This option do not needs any option.

我们将从一个简单的复制文件示例开始,我们将复制名为Data文件。 此选项不需要任何选项。

$ ddrescue Data /home/ismail/backup/Data
Copy Single File
Copy Single File
复制单个文件

As we can see there is a lot of information about the single file copy and rescue operation. One of the most important output is that the Finished which means it is successfully finished copying file.

如我们所见,有很多关于单文件复制和救援操作的信息。 最重要的输出之一是Finished ,这意味着它已成功完成复制文件。

复制单个目录 (Copy Single Directory)

We can also copy a directory with the same syntax as file. We will copy directory named backup to the /mnt/ where we have mounted our tape.

我们还可以使用与文件相同的语法复制目录。 我们会将名为backup的目录复制到安装磁带的/mnt/中。

$ ddrescue backup /mnt/backup

将日志保存到文件 (Save Log to File)

During the copy and backup operation some logs are created for troubleshoot or review. By default these logs are not created but we can save these logs into a file. We will add the log file path and name after source and destination. In this example we will write log file current working directory as ddrescu.log name.

在复制和备份操作期间,将创建一些日志以进行故障排除或查看。 默认情况下,不会创建这些日志,但是我们可以将这些日志保存到文件中。 我们将在源和目标之后添加日志文件的路径和名称。 在此示例中,我们将日志文件当前工作目录写为ddrescu.log名称。

$ ddrescue Data /home/ismail/backup/Data ddrescue.log
Save Log to File
Save Log to File
将日志保存到文件

设置最大读取速率或速度(Set Maximum Read Rate or Speed)

While copying or backup we may need to set some maximumu for read operating because of the operational issues. We can set maximum speed for read operation from source. We will use -Z or --max-read-rate=. In this example we will set 10 megabyte.

在复制或备份时,由于操作问题,我们可能需要为读取操作设置一些最大值。 我们可以设置从源读取操作的最大速度。 我们将使用-Z--max-read-rate= 。 在此示例中,我们将设置10 MB。

$ ddrescue -Z 10M Data /home/ismail/backup/Data
LEARN MORE  How To Mount Ext4 With Alternative Super Block In Linux?
了解更多如何在Linux中用替代的超级块挂载Ext4?

翻译自: https://www.poftut.com/recover-data-ddrescue-command/

ddrescue

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值