Close Menu
    X (Twitter)
    Hectic GeekHectic Geek
    • Apps
      • Apps for Mac
      • Apps for PCs
      • Best Apps
    • Concepts
      • Comparison
      • For Geeks
      • IT Careers
    • Gadgets
      • Accessories
      • Best Work Laptops
      • Budget Laptops
    • GNU/Linux
      • Ubuntu
    • How To
      • Virtualization
      • Windows
      • Windows How-To
    Hectic GeekHectic Geek
    Home » Ddrescue: Data Recovery tool for Ubuntu Linux (CLI)
    Ubuntu

    Ddrescue: Data Recovery tool for Ubuntu Linux (CLI)

    GayanBy GayanMay 9, 2012Updated:October 2, 20122 Comments4 Mins Read
    Twitter Reddit Telegram WhatsApp Email
    Share
    Twitter Reddit Telegram WhatsApp Email

    “Ddrescue” is  command-line based (easy to use) data recover tool for the GNU/Linux platform, that lets you recover data from devices such optical discs Hard disk drives. If your default file copy tool gives you read-errors and cannot copy files, then “Ddrescue” might be able to help you out.

    But please be aware that, depending on the size of the damage (say that you have a disc with lots of scratches etc), it might or might not be able to fully recover the data. But one advantages of using such a tool is that, it lets you “skip” the sectors with read-errors and copy the rest of the file.

    This however, is not always useful while recovering highly sensitive data (such as a software utility for instance), as in those cases, there shouldn’t be any corrupted data whatsoever.

    But, for other file types such as videos for example, lacking few sectors (data) wouldn’t hurt at all (most of the time). Though you will have few glitches while playing those sectors, but assuming the damage is small, then it should be watchable. But, it’s impossible with the file copy tool that comes with your OS, as it just stops copying the file as soon as a read-error is detected.

    An output that “ddrescue” gives you when running …

    Now, I have this somewhat, troublesome video disk with few bad sectors and decided to put it to the test using “Ddrescue”, in Ubuntu :). Did it recover it? Not completely (it failed to read few sectors and skipped few Megabytes as a result), and the video even lacked few minutes in the middle. Still, I was able to watch it, where it was impossible before (other than manually skipping those frames in “mplayer”).

    But, if your media is not heavily damaged, then who knows, “Ddrescue” might even be able to recover data completely.

    Few main features …

    *. Supports both fixed disks (such as Hard disk drives and partitions) and optical discs.

    *. Attempts to read the discs, even if they’re not mountable.

    *. Copy the whole partition/disc into a disc image or, you can recover individual files as well.

    *. “Resuming” is supported: if you cancel the data recovery process at one point, then the next time you try to recover the same file, “Ddrescue” will resume from that last position!, saving both time and hassle (a lot of it :D).

    *. As you can see from the above screenshot, it outputs some info while recovering such as: rescued data (in “Kilobytes”), amount of errors, size of the total errors, current and average read speed etc.

    *. You can change the buffer-size, direct device access, enable/disable data “filling” (unless you enable this feature, it won’t fill bad sectors with “zero bytes” and only marks them as bad-sectors), maximum amount of read-attempts and few other options which are intended towards advanced users.

    You can install “Ddrescue” in Ubuntu 12.04 Precise Pangolin, 11.10 Oneiric Ocelot, 11.04, 10.10 and 10.04 (already has a package for 12.10 too) by using the below command in your Terminal window.

    sudo apt-get install gddrescue

    Few simple examples …

    The basic usage of “ddrescue” is as follows.

    ddrescue input-file-path output-file-path logfile

    But to clear few things, let me give you an example.

    Say that I have an optical disc mounted as “my_disc” (by default in the “/media” folder) and need to recover a file called “my_video.mp4” inside it. Then to attempt a recovery with “ddrescue” and to save it in my Home folder, I’ll use the below command in the Terminal window.

    ddrescue /media/my_disc/my_video.mp4 /home/gayan/recovered_video.mp4 logfile

    You can cancel the rescuing process anytime by pressing the “Ctrl” + “c” keys. And if you want to resume later, then make sure to always use the “logfile” argument, as shown.

    If you’re trying to recover a partition on a HDD, USB etc, then make sure to mount it with read-only permissions.

    It has an excellently written manual which explains a lot (changing the “buffer-size”, maximum error count etc) and I highly recommend that you read it. For that, use the below command.

    info ddrecsue

    Though it won’t always work out, but if you’re looking for an easy to use data recovery tool that you can use in Ubuntu (or GNU/Linux), then “Ddrescues” is a pretty powerful tool that will come in handy at times. Good luck.

    Share. Twitter Reddit Telegram WhatsApp Email
    Gayan

    An RHCE, 'Linux' user with 14+ years of experience. Extreme lover of Linux and FOSS. He is passionate to test every Linux distribution & compare with the previous release to write in-depth articles to help the FOSS community.

    Related Posts

    How to Check Linux CPU Usage?

    February 5, 2024

    Linux export Command: A Comprehensive Tutorial

    February 3, 2024

    Debian vs Ubuntu Server: A Brief Comparison for Beginners

    July 2, 2023

    CPU Based Simple System Stability and Benchmark Tester for Ubuntu Linux – systester

    June 16, 2023

    Typespeed: Typing Speed Testing Game for Ubuntu Linux

    March 12, 2023

    Debian vs Ubuntu in 2023- Which Linux OS is Right for You?

    January 6, 2023

    2 Comments

    1. Gerald Brown on August 5, 2017 5:52 pm

      I have used ddrescue to try to restore some accidentally deleted files. It ran for awhile and created a very large binary file. How can I recover the deleted files (if they are in this large file)?

      Thanks

      Reply
      • Gayan on August 6, 2017 8:10 am

        Hi Gerald,

        It’s been quite a while since I wrote the article… anyhow, the binary file has to be mounted in order for you to read its content. The below link should help you out:

        https://askubuntu.com/questions/194962/mounting-ddrescue-image-after-recovery-in-over-my-head

        Good luck.

        Reply
    Leave A Reply Cancel Reply

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

    Latest Posts

    Transforming Geek Culture with Advanced Software Development

    April 8, 2024

    The Role of Technology in Enhancing Digital Signage Solutions

    February 21, 2024

    How to Check Linux CPU Usage?

    February 5, 2024

    Linux export Command: A Comprehensive Tutorial

    February 3, 2024

    [Fixed] HDMI No Signal to TV or Monitor on Windows 10/11

    November 7, 2023

    AlmaLinux vs Ubuntu – How to Select the Best One?

    October 22, 2023

    Subscribe to Updates

    Get the latest news and updates from Hectic Geek. We won't overload you or sell your data!

    Contact
    • About Us
    • Contact Us
    • Privacy Policy
    • Write for Us
    X (Twitter)
    © 2026 Hectic Geek.

    Type above and press Enter to search. Press Esc to cancel.