LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old Today, 11:03 PM   #1
exerceo
Member
 
Registered: Oct 2022
Posts: 67

Rep: Reputation: 18
Lightbulb [Guide] Using dd for data recovery from damaged media.


[Log in to get rid of this advertisement]
Normal file managers and the "cp" command give up at the first I/O error.

There is already "ddrescue", but that is not pre-installed on most systems and you might not have Internet access that is needed to download ddrescue, so this is what you can do with the pre-installed "dd":

First, create a recovery directory:

Code:
mkdir ~/recovered
Then, create a blank reference file with the same size of the damaged file.
Code:
truncate --reference=damaged.mp3 ~/recovered/damaged.mp3
Then recover the damaged file:

Code:
dd if=damaged.mp3 of=~/recovered/damaged_file.mp3 conv=sync,notrunc,noerror ibs=2048
The "noerror" option, as you might guess, tells dd not to give up when encountering an I/O error.

The "sync" option fills unreadable sectors with null bytes (00) in the output file so the readable parts of the data in the output file are aligned with the input file. This is necessary for some file types such as WMA. Unlike MP3 files, WMA files are unplayable if the data is misaligned.

The "notrunc" option prevents the output file "~/recovered/damaged_file.mp3" from being reset to zero size when the recovery process starts.

Values for ibs=: 2048 or 2K for optical discs (CD, DVD, BluRay), 512 for small flash media (USB sticks, SD and MicroSD cards), 4096 or 4K for large external media (SSD, HDD).
 
  


Reply

Tags
dd



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mount damaged ext4 image as read-only without "recovery" exerceo Linux - Software 1 10-23-2022 10:08 PM
Disk Partition damaged - how can I rescue damaged partition ray98 Linux - General 7 10-24-2014 09:05 AM
Data Recovery, debugfs, damaged drives - is there a better OSS tool? bapigoo9 Linux - Newbie 4 01-11-2009 04:40 PM
LXer: Linux Data Recovery on Windows - Is possible through Disk Doctors Linux Recovery Software LXer Syndicated Linux News 0 10-22-2006 01:21 PM
Using Linux to recover data on a damaged Windows partition? Korff Linux - General 5 12-29-2003 12:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration