Need help to Understand DD output

Sickdove

New Member
Credits
0
Please forgive me if this is not the right place to post this. The answer probably is short. I am trying to recover an almost(?) dead drive using DD.

I can't decipher the report of the kill command. In the image attached, if I read/understand the well, "records in vs records out" they should match right?

Any insight is much appreciated.
 

Attachments



sp331yi

Well-Known Member
Credits
4,041
Input and output are equal. But why does it repeat itself?
 

Sickdove

New Member
Credits
0
Input and output are equal. But why does it repeat itself?
The drive is dead indeed, hence attempting for 40hrs to save any good sectors using default parameters on a DD terminal. I am just not sure how to read the "Records In/Out" numbers.
 

sp331yi

Well-Known Member
Credits
4,041
Sum of Records In = # of Records Out
There, it should end.
But I am no DD expert, either, only go by experience.
See here
Sorry to hear of your troubles.
 

Vrai

Well-Known Member
Credits
1,782
Please forgive me if this is not the right place to post this. The answer probably is short. I am trying to recover an almost(?) dead drive using DD.

I can't decipher the report of the kill command. In the image attached, if I read/understand the well, "records in vs records out" they should match right?

Any insight is much appreciated.
If the drive is indeed "dying" I'm not sure "dd" is the best tool to use.
PhotoRec is reported to be useful in recovering data. But again - I'm not sure if it will be the 'best' tool for the job. https://www.cgsecurity.org/wiki/PhotoRec

I'm curious what the "kill command" has to do with recovering data?

It is hard to see just what is going on from the truncated screenshot. Can you post one of the whole screen?

One program I have had 'some' good results with is SpinRite. https://www.grc.com/sr/spinrite.htm
Depending on how important the data is it may be worth checking out.

Does the drive 'mount' at all? Are you able to mount it and see anything at all on it?
Keep in mind that attempting data recovery may stress the drive to the point that it may fail completely.
 

Sickdove

New Member
Credits
0
If the drive is indeed "dying" I'm not sure "dd" is the best tool to use.
PhotoRec is reported to be useful in recovering data. But again - I'm not sure if it will be the 'best' tool for the job. https://www.cgsecurity.org/wiki/PhotoRec

I'm curious what the "kill command" has to do with recovering data?

It is hard to see just what is going on from the truncated screenshot. Can you post one of the whole screen?

One program I have had 'some' good results with is SpinRite. https://www.grc.com/sr/spinrite.htm
Depending on how important the data is it may be worth checking out.

Does the drive 'mount' at all? Are you able to mount it and see anything at all on it?
Keep in mind that attempting data recovery may stress the drive to the point that it may fail completely.
Yes it's mounted and DD is running in Ubuntu recovery terminal. The kill command is used to display status of current process by DD on secondary terminal (alt+F2). Can's stop the process to download/install anything at this point.

The entire screen is pretty much a constant error, except when using kill to see status when I get the records in/out output which I am trying to figure out how to interpret.
 

Attachments

wizardfromoz

Super Moderator
Staff member
Gold Supporter
Credits
3,009
silly question maybe, but have you tried ^C ?

wizard
 

dos2unix

Well-Known Member
Credits
1,466
Just curious... what is the actual command you are running?
 

jglen490

Well-Known Member
Credits
1,981
Agree with dos2unix, what was your input parameter, and did you run it with sudo?

Just personally, I would try to use gparted to access and fix a messed up drive. Sometimes using dd with /dev/zero as the input file can help overwrite a lot of bad data. Even fsck can be useful.
 

Sickdove

New Member
Credits
0
Just curious... what is the actual command you are running?
fdisk -l <-- to get the drives

Bad drive =sdb
Backup drive =sda

dd if=/dev/sdb of=/dev/sda conv=sync,noerror <-- to start mirror process

Then launch a new terminal (alt+f2)

kill -usr1 xxx <---replaced xxx with PID#

swap between terminals alt+f1/f2
 

jglen490

Well-Known Member
Credits
1,981
So you are copying whatever was on your bad drive to your backup location. You seem to be getting nothing from dev/sdb. Try running back against sub and see if you can repair it that way first.
 

Tolkem

Well-Known Member
Credits
1,376
@Sickdove did you try testdisk? https://www.cgsecurity.org/wiki/TestDisk_Step_By_Step
is powerful free data recovery software! It was primarily designed to help recover lost partitions and/or make non-booting disks bootable again when these symptoms are caused by faulty software: certain types of viruses or human error (such as accidentally deleting a Partition Table). Partition table recovery using TestDisk is really easy.

TestDisk can

  • Fix partition table, recover deleted partition
  • Recover FAT32 boot sector from its backup
  • Rebuild FAT12/FAT16/FAT32 boot sector
  • Fix FAT tables
  • Rebuild NTFS boot sector
  • Recover NTFS boot sector from its backup
  • Fix MFT using MFT mirror
  • Locate ext2/ext3/ext4 Backup SuperBlock
  • Undelete files from FAT, exFAT, NTFS and ext2 filesystem
  • Copy files from deleted FAT, exFAT, NTFS and ext2/ext3/ext4 partitions.
TestDisk has features for both novices and experts. For those who know little or nothing about data recovery techniques, TestDisk can be used to collect detailed information about a non-booting drive which can then be sent to a tech for further analysis. Those more familiar with such procedures should find TestDisk a handy tool in performing onsite recovery.
I've used it to save data and it's a very reliable piece of software and it runs from the command line so if you're working with no DE which apparently you are but cli only then this might be of help. You can install it with
Code:
sudo apt-get install testdisk
it's just a few kbs and installs in seconds, once it is run
Code:
testdisk
and follow the instructions which are pretty straightforward.

Hope this helps! :)
 
Last edited:

sp331yi

Well-Known Member
Credits
4,041
OP -- I think I'd have checked for bad blocks after fdisk and your initial results. So you might try

$ sudo badblocks -v /dev/sdb > badsectors.txt

as well.

Then, perhaps, look at 'repairing' bad blocks
 
Last edited:

dos2unix

Well-Known Member
Credits
1,466
The thing about dd (disk duplicator) is that it duplicates everything. corrupt files, corrupt
filesystems, whatever is on the original.

Also.. dd is a "block copier" not a file copier. Make sure whatever your "dd'ing" too is big enough to hold it. You can't 'duplicate' a 512GB disk to a 256GB disk, even if you only have 10GB of files.
 

sp331yi

Well-Known Member
Credits
4,041
@Vrai, et al
Thx for stepping up for OP
I'm stll learning , too!
 


Members online


Top