LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-02-2021, 12:22 PM   #16
ScatteredThunder
Member
 
Registered: May 2021
Posts: 44

Original Poster
Rep: Reputation: Disabled

Quote:
Originally Posted by computersavvy View Post
No, a 3TB image. In post #6 you said the physical size of that disk is 3TB so that will be the size of the image. The 2.2 is from the corrupt partition table.
The 2.2TB partition is the corrupt partition? I thought the entire 3TB partition was already corrupt even before running testdisk.

I don't think I will have enough disk space to fit a 3TB image file for now unless I buy another equally-sized hard drive.

Can anybody think of any alternatives to this? Like for example, does ddrescue and/or photorec have an option to split the image into smaller filesizes?
 
Old 06-02-2021, 02:57 PM   #17
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485
You keep posting data from the attempts to do a recovery. What you need to keep track of is the device size, not the corrupt data being reported.

Ddrescue does not split images. Its output is a full image of the device.
I have not used photorec but since the output is recovered files it may be possible to use a smaller output device.

Regardless, the recommendation is still to do a full image with ddrescue then use photorec on that image, not on the failing drive. The more you use that failing drive the worse the damage becomes.

A new 4TB drive at newegg.com is only ~$105. That is an NAS drive that uses CMR recording tech so it does not have the problems with data that cheaper desktop drives (like the WD Blue or Seagate Barracuda series) using the SMR tech have.

Last edited by computersavvy; 06-02-2021 at 03:02 PM.
 
Old 06-02-2021, 04:22 PM   #18
remmilou
Member
 
Registered: Mar 2010
Location: Amsterdam
Distribution: MX Linux (21)/ XFCE
Posts: 217

Rep: Reputation: 70
ddrescue

Quote:
Originally Posted by computersavvy View Post
Do the backup copy with ddrescue before you do anything else. You do not want to cause more damage.

The disk was originally msdos partition table and something you have done (even unintentionally) has corrupted the partition table. Get the copy first if you want any hope of recovery.
Absolutely true. And ddrescue is indeed much, much better than dd. Especially for damaged disks!
ddrescue rules!
 
Old 06-09-2021, 04:11 PM   #19
ScatteredThunder
Member
 
Registered: May 2021
Posts: 44

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by computersavvy View Post
You keep posting data from the attempts to do a recovery. What you need to keep track of is the device size, not the corrupt data being reported.

Ddrescue does not split images. Its output is a full image of the device.
I have not used photorec but since the output is recovered files it may be possible to use a smaller output device.

Regardless, the recommendation is still to do a full image with ddrescue then use photorec on that image, not on the failing drive. The more you use that failing drive the worse the damage becomes.

A new 4TB drive at newegg.com is only ~$105. That is an NAS drive that uses CMR recording tech so it does not have the problems with data that cheaper desktop drives (like the WD Blue or Seagate Barracuda series) using the SMR tech have.
Okay so my new hard drive finally arrived and am running ddrescue right now.

So I bought this new 4TB hard drive and it is recognized as /dev/sdc (I named the recently created Ext4 partition as "BACKUP"). The faulty 3TB hard drive is recognized as /dev/sdb:

Now I am running ddrescue and the application says it's going to take 14 hours and 13 minutes?

Can you guys check if all settings are correct? I didn't know what to do with the 'Recovery Map File (previously called logfile)' setting in ddrescue.

Last edited by ScatteredThunder; 06-19-2021 at 06:15 PM.
 
Old 06-09-2021, 04:31 PM   #20
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485
14 hours is good for the size drive.

The map file is for use later in case you have some interruption to the process; ddrescue can use it to restart where it let off instead of at the beginning.

I am not sure about the destination in that screenshot image. It looks like you are writing directly to /dev/sdc and not to an image file in /media/ubuntubox/BACKUP/. If so then it will destroy the partition you created and /dev/sdc will look exactly like /dev/sdb when it is done.

You need to select the location and give it a file name to write to. After all, you are trying to create an image file, not copy the failing drive to another.

Last edited by computersavvy; 06-09-2021 at 04:34 PM.
 
Old 06-09-2021, 04:47 PM   #21
ScatteredThunder
Member
 
Registered: May 2021
Posts: 44

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by computersavvy View Post
14 hours is good for the size drive.

The map file is for use later in case you have some interruption to the process; ddrescue can use it to restart where it let off instead of at the beginning.

I am not sure about the destination in that screenshot image. It looks like you are writing directly to /dev/sdc and not to an image file in /media/ubuntubox/BACKUP/. If so then it will destroy the partition you created and /dev/sdc will look exactly like /dev/sdb when it is done.

You need to select the location and give it a file name to write to. After all, you are trying to create an image file, not copy the failing drive to another.
Man, I don't know what's going on right now.

