LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 06-11-2021, 11:59 AM   #31
ScatteredThunder
Member
 
Registered: May 2021
Posts: 44

Original Poster
Rep: Reputation: Disabled

@computersavvy:

Also, I don't think I understand how to use photorec properly.

Here is a screenshot of photorec:

The recovery file is within /dev/sdb (ST4000DM). But it's not an exact copy of the failing drive, ddrescue outputted a .img file that I cannot mount or access or do anything.

So how do I proceed now?

Last edited by ScatteredThunder; 06-19-2021 at 05:17 PM.
 
Old 06-11-2021, 12:55 PM   #32
michaelk
Moderator
 
Registered: Aug 2002
Posts: 26,757

Rep: Reputation: 6318Reputation: 6318Reputation: 6318Reputation: 6318Reputation: 6318Reputation: 6318Reputation: 6318Reputation: 6318Reputation: 6318Reputation: 6318Reputation: 6318
You run photorec using the image file not the drive itself i.e.

photorec seagate-recovery-drive.img

Sector size depends on of if the drive uses 512 or 4k byte sectors. If you could mount the bad drive you can mount the drive image but otherwise photorec will search byte for byte the drive image file looking for matching patterns.
 
Old 06-11-2021, 01:36 PM   #33
ScatteredThunder
Member
 
Registered: May 2021
Posts: 44

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
You run photorec using the image file not the drive itself i.e.

photorec seagate-recovery-drive.img

Sector size depends on of if the drive uses 512 or 4k byte sectors. If you could mount the bad drive you can mount the drive image but otherwise photorec will search byte for byte the drive image file looking for matching patterns.
You mean select "option 1" instead of "option 0 [Whole Disk]" from the screenshot below?

Is that the correct setting?

Last edited by ScatteredThunder; 06-19-2021 at 05:17 PM.
 
Old 06-11-2021, 01:52 PM   #34
michaelk
Moderator
 
Registered: Aug 2002
Posts: 26,757

Rep: Reputation: 6318Reputation: 6318Reputation: 6318Reputation: 6318Reputation: 6318Reputation: 6318Reputation: 6318Reputation: 6318Reputation: 6318Reputation: 6318Reputation: 6318
No, quit photorec and retart it specifying the image file.

photorec seagate-recovery-drive.img
 
Old 06-11-2021, 02:33 PM   #35
ScatteredThunder
Member
 
Registered: May 2021
Posts: 44

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
No, quit photorec and retart it specifying the image file.

photorec seagate-recovery-drive.img
Thanks it's working!

But in this method I think I might need yet another 3TB hard drive (1 for reading the .img file and 1 for the destination/recovered files).
 
Old 06-11-2021, 06:14 PM   #36
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486
Ddrescue told you 24576 bytes data unreadable, and 3 bad sectors. All you have to do is read what you posted.
 
Old 06-12-2021, 10:35 AM   #37
ScatteredThunder
Member
 
Registered: May 2021
Posts: 44

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by computersavvy View Post
Ddrescue told you 24576 bytes data unreadable, and 3 bad sectors. All you have to do is read what you posted.
Sorry man I didn't see it.

So far photorec has been running for 19 hours straight and ETA suggests more 33 hours to go.

If I decide to abort operation now, will it continue where it left off?
 
Old 06-12-2021, 12:28 PM   #38
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486
Why would you want to abort? That would just delay the finish.

I suspect photorec would resume, but have not needed it so am not certain. You could check the documentation online to find out.
 
Old 06-13-2021, 03:43 PM   #39
ScatteredThunder
Member
 
Registered: May 2021
Posts: 44

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by computersavvy View Post
Why would you want to abort? That would just delay the finish.

I suspect photorec would resume, but have not needed it so am not certain. You could check the documentation online to find out.
Well I dunno man. First day ETA was 33 hours, and now it shows 82 hours? And ETA keeps increasing over time:

There must be something wrong with this.

Last edited by ScatteredThunder; 06-19-2021 at 05:17 PM.
 
Old 06-13-2021, 04:04 PM   #40
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486
My thought now would be to check if the drive is full, especially since the recovered data is being placed back on the 4TB drive along with the disk image. It is showing about 83,000 files already recovered and if it is out of space then may keep trying with no results.

