LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-30-2020, 08:53 AM   #16
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,877
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930

Quote:
Originally Posted by syg00 View Post
As a general rule I always advocate that a disk that is suspected of being faulty should be stressed as little as possible. Take an image and work on an image of that image. If things mess up, take another image of the first image and try again.
ddrescue with a logfile as you are doing is the best way to get an image with least stress if the disk is failing. You can then try any of the forensic tools without worry of making the origin situation worse.
I second this advice.

Regardless of whichever method you try, taking an image of the drive is a best, first option, which can be performed with ddrescue.

This seems as if the recovery process is confusing to you, gkd.

Photorec will only recover files which are no longer active, as in deleted files, or fragments of files it can find that were overwritten and thus made not to be current valid files.

If the drive is not performing well so that you cannot access files, making an image of it will allow you to work with that image and possibly recover files which are corrupted by a bad drive.

It's hard to say. The files you were able to copy, those should be all set. If you're able to successfully make an image, then I'd work with that.

At some point it may turn into diminishing returns. Meaning the time, effort, and space exerted to recover files, and maybe partially recover files, not all and not all in entirety, may not be worth your while, you'll have to assess this.

I would re-reference syg00's signature here:
Quote:
Originally Posted by syg00
I always presume you have a verified B-A-C-K-U-P before taking any advice given.
And also reference a comment from the site guidelines:
Quote:
We would like to stress that you should fully understand what a recommended change may do to your system.
I recommend assessing the recommendations, prior to proceeding with any future commands.
 
Old 12-30-2020, 09:57 AM   #17
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,770

Rep: Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210
Note that photorec does not recover file names. It totally ignores the filesystem and goes after the underlying data. Blocks of data that have a recognizable format are stored with newly generated names.

For the initial run of ddrescue, leave the "-r" (--retry-passes) option at its default of 0. Once all the easily read data has been recovered, you can rerun (using the same log file) with a non-zero value to attempt rereads of previously detected bad sectors.

Sometimes, ddrescue will run much faster if you use the "-d" (--idirect) option. This helps by preventing the kernel from doing its own retries of bad reads. Note that you have to set the sector-size correctly if the drive does not have 512-byte physical sectors.

Last edited by rknichols; 12-30-2020 at 10:05 AM. Reason: Mention using --idirect
 
Old 12-30-2020, 06:13 PM   #18
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,327

Rep: Reputation: 1481Reputation: 1481Reputation: 1481Reputation: 1481Reputation: 1481Reputation: 1481Reputation: 1481Reputation: 1481Reputation: 1481Reputation: 1481
Quote:
Originally Posted by platypo View Post
That taken into consideration it would be good advice to use ddrescue the faulty 1TB drive to the healthy one and use photorec on the latter.
As has been said an image then working with the image is best. However, dd (and ddrescue) will always try to copy every byte of the original disk and if you are not writing to a partition with more space than the original disk then you will likely run out of room and have to start over, with totally wasted time and stress on the failing drive.

It was recommended to use photorec, and the web site where that is hosted gives fairly good directions in usage. Photorec has a major advantage over both dd and ddrescue in the size of the output. It only saves what it identifies as file data, instead of the probably many MB or GB of null bytes on the disk.

The thing you have to remember with any rescue tool is that they all have to read bit for bit the content of the source and either copy it (ddrescue or dd) or put it together as a file (photorec). All of that reading of a TB of disk space can take a long time. Every time that is interrupted it adds to the time needed.

One thing that might improve the speed of dd or ddrescue would be to use the block size option and set it to a value significantly larger than the default 512 bytes. I routinely use bs=32M or bs=64M, sometimes even larger depending on the free memory on the system.
 
Old 12-31-2020, 01:38 PM   #19
gkd
LQ Newbie
 
Registered: Dec 2020
Posts: 8

Original Poster
Rep: Reputation: Disabled
I have a drive "wd my passport" 1tb. I am connecting it on Ubuntu 20LTS.