I tried to abort the process, reboot the PC (because ddrescue wouldn't shutdown) and now I am trying to start the entire process again but the new 4TB hard drive is giving me some very concerning issues.

So I deleted the existing partition on the new 4TB drive (named 'BACKUP') and tried to create another clean partition but GParted is giving me this error message:

Code:
partition length of 7814033408 sectors exceeds the mdsdos-partition-table-imposed maximum of 4294967295
From what I see, after the reboot ddrescue created a 2,2TB partition on the new 4TB drive just like the faulty 3TB drive.

Does that mean I damaged the partition table of the new 4TB drive or something? I can't create new 4TB partitions on the new 4TB hard drive!

Last edited by ScatteredThunder; 06-19-2021 at 06:16 PM.
 
Old 06-09-2021, 05:00 PM   #22
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485
If gparted will not let you erase the partition table then you may need to wipe the beginning of the new drive. I would first try with gparted to create a new blank partition table then recreate your large partition.

If gparted fails then you can wipe the first part of the drive with a simple dd command to zero the beginning of the drive
Code:
sudo dd if=/dev/zero of=/dev/sdc bs=1M count=10
That will zero out the first 10M of the drive. You then should be able to use gparted and recreate the partition table and the large partition.
 
Old 06-09-2021, 05:11 PM   #23
ScatteredThunder
Member
 
Registered: May 2021
Posts: 44

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by computersavvy View Post
If gparted will not let you erase the partition table then you may need to wipe the beginning of the new drive. I would first try with gparted to create a new blank partition table then recreate your large partition.

If gparted fails then you can wipe the first part of the drive with a simple dd command to zero the beginning of the drive
Code:
sudo dd if=/dev/zero of=/dev/sdc bs=1M count=10
That will zero out the first 10M of the drive. You then should be able to use gparted and recreate the partition table and the large partition.
Thank you man! I tried to create a new GPT partition table using GParted and apparently the process went fine. I was then able to successfully create a 4TB Ext4 partition on the new drive oh god!

So I am back at square one with ddrescue now.

What did I do wrong? Why is ddrescue doing an exact copy of the faulty 3TB drive onto the new 4TB drive? I know it's something related to ddrescue settings.

How should the settings in ddrescue look like in order for it to create an image file of the faulty 3TB onto the new 4TB drive?
 
Old 06-09-2021, 08:41 PM   #24
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485
Let me test it here.
 
Old 06-09-2021, 09:08 PM   #25
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485
It seems you are using ddrescue-gui which has some limitations.

If you use just ddrescue from the command line it will do what you want. You have to enter the command similar to what is used with dd as dd is the underlying structure.

I think that using the command line, a command such as
Code:
sudo ddrescue --sectorsize=4096  /dev/sdb /media/ubuntubox/BACKUP/sdb.img /media/ubuntubox/BACKUP/mapfile
will create a file named sdb.img and the accompanying mapfile in the mounted partition filesystem /media/ubuntubox/BACKUP/. Use the man page for ddrescue to see what options are available and adjust the command above to your needs.

It appears the gui does not give you the option to create the image file, but writes directly to the device.
 
Old 06-10-2021, 03:01 PM   #26
ScatteredThunder
Member
 
Registered: May 2021
Posts: 44

Original Poster
Rep: Reputation: Disabled
Hey!

I think I got it working correctly now upon fiddling with ddrescue settings.

The incorrect setting was the 'Image Destination' option where I have to specify a location for the image file manually.

Let's see what it can do...

I'll post the results when it's done.

Thank you man!

Last edited by ScatteredThunder; 06-19-2021 at 06:16 PM.
 
Old 06-10-2021, 04:45 PM   #27
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485
looks good so far
 
Old 06-11-2021, 08:13 AM   #28
ScatteredThunder
Member
 
Registered: May 2021
Posts: 44

Original Poster
Rep: Reputation: Disabled
Okay. Ddrescue finished the recovery process:

But I still can't mount or access files from the image file that ddrescue created:

What should I do now?

Last edited by ScatteredThunder; 06-19-2021 at 06:16 PM.
 
Old 06-11-2021, 11:32 AM   #29
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485
Now you use photorec on that image file you created and hopefully most of the data can be recovered.

If not already done then disconnect the failing drive and leave it aside. It should no longer be needed.

Notice that ddrescue told you it found 3 bad sectors. Probably photorec could have recovered all but the data in those 3 sectors easily had you not changed the partition table.

Last edited by computersavvy; 06-11-2021 at 11:36 AM.
 
Old 06-11-2021, 12:40 PM   #30
ScatteredThunder
Member
 
Registered: May 2021
Posts: 44

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by computersavvy View Post
Now you use photorec on that image file you created and hopefully most of the data can be recovered.

If not already done then disconnect the failing drive and leave it aside. It should no longer be needed.

Notice that ddrescue told you it found 3 bad sectors. Probably photorec could have recovered all but the data in those 3 sectors easily had you not changed the partition table.
Wait.

What does that mean exactly? Does it mean ddrescue could not recover all the data in the failing drive? But it says "Recovered Data: 3000.0GB" and "pct rescued: 99.99%".

And just out curiosity, how much data in GBytes equals 3 bad sectors approximately?

Last edited by ScatteredThunder; 06-19-2021 at 06:16 PM.
 
  


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 12:03 PM
External floppy -- Can't Read Superblock ericlindellnyc Linux - Newbie 8 10-07-2018 02:32 PM
CDROM can't read/can't read superblock microomran Red Hat 1 07-05-2007 04:29 AM
"Can't Read Superblock" when mounting a second hard drive Maeltor Linux - Software 7 01-18-2007 02:13 PM
error mounting ext3 filesystem... mount: /dev/hdd1: can't read superblock versaulis Linux - Software 5 11-26-2006 09:34 PM

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

All times are GMT -5. The time now is 11:24 AM.

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