Maybe a simple df command can tell you that. If the drive is full then moving some of the recovered files to someplace else might allow it to finish. Do you have any idea how much space was actually occupied by files on the drive that failed?

17K txt files, 15K exe files, 9K pictures, 500 cabs, >2000 gz files, all could be moved to allow space for more. Even moving them off to flash drives is an option if you don't have ~1 TB free disk space on other HDDs..
 
Old 06-14-2021, 07:55 AM   #41
ScatteredThunder
Member
 
Registered: May 2021
Posts: 44

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by computersavvy View Post
Do you have any idea how much space was actually occupied by files on the drive that failed?
If I remember correctly, there was only about ~50-60GB of free space out of a total of 2,7TB disk space (Seagate 3TB bad drive).

So I left photorec doing the recovery overnight and upon checking it now the process has stopped prematurely (or ended, not sure). It has only recovered 1,1TB worth of files though.

When I woke up this morning photorec was showing this window:

By the way, which option is the correct one from the window above? The current selected option or the no partition [whole disk] one?

Thanks!

Last edited by ScatteredThunder; 06-19-2021 at 05:17 PM.
 
Old 06-14-2021, 10:08 AM   #42
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486
The figures you give imply that you had about 2+TB of data on that old drive (and in the image file). The free space on that new drive was about 1 TB. If photorec ended it likely was due to being out of space for storing the recovered files.

The df command I mentioned earlier will tell the story. You will likely see an total of ~3.7 TiB, used ~3.7 TiB, available ~0, and used% of ~100%. The only way to continue now is by having more space where photorec can put the output. You need either an additional drive or remove some of the files filling the ~1 TB recovery space on that drive.

Continuing is the same as you did originally. You do not want to change anything (except possibly the output). Changing the input would mean restarting at the beginning, and the time already spent would be lost along with the records photorec has of what it has already done.

Last edited by computersavvy; 06-14-2021 at 10:14 AM.
 
Old 06-14-2021, 11:51 AM   #43
ScatteredThunder
Member
 
Registered: May 2021
Posts: 44

Original Poster
Rep: Reputation: Disabled
Okay. But I tried doing something different here.

As I was running out of storage, I decided to take a risk and store all the recovered files in the same bad drive because I suspect the issue was the Seagate USB3.0 enclosure. So I took the hard drive out of the USB enclosure and deleted all partitions and created a new GPT partition table on it. It's working fine thus far but haven't run many tests yet (there may be a few bad sectors though).

On the amount of data, I am pretty sure I had more than 2TB on that bad drive. What happened was that I tried something with testdisk which resulted in the creation of a 2,2TB partition. But I had over 2TB worth of data in that bad drive!

Just out of curiosity, what would happen if I tried the "no partition [Whole disk]" option from the screen below?

Last edited by ScatteredThunder; 06-19-2021 at 05:17 PM.
 
Old 06-14-2021, 12:14 PM   #44
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486
If I am understanding correctly, you now want to try a complete new recovery process reading from the image file and writing to the original failing drive that has known bad sectors.

I think as an interim step that is possible. You are taking a risk that data recovered may be written to sectors that are bad, but not marked as such, which could result in more corruption.

If you do that, then when the recovery using photorec is done you should verify the partition on the old drive can still be mounted and read. If so then wipe out the image file from the new drive and immediately copy the data back to the new drive so you minimize the time you are at risk.
 
Old 06-14-2021, 02:28 PM   #45
ScatteredThunder
Member
 
Registered: May 2021
Posts: 44

Original Poster
Rep: Reputation: Disabled
Okay man thanks!

Just one more question... how do I run the df command?
 
  


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
e2label: Superblock checksum does not match superblock while trying to open /dev/sdb3 Couldn't find valid filesystem superblock. Pen guin Linux - Newbie 26 07-05-2020 11:03 AM
External floppy -- Can't Read Superblock ericlindellnyc Linux - Newbie 8 10-07-2018 01:32 PM
CDROM can't read/can't read superblock microomran Red Hat 1 07-05-2007 03:29 AM
"Can't Read Superblock" when mounting a second hard drive Maeltor Linux - Software 7 01-18-2007 01:13 PM
error mounting ext3 filesystem... mount: /dev/hdd1: can't read superblock versaulis Linux - Software 5 11-26-2006 08:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

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