I am not able to open any data, not even able to copy or move any data. While Coying ubuntu gives error of I/O.

But I am able to delete few files and folder which is not necessary.

Why is so?

I even tried ddrescue to recover ,but it's very slow, too slow.I lost my patience and got recovered 1gb of data through ddrescue and then deleted the .img file also.

I even tried a powershell script in windows 10 , script was developed by davor josipovic.But copying ecah file separately is hard job and time taking.

I just want to know why deleting files is easy and accessing files hard? What can be the solution to get files fastest and easiest way possible
 
Old 12-31-2020, 01:46 PM   #20
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,770

Rep: Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210
Quote:
Originally Posted by gkd View Post
I have a drive "wd my passport" 1tb. I am connecting it on Ubuntu 20LTS.

I am not able to open any data, not even able to copy or move any data. While Coying ubuntu gives error of I/O.

But I am able to delete few files and folder which is not necessary.

Why is so?
Deleting a file just requires access to the filesystem metadata. The file's actual data blocks are not accessed at all. Reading a file of course requires access to the data blocks.
 
Old 12-31-2020, 04:45 PM   #21
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,877
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Quote:
Originally Posted by gkd View Post
I have a drive "wd my passport" 1tb. I am connecting it on Ubuntu 20LTS.

I am not able to open any data, not even able to copy or move any data. While Coying ubuntu gives error of I/O.

But I am able to delete few files and folder which is not necessary.

Why is so?

I even tried ddrescue to recover ,but it's very slow, too slow.I lost my patience and got recovered 1gb of data through ddrescue and then deleted the .img file also.

I even tried a powershell script in windows 10 , script was developed by davor josipovic.But copying ecah file separately is hard job and time taking.

I just want to know why deleting files is easy and accessing files hard? What can be the solution to get files fastest and easiest way possible
Is this the same drive, or a different one?

What's incorrect about following advice from earlier in the thread about using ddrescue or photorec?

Assuming you added to a running Ubuntu machine and after it mounted, you got some errors, but then you deleted some files?

Is this about recovery, getting a drive to "just work", or what exactly?

Hard to make recommendations, first if data on a drive is critical and you don't know much about recovery techniques, there are vendors who can help, but yes they are costly. If you wish to explore trying things out yourself, all good, but you seem to be switching between Linux and Windows and trying some number of things. Those attempts seem pseudo random, in that they're learned attempts from your prior experiences, but they also appear to be not fully organized methods.

At this time, it's confusing what you wish to do or accomplish, the best advice I think stands from multiple persons, do not write to a drive you intend to try to recover (deleting files constitutes writing to a drive by the way), also, make an image of the drive and work with the image, or a copy of the image. Then use the programs cited to try to recover files from the disk image.

I'm not sure that I've seen you post any update where using one of these programs has yielded any recovered data, instead you've terminated the programs. I can say that for Photorec, you can examine the recovered archive directory and find incremental file fragments as they get recovered. You will be able to see some results while the recovery process is occurring.

Best of luck with your efforts.
 
Old 01-01-2021, 04:26 AM   #22
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
Quote:
Originally Posted by gkd View Post
I even tried ddrescue to recover ,but it's very slow, too slow.I lost my patience and got recovered 1gb of data through ddrescue and then deleted the .img file also.
So why should we waste our time helping ?. Goodbye.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
LXer: Interview With GNU DDRescue's Antonio Diaz Diaz LXer Syndicated Linux News 0 08-15-2007 07:11 PM
What are the proper disc permissions for ddrescue? pieper Linux - Newbie 5 03-26-2007 03:41 AM
ddrescue and moving files help PiZZLE Linux - Software 9 03-13-2007 08:19 PM
LXer: Recover Data From a dead hard drive using ddrescue LXer Syndicated Linux News 0 11-28-2006 02:03 PM
Advice needed: data recovery from NTFS disk using ddrescue and Ubuntu afzal_b Linux - Newbie 10 09-20-2006 09:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:36 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